Documentation ¶
Overview ¶
A collection of helper functions for examining certain font or glyph properties, irrelevant unless you are really deep into this mess.
This subpackage is *not* used in etxt itself.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CBoxBadness ¶
func CBoxBadness(segments sfnt.Segments) (fixed.Int26_6, fixed.Int26_6, fixed.Int26_6, fixed.Int26_6)
Computes how much the control box of the given segments exceeds the box defined by the "ON" contour points. Whenever there's an excess, that means that the control box doesn't match the bounding box of the glyph segments, which might have unintended effects in the rendering position of the glyph. Though you'd have to be crazy to care much about this, as the effect is almost always way smaller than typical hinting distortions. So, visually you are unlikely to see anything at all even if CBoxBadness are non-zero... but it has implications for technical correctness of computed left and right side bearings and stuff like that if you are obsessive enough.
Returned badnesses are left, right, top and bottom, and the values can only be zero or positive.
func RuneAscent ¶
Returns the ascent of the given rune both as units and as the ratio to the font's em square size. In general, capital latin latters will return ratios around 0.7, while lowercase letters like 'a', 'x', 'r' and similar will return ratios around 0.48. But anything is possible, really.
The buffer can be nil.
Types ¶
This section is empty.