Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions ttf2web.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,8 @@ def __init__(self, fontfile, uranges, assetdir="assets", fontstyle=None, fontwei
subfamily = font['name'].getDebugName(2)
font.close()

self.fontstyle = fontstyle
if fontstyle is None:
self.fontstyle = 'italic' if subfamily == 'Italic' else 'normal'

self.fontweight = fontweight
if fontweight is None:
self.fontweight = '700' if subfamily == 'Bold' else '400'
self.fontstyle = fontstyle or ('italic' if 'Italic' in subfamily else 'normal')
self.fontweight = fontweight or ('700' if 'Bold' in subfamily else '400')

def _writeCssRule(self, handle, url, unicoderange):
print('@font-face {', file=handle)
Expand Down