Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check for precomposed characters before switching to a fallback font #2365

Closed
tertium opened this issue Feb 15, 2020 · 3 comments
Closed

check for precomposed characters before switching to a fallback font #2365

tertium opened this issue Feb 15, 2020 · 3 comments

Comments

@tertium
Copy link

tertium commented Feb 15, 2020

Currently, when Kitty processes composed characters, it requires the base codepoint as well as every combination character to have dedicated glyphs in the font (see has_cell_text()), otherwise it switches to a fallback font. This is undesirable when a font has a precomposed glyph for the combination but not the individual combination chars. For instance, Roboto Mono is rather bad in this regard.

Given that HarfBuzz will try to normalize the combination anyway, we can just look for a precomposed character in the current font before giving up. Possible implementation.

@tertium
Copy link
Author

tertium commented Feb 15, 2020

That was lightning quick, thank you!

@tertium
Copy link
Author

tertium commented Feb 17, 2020

The second argument of hb_unicode_compose() in line 487 in fonts.c should be cell->ch instead of ch, otherwise the test does not work. Sorry, didn't notice it at first.

@kovidgoyal
Copy link
Owner

right, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants