TransWikia.com

How to use non-default Google Font (Damion) in a LaTeX document?

TeX - LaTeX Asked on November 12, 2021

Is there any way of using a Google font that is not provided in LaTeX by default? More specifically, I would like to use the Damion font for a special word in my LaTeX document:

https://fonts.google.com/specimen/Damion#standard-styles

I have downloaded the .ttf file for the font, and I am wondering how I can use it for my LaTeX document.

Thank you for your help in advance,

One Answer

If you copy the font to the appropriate directory, you should be able to load it with setmainfont or newfontfamily. The preferred way to load it is by its filename, but you can also load it by family name.

On Windows, you need to install it for all users, not just for your user account, or LuaTeX/XeTeX will not be able to find it. On Mac, I believe you need to install it as a System font as well. The Linux version, however, does search user directories such as ~/.fonts/.

You can also save it under the fonts/truetype/ subdirectory of your local TeX tree. With TeX Live, you can look this up with kpsewhich -var-value=TEXMFLOCAL. (Or TEXMFHOME if you aren’t the sysadmin.) With MikTeX, you would create a new directory yourself and set the TEXINPUTS environment variable.

Finally, if you only need it for one project, you can put it in the project folder. You can also put your fonts in a subdirectory and tell fontspec where to find them with the Path= key. This should be a relative, not absolute, path if you want your document to compile on any other computer, including your next one.

Answered by Davislor on November 12, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP