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.