add support for ttf fonts

workspace
Brendan Howell 5 years ago
parent 508ef56899
commit f0c1835d82

@ -357,6 +357,7 @@ class Bureau(object):
fontconfig = FontConfiguration() fontconfig = FontConfiguration()
fontsdir = os.path.join(self.mdir, "fonts") fontsdir = os.path.join(self.mdir, "fonts")
for font in glob.glob(fontsdir + ".otf"): for font in glob.glob(fontsdir + ".otf"):
self.log.debug("adding font " + "file://" + font)
fontconfig.add_font_face("file://" + font, fontconfig.add_font_face("file://" + font,
weasyprint.default_url_fetcher) weasyprint.default_url_fetcher)
for font in glob.glob(fontsdir + ".ttf"): for font in glob.glob(fontsdir + ".ttf"):

Loading…
Cancel
Save