mirror of
https://github.com/ToxicFrog/Ligaturizer.git
synced 2024-08-16 21:30:30 +03:00
Generate font type corresponding to input font
This commit is contained in:
parent
7421e3c844
commit
ff89b86078
@ -282,8 +282,15 @@ def ligaturize_font(input_font_file, output_dir, ligature_font_file,
|
||||
# the underline width when you call generate().
|
||||
font.upos += font.uwidth
|
||||
|
||||
# Generate font type (TTF or OTF) corresponding to input font extension
|
||||
# (defaults to TTF)
|
||||
if input_font_file[-4:].lower() == '.otf':
|
||||
output_font_type = '.otf'
|
||||
else:
|
||||
output_font_type = '.ttf'
|
||||
|
||||
# Generate font & move to output directory
|
||||
output_font_file = path.join(output_dir, font.fontname + '.ttf')
|
||||
output_font_file = path.join(output_dir, font.fontname + output_font_type)
|
||||
print(" ...saving to '%s' (%s)" % (output_font_file, font.fullname))
|
||||
font.generate(output_font_file)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user