Commit 7da77bb9 authored by Emanuele Aina's avatar Emanuele Aina

hotdoc-html-2-pdf: Set up fonts to better handle unicode data

It's 2019 and *TeX still lacks proper glyph fallback, so we get the following
errors on `make pdf`:

    ./hotdoc-html-2-pdf build/html/appdev-debugging.html build/pdf/appdev-debugging.pdf --remote-prefix "https://developer.apertis.org" --line-numbers
    [WARNING] Missing character: There is no ▸ in font [lmmono10-regular]:!
    [WARNING] Missing character: There is no ▸ in font [lmmono10-regular]:!
    ./hotdoc-html-2-pdf build/html/programming-guide-tooling.html build/pdf/programming-guide-tooling.pdf --remote-prefix "https://developer.apertis.org" --line-numbers
    [WARNING] Missing character: There is no 李 in font [lmmono10-regular]:!
    [WARNING] Missing character: There is no 健 in font [lmmono10-regular]:!
    [WARNING] Missing character: There is no 秋 in font [lmmono10-regular]:!
    ./hotdoc-html-2-pdf build/html/vm-config.html build/pdf/vm-config.pdf --remote-prefix "https://developer.apertis.org" --line-numbers
    [WARNING] Missing character: There is no ▸ in font [lmmono10-regular]:!
    ./hotdoc-html-2-pdf build/html/vm-management.html build/pdf/vm-management.pdf --remote-prefix "https://developer.apertis.org" --line-numbers
    [WARNING] Missing character: There is no ▸ in font [lmmono10-regular]:!
    [WARNING] Missing character: There is no ▸ in font [lmmono10-regular]:!
    ./hotdoc-html-2-pdf build/html/vm-setup.html build/pdf/vm-setup.pdf --remote-prefix "https://developer.apertis.org" --line-numbers
    [WARNING] Missing character: There is no ▸ in font [lmmono10-regular]:!
    [WARNING] Missing character: There is no ▸ in font [lmmono10-regular]:!

Address those by:
* setting up a CJK font so we don't erase team members
* setting up a monospace font which has large Unicode coverage without
  requiring fallbacks, so a `▸` in a code snippets doesn't end up in a
  unrendered character
Signed-off-by: Emanuele Aina's avatarEmanuele Aina <emanuele.aina@collabora.com>
parent 4fa5fab3
......@@ -147,6 +147,10 @@ def write(args, output):
cmd = ['/usr/bin/pandoc', tmp_path, '-V documentclass=article',
'--variable', 'links-as-notes=true',
'--pdf-engine=xelatex', '--toc', '-o', args.output,
# because it's 2019 and the TeX engines still have no glyph fallback
'--variable', 'CJKmainfont=Noto Serif CJK KR', # this one seems a fair bet
'--variable', 'monofont=FreeMono', # has a good Unicode coverage without requiring fallbacks
'--variable', 'monofontoptions=Scale=0.75', # make the very wide FreeMono font a bit smaller
'--include-in-header='+os.path.join(latex_dir, 'apertis_logo.latex')]
if args.line_numbers:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment