mirror-ghostty/pkg/freetype
Mitchell Hashimoto 1cd0fb5dab
fix(font): Improve FreeType glyph measurements and add unit tests for face metrics (#8738)
Follow-up to #8720 adding

* Two improvements to FreeType glyph measurements:
- Ensuring that glyphs are measured with the same hinting as they are
rendered, ref
[#8720#issuecomment-3305408157](https://github.com/ghostty-org/ghostty/pull/8720#issuecomment-3305408157);
- For outline glyphs, using the outline bbox instead of the built-in
metrics, like `renderGlyph()`.
* Basic unit tests for face metrics and their estimators, using the
narrowest and widest fonts from the resource directory, Cozette Vector
and Geist Mono.

---

I also made one unrelated change to `freetype.zig`, replacing
`@alignCast(@ptrCast(...))` with `@ptrCast(@alignCast(...))` on line
173. Autoformatting has been making this change on every save for weeks,
and reverting the hunk before each commit is getting old, so I hope it's
OK that I use this PR to upstream this decree from the formatter.
2025-09-29 12:50:49 -07:00
..
Library.zig pkg/freetype: remove usingns 2024-08-16 15:34:46 -07:00
build.zig build-system: Replace deprecated usages of root_source_file on addTests (#8031) 2025-07-22 15:28:11 -07:00
build.zig.zon build: mark most dependencies as lazy 2025-03-14 13:32:19 -07:00
c.zig pkg/freetype: remove usingns 2024-08-16 15:34:46 -07:00
computations.zig pkg/freetype: remove usingns 2024-08-16 15:34:46 -07:00
errors.zig pkg/freetype: remove usingns 2024-08-16 15:34:46 -07:00
face.zig font/freetype: disable SVG glyphs, simplify color check 2025-03-19 12:43:18 -06:00
freetype-zig.h font: add constraint logic to rasterizers 2025-07-04 15:47:28 -06:00
main.zig fix(font): Improve FreeType glyph measurements and add unit tests for face metrics (#8738) 2025-09-29 12:50:49 -07:00
tag.zig font/freetype: API to load font table 2024-05-28 09:48:01 -07:00
test.zig Remove FiraCode leftovers 2023-12-06 13:36:05 -03:00