Skip to content

Commit

Permalink
Generate font type corresponding to input font
Browse files Browse the repository at this point in the history
  • Loading branch information
injust authored and ToxicFrog committed Dec 23, 2018
1 parent 7421e3c commit ff89b86
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ligaturize.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit ff89b86

Please sign in to comment.