4

I use different computers with different fonts installed. My favourite font is Frutiger, so whenever it is present at the machine I'm working on, this one should be used. Currently, I'm setting the following switch manually:

\usepackage{ifthen}
\newboolean{frutigerAvailable}
\setboolean{frutigerAvailable}{false}

\ifthenelse{\boolean{frutigerAvailable}}{
    % Frutiger available
    \setsansfont[]{Frutiger Neue LT W1G}
    \setmainfont[
    BoldFont={Frutiger Neue LT W1G Bold}, 
    ItalicFont={Frutiger Neue LT W1G Light Italic},
    BoldItalicFont={Frutiger Neue LT W1G Bold Italic}]{Frutiger Neue LT W1G Light}
    \newfontfamily\headfootfont[]{Frutiger Neue LT W1G Light}
    \newfontfamily\titlefont[]{Frutiger Neue LT W1G Medium}
    \newfontfamily\titledescriptionfont[]{Frutiger Neue LT W1G Light}
} { 
    % Frutiger not available, use different font
    \setsansfont[]{...}
    \setmainfont[
    BoldFont={...}, 
    ItalicFont={...},
    BoldItalicFont={...}]{...}
    \newfontfamily\headfootfont[]{...}
    \newfontfamily\titlefont[]{...}
    \newfontfamily\titledescriptionfont[]{...}
}

Is there a programmatic way to determine whether a font is present or not on a certain system with LuaTeX?

  • there is an answer on site to do this, I'll see if I can find.... – David Carlisle Dec 14 '15 at 09:45
  • 1
    I just came across your solution over there: http://tex.stackexchange.com/questions/250336/how-can-you-check-if-fontspec-with-lualatex-can-load-a-font and now I hope there's a simpler way. – user3105453 Dec 14 '15 at 09:52
  • 1
    Oh yes that's the one, well found:-) Will had it on has radar to look at adding something along those lines to fontspec but I don't think there is anything out of the box yet. But in any case I think this is a duplicate question so we should close, and any updated information should go in the old one? – David Carlisle Dec 14 '15 at 10:04
  • somewhere I thought there was a version using \suppressfontnotfounderror – David Carlisle Dec 14 '15 at 10:11
  • Oh boy that's cluttered. But anway, thank you very much for pointing me in the right direction :-) – user3105453 Dec 14 '15 at 10:13

0 Answers0