When I try to compile a file using XeLaTeX and fontspec that uses the Dejavu Sans font (that's of course not already installed in the MacOS system), by \usepackage{pifont}
, or if I want to use the font CMU Serif by \setsansfont{CMU Serif}
, fontspec cannot find the fonts (error Package fontspec Error: The font "CMU Serif" cannot be found.
).
I'm aware that one workaround is to add the directory that provides these fonts (/Library/TeX/Root/texmf-dist/fonts/opentype
) as a symlink inside ~/Library/Fonts
. However, doing so breaks some websites on Firefox (likely due to sandboxing and duplicate font issues), and Firefox is really that much more crucial than latex.
It's not possible that there is no other solution apart from either specifying the file path for each font or causing trouble on my entire MacOS system installation, to force fontspec
to find a custom directory with fonts... Can anyone please help resolve this?
Related issue describing in more detail the conundrum: Fontspec package can't find "Latin Modern Mono" on MacOS/MacTeX