-
Notifications
You must be signed in to change notification settings - Fork 563
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Description
Need: Measure text with font fallback support AND get precise glyph bounds (not font metrics).
Current limitations:
·Font.measureText(): Precise bounds ✅ but no font fallback ❌
·Paragraph.getRectsForRange(): Font fallback ✅ but uses fixed font metrics ❌
// "Hello" (no descenders) vs "Typography" (has y, p, g descenders)
Font.measureText("Hello"): height ≈ 17 (tight to glyphs)
Font.measureText("Typography"): height ≈ 24 (includes descenders)
Paragraph.getRectsForRange("Hello"): height ≈ 24 (reserves descender space)
Paragraph.getRectsForRange("Typography"): height ≈ 24 (same as "Hello")
Use case: Single-line multilingual text measurement (e.g., "Hello你好") for UI layouts where precision matters. Need automatic font fallback from English to Chinese fonts, but also need bounds that adapt to actual glyphs, not fixed font metrics.
Thanks! 🙏
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request