Created
November 5, 2016 03:06
-
-
Save MatthewJA/6c6e30720e2325363f8f9180d9a2972f to your computer and use it in GitHub Desktop.
Hack to get cross-platform fallback fonts with XeLaTeX.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\suppressfontnotfounderror1 | |
\def\myfont{Palatino} % Or whatever your primary font choice is. | |
\def\myfallback{Palatino Linotype} % Or whatever your fallback font is. | |
\count255=\interactionmode | |
\batchmode | |
\font\foo="\myfont"\space at 10pt | |
\ifx\foo\nullfont | |
\font\foo = "\myfallback"\space at 10pt | |
\ifx\foo\nullfont | |
\errorstopmode | |
\errmessage{no suitable font found} | |
\else | |
\let\myfont=\myfallback | |
\fi | |
\fi | |
\interactionmode=\count255 | |
\setmainfont[Ligatures=TeX]{\myfont} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment