macOS: Fix rendering of the unicode hyphen (U+2010) character when using a font that does not include a glyph for it

The problem was caused by CoreText falling back to the glyph for the
ASCII hyphen U+00AD when the font does not contain a glyph for U+2010.
However, HarfBuzz does not do this automatic fallback (see
https://github.com/harfbuzz/harfbuzz/issues/517). This leads to the
character not being rendered.

To fix this we specialize HarfBuzz glyph lookup for this character
to follow CoreText. HarfBuzz should really do this automatically when
the hb_font is based on a CTFontRef, but I dont have the time/energy to
argue with its maintainers. Note that HarfBuzz already does this
automatic fallback for U+2011.

Hopefully, there aren't many more such special cases in CoreText.

Fixes #7525
This commit is contained in:
Kovid Goyal
2024-06-29 14:22:04 +05:30
parent ab296b1551
commit 78d1275601
2 changed files with 46 additions and 4 deletions

View File

@@ -80,6 +80,8 @@ Detailed list of changes
- Speed up ``kitty --version`` and ``kitty --single-instance`` (for all subsequent instances). They are now the fastest of all terminal emulators with similar functionality.
- macOS: Fix rendering of the unicode hyphen (U+2010) character when using a font that does not include a glyph for it (:iss:`7525`)
0.35.2 [2024-06-22]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~