# Tweaking numeral height (and baseline)

I am using the Computer Modern Unicode Bright font, in the OpenType version (see http://cm-unicode.sourceforge.net or http://www.ctan.org/tex-archive/fonts/cm-unicode) in a XeLaTeX-compiled document. I am loading the font by means of the fontspec package.

I am generally pleased with the results, except for one thing, there seems to be a slight unevenness in the height of the numerals:

(Heigher resolution image: http://brussense.be/temp/CMBrightNumbers.png)

Notice that the 4, 5 and 7 do not reach the same height as the other numerals. Also, the 1, 2, 4 and 7 are floating slightly above the baseline. Especially the lower height of the 5's and 7's is noticeble in my document, or at least it is in the pdf on my screen (without much zooming in), I have yet to test if it is really visible when printed.

So my question is, can the height of specific glyphs/numerals be slightly stretched somehow? And is there some way to "pull down" certain glyphs towards the baseline? Preferably with some fontspec or XeTeX magic and without editing the actual font. Or should I just ignore this and move on with my thesis? :-)

-
I don't see any of them are taller or shorter. Measure the absolute height of a glyph is meaningless. Two person with exactly the same height never looks the same tall. – Yan Zhou Oct 22 '11 at 9:55
If you look at the blue lines it should be clear that there is a difference right? Otherwise take a look at the hi-res image. – Matthias Oct 22 '11 at 10:00
This is by design, curved parts overshot from the straight ones, I believe you will see this in most (if not all) fonts. – Khaled Hosny Oct 22 '11 at 15:17
This is called overshoot and is necessary to create an optically well-proportioned typeface. – Jon Purdy Oct 23 '11 at 1:20

This is likely by design. Humans read text, not machines, thus we should talk about perceived glyph height, not the geometrical distance between the lowest and the highest points.

Sure, the glyphs appear uneven when you add the rules and examine them closely. But what if you take the rules away and read the digits at normal font size? You will find that your impressions are quite different.

It looks like the font designer wanted to "soften" the upper and lower arcs in the glyphs: whenever the symbol's upper/lower border is flat or straight, it appears closer to the glyph center than in the arc case. This could be justified with that if you want to approximate the arc with a horizontal line (which would be the at the capitals' height here), then the line will appear lower than the arc's highest point.

Latin Modern Sans Serif and Computer Modern Sans Serif also have the property you describe, although the latter's variant is less exagerrated.

-

Just to add to egreg's and Andrey's answers, you can see where the baseline and bounding box limits are, using the package layouts.

\documentclass{article}
\usepackage{graphicx}
\usepackage{layouts}
\begin{document}
\begin{figure}
\scalebox{8}{\drawfontframe{0123456789}}
\end{figure}
\end{document}


The reason font designers do this is to correct for perception errors. If they don't you will "see" lines curving a bit.

-

The lines you draw are incorrect; the horizontal bar of the 2 actually sits on the baseline, while the lower arc of the 5 slightly overshoots it. It's quite common in font making; indeed it's true the contrary: were the arcs touching the baseline, the digits would appear uneven. The same happens with all well designed fonts.

Let's see some examples:

-