I'm writing some typography software which allows users to specify lengths in various dimensions.
If the user asks for a length of "1ex", is it reasonable to determine this length from the sxHeight entry in the OS/2 table? Should I be literally measuring the point height of an "x" in the font instance? Or something else?
Similarly for "1em" - I'm just using the point size of the font instance but should I be doing something more clever?
And "1en" - half an em?
0
Comments
For ex, I'd be inclined to use the sxHeight entry in the OS/2 table, on the basis that if it isn't actually equal to the lowercase x height, there might be some good reason for that, e.g. the font doesn't contain a Latin lowercase!
Shouldn’t these characters be a function of the font, not the layout app?
HarfBuzz: Well, you can extend the OS/2 support (that you wrote initially ) to read later version of the table and provide x-height.
I’d say go for sxHeight (you don’t need to account for hinting) falling back to half em, and call it a day.