fix font hack

This commit is contained in:
Damien Elmes 2018-11-15 14:04:08 +10:00
parent beaca57129
commit 204ed5c18a

View file

@ -991,9 +991,9 @@ class EditorWebView(AnkiWebView):
runHook("EditorWebView.contextMenuEvent", self, m) runHook("EditorWebView.contextMenuEvent", self, m)
m.popup(QCursor.pos()) m.popup(QCursor.pos())
# QFont returns "Kozuka Gothic Pro L" but WebEngine expects "Kozuka Gothic Pro" # QFont returns "Kozuka Gothic Pro L" but WebEngine expects "Kozuka Gothic Pro Light"
# - there may be other cases like a trailing 'Bold' that need fixing, but will # - there may be other cases like a trailing 'Bold' that need fixing, but will
# wait for further reports first. # wait for further reports first.
def fontMungeHack(font): def fontMungeHack(font):
return re.sub(" L$", "", font) return re.sub(" L$", " Light", font)
addHook("mungeEditingFontName", fontMungeHack) addHook("mungeEditingFontName", fontMungeHack)