Back to API Reference
Class
Shaper
static
Text shaper that converts codepoints to positioned glyphs through a runtime font face. SFNT-backed fonts use HarfBuzz for full OpenType shaping; platform-native faces supply equivalent glyph and positioning results through their backend.
public static uint GetGlyphIndex(UniTextFont.Core font, uint codepoint)Gets the glyph index for a codepoint in the specified font.
public static bool TryGetGlyphInfo(UniTextFont.Core font, uint codepoint, float fontSize, out uint glyphIndex, out float advance, float normalizationScale = 1f)Gets glyph index and advance width for a codepoint.
public static float ComputeShapeParams(UniTextFontProvider fontProvider, int fontId, out int spacingOffsetUnits, out float fakeBoldAdvancePx)Computes per-font shaping parameters in a single font lookup: the spacingOffsetUnits baseline (from UniTextFont.SpacingOffset) and per-glyph fakeBoldAdvancePx bonus (from UniTextFont.FakeBoldWeight) alongside the returned design-unit-to-pixel scale (incorporates UniTextFont.FontScale). Callers cache all three per run-fontId change.
