I write a TeX-document on two PCs, the files are transferred via USB-Stick. The document should be printed with a specific font. For legal reaons the font is only available on one PC.
When I translate the document in the PC without the font, I get a fontspec error: "font-not-found". (same error in another question)
The finished document shows no characters.
Is there a mechanism to detect this problem and switch to another font?
Actually I change my font selection each time I change the computer. But I want to avoid to use two versions of my style. I would like to have one style for each computer.
A MWE:
\documentclass{article}
\usepackage{fontspec}
%This throws an error - I want to catch it and use another font
\setmainfont{My Font on other PC}
%If error:
%\setmainfont{Arial}
\begin{document}
Test
\end{document}
My wish: This document will be translated without an error with lualatex on a windows PC. If the font My Font on other PC is installed, it is used. If it is not installed, the alternative should be used.
setdefaultfont.texmust be defined on each new PC and if I get the font on my 2nd PC, I have to adapt setdefaultfont.tex. Let's see, if another solution will come up. – knut Mar 28 '13 at 20:31\InputIfFileExists{setdefaultfont}{}{\setmainfont{Arial}}then you only need the file on machines which are not going to use arial – David Carlisle Mar 28 '13 at 20:33