FreeType has font metrics for the underline position, but I can't seem to find any metrics for the strikethrough position. How do text engines usually compute this value? Should I just put it at 1/3*ascent or whatever looks good? I suppose that for Latin at least this should be 1/2*height of "m" but I'm looking for a more general solution.
Asked
Active
Viewed 293 times
1 Answers
0
This information is not provided for all the various font formats supported by Freetype; so it is not exposed on the "main" interface.
In the (common but not universal) case of TrueType or OpenType fonts it can be retrieved in the TT_OS2 table, fields yStrikeoutSize
and yStrikeoutPosition
; you should be prepared for the table to be lacking, or yStrikeoutSize
to be null or negative thus unusable.
I do not remember of an equivalent for plain Postscript fonts (.pfb
/.pfa
, even in .afm
.)
The various bitmap formats might have the information available; an example is strike_out
in Windows FNT; notice this is the position, while the size defaults to be the same as underlining. Basically every format is alone here.

AntoineL
- 888
- 4
- 25