Files
oak-gpui/crates
Cole MillerandBennet Bo Fenner f1db1f3a3c windows: Fix ascent/descent calculations (#40103)
This applies the same fix as #39886 for Windows.

Previously we were using `GetLineMetrics` to determine the ascent and
descent values for each line. It seems like this has the same behavior
as `GetTypographicBounds` on macOS, which is to return the minimum
ascent and descent for the current state of the `TextLayout` object.
This causes the ascent/descent to be unstable when adding or removing an
emoji because a font fallback is triggered when an emoji is present on
the line.

The issue is fixed by switching to `font.GetMetrics` to get the ascent
and descent, which should always return stable values for the main font,
instead of changing when there's a fallback. This also should support
situations where we have multiple explicit fonts on the same line,
although that probably can't be triggered in Zed right now.

Release Notes:

- windows: Fixed a vertical shift in text layout when inserting or
removing an emoji.

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
2025-10-13 09:49:07 -04:00
..
2025-10-10 15:14:37 +00:00
2025-09-25 14:42:32 -07:00
2025-09-18 16:47:23 +00:00
2025-09-18 16:47:23 +00:00
2025-09-18 16:47:23 +00:00
2025-09-26 11:41:26 -04:00