Expand description
Building outlines from glyf data.
There are two entry points:
Outlineowns its buffers and grows them as needed. A caller supplies a glyph and a size.OutlinePlanallocates nothing. It walks the composite tree, reports how much space the result needs throughbuffer_lengths, andloads into buffers the caller supplies. Use it to control where the memory comes from, or to supply aHinter.
Both read through an OutlineContext, which states the tables and the
variation location. OutlineTables implements it by reading a font.
A load produces an OutlineRef, which borrows the caller’s buffers.
Modules§
- borrowed 🔒
- A loaded outline that borrows the caller’s buffers.
- buffers 🔒
- Scratch space for loading an outline, and how much to supply.
- context 🔒
- Where outline loading gets its data.
- hinter 🔒
- The hook for a TrueType interpreter.
- load 🔒
- The outline loading pass.
- owned 🔒
- An outline that owns the buffers it is loaded into.
- path 🔒
- Turning a loaded outline into path commands.
- plan 🔒
- The survey that sizes an outline before it is built.
- scale 🔒
- Coordinate representation and rounding policy.
Structs§
- Buffer
Lengths - How long each scratch buffer an outline needs has to be.
- Buffers
- Scratch space for
OutlinePlan::load. - Glyph
Zone - The points a
Hinterworks on, zone 1 in the specification’s terms. - Outline
- An outline and the buffers that hold it.
- Outline
Plan - What an outline is made of, and how much scratch space building it needs.
- Outline
Ref - A loaded outline that borrows the caller’s buffers.
- Outline
Tables - An
OutlineContextthat reads the tables from a font. - 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.
- Unscaled
- Leaves coordinates in font units.
Enums§
- Path
Contour Start - Where a contour starts when its first point is off-curve.
Traits§
- Hinter
- Receives each instructed glyph from
OutlinePlan::load. - Outline
Context - Everything
OutlinePlan::loadneeds from a font: glyphs, variation data, and the metrics behind the phantom points. - Scale
- How coordinates are represented and rounded while loading an outline.
Functions§
- contour_
to_ path - Converts one contour into path commands, taking its points from a slice of
anything
to_pointcan read them out of. - outline_
to_ path - Converts an outline given as points, flags and contour end points into
path commands, and calls
sinkfor each.