mirror of
https://github.com/emilk/egui.git
synced 2026-06-28 07:23:13 -04:00
Replace the character-by-character glyph lookup in `layout_section()` with a proper text shaping pipeline using harfrust (a Rust port of HarfBuzz). This enables GPOS kerning, ligatures (fi, fl), and correct positioning of combining diacritical marks. The shaping pipeline works as follows: 1. Split text into font-fallback runs (grapheme-cluster-aware) 2. Shape each run with harfrust (GSUB + GPOS) 3. Allocate and position glyphs from the shaping output Key changes: - Add harfrust, unicode-segmentation, unicode-general-category deps - Cache ShaperData on FontFace (parsed GSUB/GPOS tables) - Add shape_text() with buffer flags and variable font support - Add allocate_glyph_by_id() for shaper-produced glyph IDs - Recycle harfrust UnicodeBuffer across layout calls - Handle NOTDEF fallback (combining marks via unicode-general-category) Addresses #2517.