Dont crash on non ascii font names

This commit is contained in:
Kovid Goyal 2008-03-30 01:35:31 +00:00
parent f0cacacb7e
commit f543426171

View File

@ -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