mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Dont crash on non ascii font names
This commit is contained in:
parent
f0cacacb7e
commit
f543426171
@ -296,10 +296,12 @@ def get_font_families(cached=None):
|
||||
else:
|
||||
zlist = []
|
||||
for ff in ffiles:
|
||||
if 'Optane' in str(ff):
|
||||
font = describe.openFont(ff)
|
||||
wt, italic = describe.modifiers(font)
|
||||
print ff, wt, italic
|
||||
try:
|
||||
if 'Optane' in str(ff):
|
||||
font = describe.openFont(ff)
|
||||
wt, italic = describe.modifiers(font)
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
font = describe.openFont(ff)
|
||||
except: # Some font files cause ttfquery to raise an exception, in which case they are ignored
|
||||
|
Loading…
x
Reference in New Issue
Block a user