Skip to content

Commit

Permalink
macOS: Fix a regression in the previous release that broke rendering …
Browse files Browse the repository at this point in the history
…of Emoji using the VS16 variation selector

The test for a font having cell text was incorrectly not ignoring
non-renderable chars due to a typo.

Fixes #8130
  • Loading branch information
kovidgoyal committed Dec 18, 2024
1 parent 2abc0be commit 9f3f598
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
2 changes: 2 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ Detailed list of changes
0.38.1 [future]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- macOS: Fix a regression in the previous release that broke rendering of Emoji using the VS16 variation selector (:iss:`8130`)

- themes kitten: When using the *Default* theme as an auto switch theme include all the actual settings values (:iss:`8124`)

0.38.0 [2024-12-15]
Expand Down
24 changes: 12 additions & 12 deletions kitty/fonts.c
Original file line number Diff line number Diff line change
Expand Up @@ -473,23 +473,23 @@ has_emoji_presentation(const GPUCell *gpu_cell, const ListOfChars *lc) {

bool
has_cell_text(bool(*has_codepoint)(const void*, char_type ch), const void* face, bool do_debug, const ListOfChars *lc) {
RAII_ListOfChars(llc);
if (!has_codepoint(face, lc->chars[0])) goto not_found;
unsigned num_cc = 0;
for (unsigned i = 1; i < lc->count; i++) {
if (!is_non_rendered_char(lc->chars[i])) lc->chars[i] = 0;
else num_cc++;
}
if (num_cc == 0) return true;
if (num_cc == 1) {
char_type cc = 0;
for (unsigned i = 1; i < lc->count && cc; i++) cc = lc->chars[i];
if (has_codepoint(face, cc)) return true;
if (!is_non_rendered_char(lc->chars[i])) {
ensure_space_for_chars(&llc, llc.count+1);
llc.chars[llc.count++] = lc->chars[i];
}
}
if (llc.count == 0) return true;
if (llc.count == 1) {
if (has_codepoint(face, llc.chars[0])) return true;
char_type ch = 0;
if (hb_unicode_compose(hb_unicode_funcs_get_default(), lc->chars[0], cc, &ch) && face_has_codepoint(face, ch)) return true;
if (hb_unicode_compose(hb_unicode_funcs_get_default(), lc->chars[0], llc.chars[0], &ch) && face_has_codepoint(face, ch)) return true;
goto not_found;
}
for (unsigned i = 1; i < lc->count; i++) {
if (lc->chars[i] && !has_codepoint(face, lc->chars[i])) goto not_found;
for (unsigned i = 0; i < llc.count; i++) {
if (!has_codepoint(face, llc.chars[i])) goto not_found;
}
return true;
not_found:
Expand Down

0 comments on commit 9f3f598

Please sign in to comment.