[Tex/LaTex] How and where are LaTeX fonts stored? How to inspect them

fontspackages

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?

Best Answer

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