[FIX] avoid crashing on fonts which reportlab can't load yet does not throw a TTFError on

bzr revid: xmo@openerp.com-20140109103040-2i5prvhoag33ij1g
This commit is contained in:
Xavier Morel
2014-01-09 11:30:40 +01:00
parent 43bc13de27
commit d80afb469f
+2 -2
View File
@@ -81,7 +81,7 @@ class res_font(osv.Model):
font = ttfonts.TTFontFile(font_path)
_logger.debug("Found font %s at %s", font.name, font_path)
found_fonts.append((font.familyName, font.name, font_path, font.styleName))
except ttfonts.TTFError:
except Exception:
_logger.warning("Could not register Font %s", font_path)
for family, name, path, mode in found_fonts:
@@ -112,4 +112,4 @@ class res_font(osv.Model):
def clear_caches(self):
"""Force worker to resync at next report loading by setting an empty font list"""
customfonts.CustomTTFonts = []
return super(res_font, self).clear_caches()
return super(res_font, self).clear_caches()