Hi,
Using different fonts within LaTeX is one of the things I don't get to fully understand. Besides using packages to change the default fonts, I recently learned commands such as \fontfamily{ptm}\selectfont, but found those weird names "ptm" "pcr" and so. I guess all those names will be stored somewhere, along with the "real" names "Adobe Times" and "Adobe Courier".
How can I know what fonts are installed and usable by LaTeX?
Fonts & Character Sets ⇒ Knowing installed fonts
-
- Site Moderator
- Posts: 814
- Joined: Tue Jul 01, 2008 2:19 pm
Re: Knowing installed fonts
Usually for LaTeX (as opposed to plain TeX) you use a package to load a font, for example:
\usepackage{mathptmx} % Times
\usepackage{helvet} % Helvetica
In a lot of cases, these are actually free "clone" fonts, rather than the commercial originals. For example, neither of the above use the named fonts directly: they both use URW fonts which are free (GPL, I think).
Of course, if you use xelatex, you can load system fonts with the fontspec package. This is the way forward for working with fonts, in my opinion.
--
Joseph Wright
\usepackage{mathptmx} % Times
\usepackage{helvet} % Helvetica
In a lot of cases, these are actually free "clone" fonts, rather than the commercial originals. For example, neither of the above use the named fonts directly: they both use URW fonts which are free (GPL, I think).
Of course, if you use xelatex, you can load system fonts with the fontspec package. This is the way forward for working with fonts, in my opinion.
--
Joseph Wright
Joseph Wright
Knowing installed fonts
it might be useful to visitKeta wrote:Hi,
Using different fonts within LaTeX is one of the things I don't get to fully understand. Besides using packages to change the default fonts, I recently learned commands such as \fontfamily{ptm}\selectfont, but found those weird names "ptm" "pcr" and so. I guess all those names will be stored somewhere, along with the "real" names "Adobe Times" and "Adobe Courier".
How can I know what fonts are installed and usable by LaTeX?
http://www.tug.dk/FontCatalogue/
Re: Knowing installed fonts
The link is very helpful, thanks! It's a very good resource for using fonts in LaTeX.
Still, sometimes I feel the need to use other commands. Some packages provide commands to select a particular font, but others just change the default behavior of the roman or sans-serif families, and the only way I know to manually change the fonts at desire is the \selectfont command. I have lots of folders with fonts installed, but I don't know how to use them. The only families I managed to correctly use are the common PostScript fonts (Times, Courier, Chancery...). I think there must be a way to use the installed fonts, but I can't find how. I know the easy of xelatex in this respect, but I don't want to use it right now.

Still, sometimes I feel the need to use other commands. Some packages provide commands to select a particular font, but others just change the default behavior of the roman or sans-serif families, and the only way I know to manually change the fonts at desire is the \selectfont command. I have lots of folders with fonts installed, but I don't know how to use them. The only families I managed to correctly use are the common PostScript fonts (Times, Courier, Chancery...). I think there must be a way to use the installed fonts, but I can't find how. I know the easy of xelatex in this respect, but I don't want to use it right now.
Re: Knowing installed fonts
TeX can only use Type-1 fonts (*.pfa or *.pfb) and Metafont bitmap fonts (*.pg or *.pk), and it needs special font metric files (*.tfm). In addition to that, the LaTeX New Font Selection Scheme (NFSS) requires font definition files or equivalent declarations. TrueType and OpenType fonts don't work. This is the reason why xetex was created in the first place.
Knowing installed fonts
I have 2 .pfa, 16 .pk, 3955 .pfb and 15182 .tfm files installed in my TeX distribution; I only know how to use a minuscule part of them. For example, the Font Catalogue above lists Optima, and to use the font one needs the \selectfont and so commands. I tried, but I did not get Optima. If you look at the LaTeX source file, the section font is declared with \usefont{T1}{fvs}{m}{n} (there is no way to know which typeface fvs is, or is it?), which works fine (seems like I have the unknown font installed somewhere), but the Optima selection command \renewcommand{\sfdefault}{uop} doesn't work for me. Changing uop with kurier worked, however (pure luck). How can I know which are the names I can use? If TeX knows, I'd say there might be a way for me to know.phi wrote:TeX can only use Type-1 fonts (*.pfa or *.pfb) and Metafont bitmap fonts (*.pg or *.pk), and it needs special font metric files (*.tfm). In addition to that, the LaTeX New Font Selection Scheme (NFSS) requires font definition files or equivalent declarations. TrueType and OpenType fonts don't work. This is the reason why xetex was created in the first place.
Knowing installed fonts
When you request the font family F in encoding E, LaTeX loads a file EF.fd. This file contains commands that tell LaTeX how to load the corresponding font, as described in the fntguide documentation file. One of the items in the argument of the \DeclareFontShape command is a TeX font name which is eventually loaded using the \font primitive. TeX itself only knows about the metric files (*.tfm). The mapping between TeX font names and font data files is driver specific and usually defined in terms of mapping files (*.map), e.g. pdftex.map for pdfTeX. This mapping file contains a line for each font that describes how the driver should load the font. For pdfTeX, the actual format of the map file is described in the pdfTeX manual.
Re: Knowing installed fonts
Thanks for the explanation phi, it helped so much!
Now I understand it much better. Will have a look at the documents, I'll try to learn more about fonts, thanks! 


