Skip to main content

Module outline

Module outline 

Source
Expand description

Building outlines from glyf data.

There are two entry points:

  • Outline owns its buffers and grows them as needed. A caller supplies a glyph and a size.
  • OutlinePlan allocates nothing. It walks the composite tree, reports how much space the result needs through buffer_lengths, and loads into buffers the caller supplies. Use it to control where the memory comes from, or to supply a Hinter.

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§

BufferLengths
How long each scratch buffer an outline needs has to be.
Buffers
Scratch space for OutlinePlan::load.
GlyphZone
The points a Hinter works on, zone 1 in the specification’s terms.
Outline
An outline and the buffers that hold it.
OutlinePlan
What an outline is made of, and how much scratch space building it needs.
OutlineRef
A loaded outline that borrows the caller’s buffers.
OutlineTables
An OutlineContext that reads the tables from a font.
Scale26Dot6
Scales font units to 26.6 fixed point, reproducing FreeType’s arithmetic.
ScaleF32
Scales font units to floating point pixels, reproducing HarfBuzz’s arithmetic.
Unscaled
Leaves coordinates in font units.

Enums§

PathContourStart
Where a contour starts when its first point is off-curve.

Traits§

Hinter
Receives each instructed glyph from OutlinePlan::load.
OutlineContext
Everything OutlinePlan::load needs 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_point can read them out of.
outline_to_path
Converts an outline given as points, flags and contour end points into path commands, and calls sink for each.