Exemplo n.º 1
0
def do_kern_for_pairs(dir_path, fontfilename, weights_str, kernlistdir):
    x = 0
    #
    _dir = dir_path + '/'
    #
    weights = weights_str.split(',')
    #
    get_kern_pair_file_to_tupple(fontfilename, weights, kernlistdir)
    #
    for w in weights:
        #
        print(_dir + fontfilename + "_" + w + ".ufo")
        #
        in_fnt = _dir + fontfilename + "_" + w + "_krn.ufo"
        out_fnt = _dir + fontfilename + "_" + w + "_krn_fix.ufo"
        #
        pseudo_argv = ('--ufo-src-path', in_fnt, '--ufo-dst-path', out_fnt,
                       '--min-distance-ems', '0.04', '--max-distance-ems',
                       '0.05', '--max-x-extrema-overlap-ems', '0.1',
                       '--intrusion-tolerance-ems', '0.02', '--precision-ems',
                       '0.005', '--glyph-pairs-to-kern')

        autokernArgs = TFSMap()
        AutokernSettings(autokernArgs).getCommandLineSettings(*(pseudo_argv +
                                                                pairlist[w]))
        autokern = Autokern(autokernArgs)
        autokern.process()
        #
        x = x + 1
        #
        print('Completed:' + w + ' ' + str(x) + '/' + str(len(weights)) +
              '\n' + ' Produced Kerned UFO:' + out_fnt)
        #
        print('Replace the kern.plist at your leasure')
def do_kern_for_pairs(dir_path, fontfilename, weights_str):
    x = 0
    #
    _dir = dir_path + '/'
    #
    weights = weights_str.split(',')
    #
    #
    for w in weights:
        #
        print(_dir + fontfilename + "_" + w + ".ufo")
        #
        in_fnt = _dir + fontfilename + "_" + w + ".ufo"
        out_fnt = _dir + fontfilename + "_" + w + "_krn.ufo"
        #
        pseudo_argv = (
            '--ufo-src-path',
            in_fnt,
            '--ufo-dst-path',
            out_fnt,
            '--min-distance-ems',
            '0.08',
            '--max-distance-ems',
            '0.10',
            '--max-x-extrema-overlap-ems',
            '0.10',
            '--intrusion-tolerance-ems',
            '0.02',
            '--precision-ems',
            '0.005',
            #'--log-path',
            #'/media/root/Malysh1/winshm/advent_repo/Advent/scripts/kerning_scripts/kern_log/log',
            #'--log-basic-pairs',
            #'--write-kerning-pair-logs'
        )

        print('pseudo_argv', ' '.join([str(arg) for arg in pseudo_argv]))

        autokernArgs = TFSMap()
        AutokernSettings(autokernArgs).getCommandLineSettings(*pseudo_argv)
        autokern = Autokern(autokernArgs)
        autokern.process()
        #
        x = x + 1
        #
        print('Completed:' + w + ' ' + str(x) + '/' + str(len(weights)) +
              '\n' + ' Produced Kerned UFO:' + out_fnt)
        #
        print('Replace the kern.plist at your leasure')
Exemplo n.º 3
0
#
pseudo_argv = ('--ufo-src-path',
				os.path.join(pardir,'advent_pro','advent_pro_thn.ufo'),
				'--ufo-dst-path',
				os.path.join(pardir,'advent_pro','advent_pro_thn_flat_kern.ufo'),
				'--min-distance-ems',
				'0.05',
				'--max-distance-ems',
				'0.1',
				'--max-x-extrema-overlap-ems',
				'0.1',
				'--intrusion-tolerance-ems',
				'0.4',
				'--precision-ems',
				'0.02',
				#'--log-path',
				#os.path.join(pardir,'logs','log'),
				#'--log-basic-pairs',
				#'--write-kerning-pair-logs',
				)

print ('pseudo_argv', ' '.join([str(arg) for arg in pseudo_argv]))

autokernArgs = TFSMap()

AutokernSettings(autokernArgs).getCommandLineSettings(*pseudo_argv)
autokern = Autokern(autokernArgs)
autokern.process()

print ('complete.')
Exemplo n.º 4
0
##                '0.025',
#                '--precision-ems',
##                '0.001',
#                '0.005',
                '--log-path',
                os.path.abspath(os.path.join(TFSProject.findProjectRootFolder(), 'logs')),
##                '--log-basic-pairs',
##                '--disparity-log-count',
##                '25',
#                '--disparity-log-count',
#                '0',
##                '--kern-samples-only',
#                '--write-kerning-pair-logs',
#                '--glyph-pairs-to-kern',
#                'r', 'a',
##                'T', 'T',
##                'C', 'O',
##                'i', 'J',
##                'a', 'm',

               )
print 'pseudo_argv', ' '.join([str(arg) for arg in pseudo_argv])

autokernArgs = TFSMap()
AutokernSettings(autokernArgs).getCommandLineSettings(*pseudo_argv)
autokern = Autokern(autokernArgs)
autokern.process()

print
print 'complete.'