servo/components/fonts/platform
Martin Robinson 78e2691d3f
shaping: Don't assume there's a space glyph when rendering tabs (#32979)
Previously if a font didn't have a space advance and it was needed to
make advances for tabs, Servo would try to read the advance from the
font. If the font didn't have a space glyph, Servo would panic. This
fixes that issue by making the space advance part of the `FontMetrics`
of a font (like Gecko) and falling back properly if that glyph doesn't
exist. The rendered glyph is still the "space" glyph, but we make
sure to select a font that supports that glyph explicitly.

This prevents a crash, but tabs still aren't handled properly. In
reality, tab stops should be calculated in layout and the size of
the space character of the current font shouldn't come into play.
The addition of the space advance metric will make this easier.

Fixes #32970.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-08-23 11:17:44 +00:00
..
freetype shaping: Don't assume there's a space glyph when rendering tabs (#32979) 2024-08-23 11:17:44 +00:00
macos shaping: Don't assume there's a space glyph when rendering tabs (#32979) 2024-08-23 11:17:44 +00:00
windows shaping: Don't assume there's a space glyph when rendering tabs (#32979) 2024-08-23 11:17:44 +00:00
mod.rs ohos: Detect installed fonts (#32731) 2024-07-22 14:03:26 +00:00