I found several answers regarding windows, but nothing on Linux. I'm using Ubuntu and for right now, I simply want to use the fonts already installed on my computer for my PDF getting generated from a Tex document.
I found: Using multiple system fonts which shows me the TeX, but how do I get from the Ubuntu font to the font family?
Let's say that I want to use FreeOs font Sans Serif for my test.
Later I will want to install my own font and use that.
Best Answer
You can use
otfinfo
to get the proper name of fonts installed on your system.For example,
provides the following information:
The full name,
FreeSans
, can then be used to set the document font:Of course, this particular choice would obviously be a poor one since you should not set the body of your document in sans-serif. (Unless you are producing slides or something like that.) But it works for purposes of demonstration:
You need to use either LuaLaTeX or XeLaTeX. The output above was compiled with LuaLaTeX which works much better for me than XeLaTeX.
I'm using TeX on GNU/Linux, so perhaps it is worth a word of warning about XeTeX.
If you try XeLaTeX, do not leave your computer during compilation just in case - XeLaTeX tends to hang and, at least for me, spins up the CPU in ways which quickly spiral out of control. While your OS should kill the process before your computer overheats, I personally prefer not to depend on this. Make sure that you know how to kill the process and have a terminal ready. If you are compiling from the command line, have a second terminal open as you cannot use the usual control characters to interrupt the process.