add local fonts all at once

workspace
Brendan Howell 5 years ago
parent 93b8b92683
commit 633ae39ec9

@ -365,9 +365,9 @@ class Bureau(object):
for font in glob.glob(fontsdir + "/*.ttf"):
fontlist.append(("local", "file://" + font))
self.log.debug("adding font " + str(fdict))
fdict["src"] = fontlist
fdict = { "src": fontlist }
fontconfig.add_font_face(fdict,
weasyprint.default_url_fetcher)
weasyprint.default_url_fetcher)
weasyprint.HTML(string=templ.render_unicode(**kwargs)).write_pdf(pdfpath, font_config=fontconfig)
subprocess.call("lpr -o sides=two-sided-long-edge -o InputSlot=Upper " + pdfpath, shell=True)

Loading…
Cancel
Save