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:
|
else:
|
||||||
zlist = []
|
zlist = []
|
||||||
for ff in ffiles:
|
for ff in ffiles:
|
||||||
if 'Optane' in str(ff):
|
try:
|
||||||
font = describe.openFont(ff)
|
if 'Optane' in str(ff):
|
||||||
wt, italic = describe.modifiers(font)
|
font = describe.openFont(ff)
|
||||||
print ff, wt, italic
|
wt, italic = describe.modifiers(font)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
try:
|
try:
|
||||||
font = describe.openFont(ff)
|
font = describe.openFont(ff)
|
||||||
except: # Some font files cause ttfquery to raise an exception, in which case they are ignored
|
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