diff --git a/screenless/bureau/bureau.py b/screenless/bureau/bureau.py index d9d96c9..7324bb8 100644 --- a/screenless/bureau/bureau.py +++ b/screenless/bureau/bureau.py @@ -15,6 +15,7 @@ import threading import lmdb import PIL import weasyprint +from weasyprint.fonts import FontConfiguration import zmq from escpos import printer from mako.template import Template @@ -322,7 +323,8 @@ class Bureau(object): # TODO: make paper size a config variable pdfpath = tempfile.mkstemp(".pdf")[1] self.log.debug("rendering to: " + pdfpath) - weasyprint.HTML(string=templ.render_unicode(**kwargs)).write_pdf(pdfpath) + fontconfig = FontConfiguration() + 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) # TODO: make this asynchronous diff --git a/screenless/bureau/publications/fonts/Fold.otf b/screenless/bureau/publications/fonts/Fold.otf new file mode 100644 index 0000000..f601657 Binary files /dev/null and b/screenless/bureau/publications/fonts/Fold.otf differ