summaryrefslogtreecommitdiff
path: root/docs/conf.py
diff options
context:
space:
mode:
authorAndrew Neitsch <andrew@neitsch.ca>2021-10-30 15:50:12 -0600
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-11-04 08:06:03 +0100
commit95a4db3fbd946dd56f46f4c8c22be3b28083d845 (patch)
treec8ecd144d7f2cb81591f57271d49d63eaac2d799 /docs/conf.py
parenta934d377af2f90329485917fead8723f45d7a56e (diff)
Refs #33247 -- Fixed rendering of Unicode chars and emojis in PDF docs build.
Diffstat (limited to 'docs/conf.py')
-rw-r--r--docs/conf.py34
1 files changed, 28 insertions, 6 deletions
diff --git a/docs/conf.py b/docs/conf.py
index f74fbad3a9..96c78672ca 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -272,13 +272,35 @@ rst_epilog = """
# -- Options for LaTeX output --------------------------------------------------
+# Use lualatex for Unicode support.
+latex_engine = 'lualatex'
+# Set fonts and fallbacks for CJK and Emojis.
latex_elements = {
- 'preamble': (
- '\\DeclareUnicodeCharacter{2264}{\\ensuremath{\\le}}'
- '\\DeclareUnicodeCharacter{2265}{\\ensuremath{\\ge}}'
- '\\DeclareUnicodeCharacter{2665}{[unicode-heart]}'
- '\\DeclareUnicodeCharacter{2713}{[unicode-checkmark]}'
- ),
+ 'preamble': r"""
+ \directlua{
+ luaotfload.add_fallback("seriffallbacks", {
+ "Noto Serif CJK SC:style=Regular;",
+ "Symbola:Style=Regular;"
+ })
+ }
+ \setmainfont{FreeSerif}[RawFeature={fallback=seriffallbacks}]
+
+ \directlua{
+ luaotfload.add_fallback("sansfallbacks", {
+ "Noto Sans CJK SC:style=Regular;",
+ "Symbola:Style=Regular;"
+ })
+ }
+ \setsansfont{FreeSans}[RawFeature={fallback=sansfallbacks}]
+
+ \directlua{
+ luaotfload.add_fallback("monofallbacks", {
+ "Noto Sans Mono CJK SC:style=Regular;",
+ "Symbola:Style=Regular;"
+ })
+ }
+ \setmonofont{FreeMono}[RawFeature={fallback=monofallbacks}]
+ """,
}
# Grouping the document tree into LaTeX files. List of tuples