Back to API Reference
Class

ScriptPositionModifier

Applies superscript or subscript formatting to text ranges.

Remarks

Two-tier approach: Native: activates OpenType 'sups'/'subs' feature via HarfBuzz (proper glyphs). Synthesis: scales down and shifts vertically using OS/2 metrics (fallback). Attribute sbyte encoding: 0 = unchanged, +1 = native super, -1 = native sub, +2 = synth super, -2 = synth sub. Create two styles to support both tags: Style 1: ScriptPositionModifier + TagRule("sup") with defaultParameter = "super" Style 2: ScriptPositionModifier + TagRule("sub") with defaultParameter = "sub"
protected override void OnEnable()
protected override void OnDisable()
protected override void OnDestroy()
protected override void OnApply()