module shaping::shaperssource
The script shapers HarfBuzz chooses between (hb-ot-shaper.hh): what
each asks of normalization and positioning; the complex ones
(pkg::alloy::text_scripts) add steps of shaping through a
ComplexShaper their plan keeps, the default shaper's done here.
ShaperNormalizationZeroMarksComplexShapergpos_tagnormalizationzero_width_marksfallback_positioncomposedecomposereorder_markspreprocess_textsetup_maskspostprocess_glyphsrun_pauseunicode_compositioncanonical_decomposition
type Shapersource
exp type Shaper = enum
Variants
DefaultArabicHebrewIndicKhmerMyanmarUseThaiHangul
Functions
type Normalizationsource
exp type Normalization = enum
How normalization composes and decomposes for a shaper.
Variants
NothingDecomposedComposedDiacriticsnever composing a base with a base
ComposedDiacriticsNoShortCircuitdecomposing fully, then composing back
Auto
type ZeroMarkssource
exp type ZeroMarks = enum
When marks lose their advances: before GPOS, after it, or never.
Variants
NothingEarlyLate
interface ComplexShapersource
exp interface ComplexShaper
A complex script's shaper (pkg::alloy::text_scripts), made for a plan: which it is, the features and pauses it adds, what it learns of the face, and the steps of shaping it takes.
Required functions
fn kind(self: &) -> Shaper;fn collect_features(self: &, b: &var Builder) -> bool;adds the shaper's features and pauses: whether it has any
fn override_features(self: &, b: &var Builder);changes the features after the common ones are added
fn prepare(self: &var, plan: &Plan, face: &Face);keeps what the plan's lookups and the face tell it
fn compose(self: &, plan: &Plan, a: u32, b: u32) -> Option<u32>;fn decompose(self: &, ab: u32) -> Option<[u32 : 2]>;fn reorder_marks(self: &, buffer: &var Buffer, start: u64, end: u64);reorders the marks from start to end, after their canonical sort
fn preprocess_text(self: &, plan: &Plan, face: &Face, buffer: &var Buffer);what it does to the characters before they are normalized
fn setup_masks(self: &, plan: &Plan, face: &Face, buffer: &var Buffer);sets the masks of its features on the characters
fn postprocess_glyphs(self: &, face: &Face, buffer: &var Buffer);what it does to the glyphs once positioned
fn run_pause(self: &, pause: Pause, plan: &Plan, face: &Face, buffer: &var Buffer);runs its pause between two stages of lookups
fn gpos_tagsource
exp fn gpos_tag(self s: &Shaper) -> u32
The script tag GPOS must have been read for to apply, 0 for any.
fn normalizationsource
exp fn normalization(self s: &Shaper) -> Normalization
fn zero_width_markssource
exp fn zero_width_marks(self s: &Shaper) -> ZeroMarks
fn fallback_positionsource
exp fn fallback_position(self s: &Shaper) -> bool
Whether marks are placed without GPOS and kern applied by it.
fn composesource
exp fn compose(plan: &Plan, a: u32, b: u32) -> Option<u32>
The character two compose into for the plan's shaper, if any.
fn decomposesource
exp fn decompose(plan: &Plan, ab: u32) -> Option<[u32 : 2]>
The characters one decomposes into for the plan's shaper, the second 0 for a singleton, if any.
fn reorder_markssource
exp fn reorder_marks(plan: &Plan, buffer: &var Buffer, start: u64, end: u64)
Reorders the marks from start to end, after their canonical sort.
fn preprocess_textsource
exp fn preprocess_text(plan: &Plan, face: &Face, buffer: &var Buffer)
fn setup_maskssource
exp fn setup_masks(plan: &Plan, face: &Face, buffer: &var Buffer)
fn postprocess_glyphssource
exp fn postprocess_glyphs(plan: &Plan, face: &Face, buffer: &var Buffer)
fn run_pausesource
exp fn run_pause(pause: Pause, plan: &Plan, face: &Face, buffer: &var Buffer)
Runs the pause between two stages of lookups.
fn unicode_compositionsource
exp fn unicode_composition(a: u32, b: u32) -> Option<u32>
The character two canonically compose into, Hangul syllables too.
fn canonical_decompositionsource
exp fn canonical_decomposition(c: u32) -> Option<[u32 : 2]>
The character's canonical decomposition, Hangul syllables' by arithmetic, the second part 0 for a singleton.