diff --git a/ttf2web.py b/ttf2web.py index b3b4631..97a706e 100755 --- a/ttf2web.py +++ b/ttf2web.py @@ -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)