Conversion: Handle invalid font-family when subsetting

Conversion: Fix font declarations with invalid font-family values
causing conversion to abort when subsetting is enabled.
This commit is contained in:
Kovid Goyal 2013-09-02 09:23:05 +05:30
parent 807213d5d0
commit 8d693050a5

View File

@ -27,7 +27,7 @@ def get_font_properties(rule, default=None):
val = s.getProperty(q).propertyValue[0]
val = getattr(val, g)
if q == 'font-family':
val = [x.value for x in s.getProperty(q).propertyValue]
val = [x.value for x in s.getProperty(q).propertyValue if hasattr(x.value, 'lower')]
if val and val[0] == 'inherit':
val = None
except (IndexError, KeyError, AttributeError, TypeError, ValueError):