# How and where are LaTeX fonts stored? How can I inspect them?

Another follow-up to this question. I need to find out the x-height and the line width of the arrow stem in various math fonts. I know how I can inspect otf. and ttf. fonts with FontForge and how to find out the mentioned dimensions in em.

But I would also like to handle fonts typically included via LaTeX packages: eulervm, newtxmath, newpxmath, mathpazo, .... As far as I know these are stored in different file types. For example, eulervm should be a »virtual font« (whatever that is) if I am not mistaken.

What kind of software do I need to inspect (or maybe even edit) the glyphs of the above mentioned fonts? How can I specifically find out the dimensions for the \rightarrow to resolve my tikz-cd issue with these fonts?

• As you need the dimensions of the real glyph you must inpect the "real" font. The fonts you mentioned are type1-fonts so look for .pfb-files. The log-file of a pdflatex compilation shows at the end the fonts included. – Ulrike Fischer Mar 26 '18 at 16:36
• @UlrikeFischer Thank you. The hint about the log was already very helpful. – John Dorian Mar 26 '18 at 16:54
• You can also open a *.pfb file in FontForge. Without accompanying metrics, the character-to-character spacings may be wrong. But for the information you seek (x-height and stem width), all that is needed is in the *.pfb. PostScript outlines (whether .pfb or *.otf) are supposed to be measured at 1000 units per em. TrueType outlines (.ttf and some *.otf) are supposed to be measured at 1024, 2048, or similar units per em. – user139954 Apr 25 '18 at 19:35
• In TeXLive, they are usually located around /usr/local/texlive/2018basic/texmf-dist/fonts/ (the name of the 2018basic directory will change based on what texlive installation you have). Also, this might help. – Andreas Storvik Strauman Jun 24 '18 at 22:57

A virtual font is a set of instructions which basically refer to characters in other, non-virtual fonts. Virtual fonts permit you to make a single font by combining characters from one or more non-virtual fonts, without duplicating the characters from the non-virtual fonts.

Virtual fonts have the extension .vf when compiled. This format is the format TeX uses but is not human-readable. Virtual fonts have the extension .vpl when in human-readable form. It is possible to convert from VPL to VF and from VF to VPL. However, human-readable information is typically lost when converting from VPL to VF, so that converting VF back to VPL produces a less easily read file than the original. Comments and meaningful designations get stripped.

This is why working from a log file which list the PFBs is probably the easiest way to locate the font containing the characters of interest, at least when you are interested in a single character.

The best way to do it is probably to create a file which contains only the character of interest. That way, you reduce the number of PFBs used and reduce the risk of identifying the wrong instance of that character. Obviously, you need to ensure that the document uses the same font size and font configuration as your real document. But make the content minimal.

\documentclass[border=10pt]{standalone}
\usepackage{mathdesign}
\begin{document}
$\rightarrow$
\end{document}


shows that cmsy10.pfb is the font of interest.

I could open the PFB in FontForge, as suggested in comments, but it may be less hassle to just read the corresponding AFM, fonts/afm/public/amsfonts/cm/cmsy10.afm which includes

C 33 ; WX 1000 ; N arrowright ; B 55 -11 943 511 ;


as well as the basic data for the font as a whole, in case you need that

StartFontMetrics 2.0
Comment Creation Date: Mon Jul 13 16:17:00 2009
FontName CMSY10
FullName CMSY10
FamilyName Computer Modern
Weight Medium
Notice (Copyright (c) 1997, 2009 American Mathematical Society (<http://www.ams.org>), with Reserved Font Name CMSY10.)
ItalicAngle -14.04
IsFixedPitch false
UnderlinePosition -100
UnderlineThickness 50
Version 003.002
EncodingScheme FontSpecific
FontBBox -29 -960 1116 775


Because fonts are relatively easy to install and use, my personal approach has been to look at the font catalogue to find the desired font http://www.tug.dk/FontCatalogue/.

Then just install and use. A reasonable but not exhaustive guide for font usage is https://en.wikibooks.org/wiki/LaTeX/Fonts.

One caution, only use multiple fonts in a single document when their presence improves the clarity of what is being communicated. Else, it will begin to look like a preschool letter cut and paste project.

Addon: At http://fontforge.github.io/en-US/documentation/ there is the link to FontForge. I have never used this program, but from the introduction:

This book has been produced to help make the process of type design available to anyone. Type design is visually complex as well as highly technical — however it is easier to begin making type now than ever, partly because of the availability of free tools like FontForge. While being a handy tool with which to begin, FontForge is not just for beginners. It has an advanced toolset and is rapidly improving at the time this book is being written.

This book aims to offer technical help and general insight into planning a type design project, and also offers advice about how to make your workflow more efficient.

The documention claims you can input a font, change characters or edit them. And then save to a new font name.

CAUTION: Only edit a font whose copyright permits this activity. Font designers are often very zealous to protect their artistic work (Building a new font is not a quick and easy process)

• This is not even an indirect answer to the question. – Ulrike Fischer Mar 26 '18 at 16:55