In my answer to “Which measurement units should one use in LaTeX?” I explore the values of 1em
and 1ex
for different fonts using both TFM fonts and the font mechanisms of XeLaTeX that uses non-TFM fonts.
My, highly empirical, conclusions in that post are:
- For TFM fonts:
- The value of
1em
is not equal to the ‘selected size’ of the font, nor is it the width of an actual “M”. - The value of
1ex
is not tied to the size of an actual “x”. However, for all the ‘Computer Modern’ text fonts and most styles of the ‘Latin Modern’ text fonts,1ex
=\ht
of\hbox{x}
- The value of
- For non-TFM fonts (in XeLaTeX):
- The value of
1em
is exactly the ‘selected font size’. - The value of
1ex
is exactly the height of an “x”. (\ht
of\hbox{x}
)
- The value of
Now to my question. Am I correct to assume that:
- For TFM fonts:
- The values of
1em
and1ex
are separate, “independent”, values in the font definition file, and those are read into LaTeX when the font is loaded.
- The values of
- For non-TFM fonts (in XeLaTeX):
- The value of
1em
is always set to the ‘selected font size’, and the value of1ex
is always set to the height of an “x”. (\ht
of\hbox{x}
) - or; is it possible to have
1em
≠ ‘selected font size’ and/or1ex
≠\ht
of\hbox{x}
?
- The value of
Edit to better specify what answer I am looking for:
The answer provided by tohecz deals with the design reasons for having 1em
and 1ex
not exactly tied to the extents of letters “M“ and “x”. What I am looking for is an answer more on the lines of where TeX loads these values from.
The answer provided by David Carlisle corroborates my first assertion (that for TFM fonts values are loaded from the font definition file, and are independent on the extents of the letters “M” and “x”).
What’s left is whether, for Xe(La)TeX, fonts loaded from non-TFM files, the values are always taken from the selected size and extents of letter “x”.
I find this interesting since the values of 1em
and 1ex
differ between whether you load Latin Modern fonts from TFM files (via e.g. \usepackage{lmodern}
) or via new font methods (via e.g. \fontspec{LMSans10}
)
[I realize that \usepackage{lmodern}
is probably most consistent, but still...]
\usepackage{lmodern}
you're not using the OpenType version, but the standard TFM fonts.lc-list
reports file names likelmss10.pbf
), so they are not OpenType either.