Skip to main content

Module varc

Module varc 

Source
Expand description

Outlines from variable composites in VARC.

A variable composite glyph is a tree of components. Each component is a transformed glyph drawn at its own location in the font’s variation space, and may itself be a composite. The leaves are glyphs from the font’s base outline source, glyf or CFF. They are drawn by the OutlineGlyphs that produced the composite.

The working memory a VarcGlyph needs depends on its nesting depth and its largest leaf. The tree is walked to measure them the first time the size is needed, and the result is kept. Drawing splits that memory into typed slices, as the glyf loader does, so a composite needs no memory beyond that buffer.

StructsΒ§

DrawContext πŸ”’
Data shared by every glyph in one draw.
GlyphStack πŸ”’
The composites being walked, outermost first, used to detect cycles.
Layout πŸ”’
The size of a composite’s working memory and how it is split.
Leaves πŸ”’
Draws the leaves of a composite from the base source.
Level πŸ”’
The runs for one level, with the remaining runs for the levels below it.
Levels πŸ”’
The unused runs of coordinates and scalars.
Measured πŸ”’
What measuring a composite’s tree found, kept in atomics so an outline stays cheap to clone and safe to share.
Memory πŸ”’
The working memory for one draw, split by a Layout.
Outline πŸ”’
A glyph in the VARC table, with its working memory size computed. A composite glyph, ready to draw.
Outlines πŸ”’
Provides access to the variable composite glyphs in a font.
ScalarCache πŸ”’
The scalar for each region at one location, computed on first use.
Scratch πŸ”’
Slices that each level uses in turn, and the number of edges left to walk.
VarcGlyph
A variable composite glyph from a Font.
Walk πŸ”’
The state of a sizing walk.

ConstantsΒ§

TRANSFORM_FIELD_COUNT πŸ”’
The maximum number of fields that one transform can vary.

TraitsΒ§

VarcContext πŸ”’
Provides the data that Outlines::draw needs from outside the table.

FunctionsΒ§

apply_transform_variations πŸ”’
axis_values πŸ”’
Writes the axis values of component to out, one per axis index.
compute_tuple_deltas πŸ”’
Sums the deltas at coords for the tuple identified by var_idx into out.
eval_condition πŸ”’
expand_coords πŸ”’
Copies coords into out, which holds one value per axis.
linear_scale πŸ”’
Returns the factor that scales font units to ppem.
scale_matrix πŸ”’
split πŸ”’
Splits len elements off the front of slice, or None if it is too short.