Add support for multiple fonts and unicode
@@ -163,13 +163,17 @@ class pisaCSSBuilder(css.CSSBuilder):
# The "src" attribute can be a CSS group but in that case
# ignore everything except the font URI
uri = data['src']
- if not isinstance(data['src'], str):
+ fonts = []
+
+ if isinstance(data['src'], list):
for part in uri:
- if isinstance(part, str):
- uri = part
- break
+ if isinstance(part, str) or isinstance(part, unicode):
+ fonts.append(part)
+ else:
+ fonts.append(uri)
- src = self.c.getFile(uri, relative=self.c.cssParser.rootPath)
+ for font in fonts:
+ src = self.c.getFile(font, relative=self.c.cssParser.rootPath)
self.c.loadFont(
names,
src,
