How do I calculate the space in between two glyphs in a TTF font? -
this graph definition of few terms horizontal glyph metrics fonts.
let's have sentence,
foo bar baz.
how spacing size, in pixels, between words "foo" , "bar"? suppose sum,
- the whitespace right-padding in grapheme 'o' in "foo": subtract
advance
bearingx
+width
- the
advance
of space character. - the whitespace left-padding of letter 'b' in "bar":
bearingx
.
is correct? table has bearingx?
how spacing size, in pixels, between words "foo" , "bar"?
you need know horizontal advance of space character , kerning between "o" , " ", , between " " , b". don't think need bearingx spacing. result in font "units", defined unitsperem of head tag. convert result * font size / unitsperem, , spacing in "points". need known, how many pixels there in 1 point: depends on application, monitor dpi or postscript's 72 dpi.
what table has bearingx?
bearingx in in hmtx, under "lsb" (left-side bearing) of longhormetric (and leftsidebearing, obviously).
Comments
Post a Comment