Expand description
The engine’s public text contract: shaping inputs, shaped glyphs, outline commands and the primitives they carry.
Plain Rust + serde. The JSON shape (field names, enum strings, refused
unknown fields, optional script/language) is the one KiCad Monkey’s
ShapingRecord/OutlineVector schemas publish, so records written against
those schemas decode into these types unchanged.
Structs§
- Finite
Float - Finite float64 value, including fractional CFF/CFF2 design coordinates.
- Finite
Float Error - Font
Variation Coordinate - One ordered OpenType variation coordinate.
- Open
Type Tag - Four-byte OpenType variation, feature or script tag (
^[ -~]{4}$). - Outline
Close {"kind": "close"}.- Outline
Curve To {"kind": "curve_to", "control1_x", "control1_y", "control2_x", "control2_y", "x", "y"}.- Outline
Line To {"kind": "line_to", "x", "y"}.- Outline
Move To {"kind": "move_to", "x", "y"}.- Outline
Quad To {"kind": "quad_to", "control_x", "control_y", "x", "y"}.- Safe
Integer - Integer exactly representable as an IEEE-754 double (|value| <= 2^53 - 1), so it crosses JSON and JavaScript/WASM boundaries unchanged.
- Safe
Integer Error - Sha256
Hex - Lowercase SHA-256 digest of one out-of-band font buffer (
^[0-9a-f]{64}$). - Shaped
Glyph - One shaped glyph in logical buffer order.
- Shaping
Buffer Properties - Explicit HarfBuzz buffer state; no ambient library defaults are implied.
- Shaping
Feature - HarfBuzz-compatible feature range over half-open UTF-8 byte offsets.
Non-global endpoints are UTF-8 code-point boundaries. A global range is
start=0 and end=4294967295. HarfRust receives these values unchanged after
UnicodeBuffer::push_strassignschar_indicesclusters. - Shaping
Input - Complete deterministic shaping input for one run of text in one font.
- Stable
Text Id - Nonempty stable ASCII identifier for fonts and cases
(
^[A-Za-z0-9][A-Za-z0-9._:-]*$). - Stable
Text IdError - Validation
Error - Stable semantic validation failure: a code, a JSON path and a message.
Enums§
- Default
Ignorable Policy - HarfBuzz default-ignorable handling.
- Outline
Command - One glyph outline command in font design units.
- Shaping
Cluster Level - HarfBuzz cluster level.
- Text
Direction - Shaping direction.
Functions§
- validate_
font_ sha256 - Validate a font digest: 64 lowercase hexadecimal characters.
- validate_
font_ variations - Validate variation coordinates: printable four-byte axis tags, each once.
- validate_
shaping_ input - Validate one shaping input before a shaper consumes caller-supplied font
bytes: UTF-8 byte-offset indexing, the font digest, variation axes, the
script tag, a nonempty language and half-open code-point feature ranges.
Paths are relative to the input (
$is the input itself).