Expand description
Coordinate representation and rounding policy.
Scale holds the arithmetic that differs between target coordinate
types. Loading takes the same steps whichever one is in use.
Three are provided:
Scale26Dot6matches FreeType: 26.6 coordinates, 16.16 deltas, and rounding where FreeType rounds.ScaleF32matches HarfBuzz: floating point throughout, no rounding.Unscaledstays in font units, which is what an autohinter needs. It matchesScale26Dot6at no size, without the round trip through 26.6.
Structs§
- Fixed
Transform 🔒 - A component’s 2x2 transform in the 16.16 form FreeType uses.
- Offset
Rounding - The axes of a composite component’s offset that are rounded to the pixel grid.
- Scale26
Dot6 - Scales font units to 26.6 fixed point, reproducing FreeType’s arithmetic.
- Scale
F32 - Scales font units to floating point pixels, reproducing HarfBuzz’s arithmetic.
- Simple
Pass - Everything
Scale::load_simple_pointsneeds beyond the glyph itself. - Unscaled
- Leaves coordinates in font units.
Traits§
- Scale
- How coordinates are represented and rounded while loading an outline.
Functions§
- fold_
deltas_ 🔒into_ font_ units - Folds variation deltas into the font unit points, rounding them off the way FreeType does.
- hypot_
fixed 🔒 - Approximate magnitude of a transform basis vector.
- read_
points_ 🔒and_ phantom - Reads a simple glyph’s points into
destand appends the phantom points after them. - simple_
deltas 🔒 - Computes the deltas for a simple glyph of a varying font, and reports whether the caller should take its delta path.