Fix non-renderable combining chars causing some text to not be rendered on Linux

The test for non-renderable chars was broken and the variation selectors
were not included in the test. Fixes #4444
This commit is contained in:
Kovid Goyal 2022-01-05 22:33:53 +05:30
parent a574081012
commit e8b19e08fa
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
4 changed files with 9 additions and 3 deletions

View File

@ -86,6 +86,9 @@ Detailed list of changes
- Fix showing debug information not working if kitty's :file:`STDIN` is not a tty
(:iss:`4424`)
- Linux: Fix a regression that broke rendering of emoji with variation selectors
(:iss:`4444`)
0.24.0 [2022-01-04]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -388,7 +388,7 @@ def gen_ucd() -> None:
category_test(
'is_non_rendered_char', p, 'Cc Cs Cf'.split(),
'Other_Default_Ignorable_Code_Point and soft hyphen',
extra_chars=property_maps['Other_Default_Ignorable_Code_Point'],
extra_chars=property_maps['Other_Default_Ignorable_Code_Point'] | set(range(0xfe00, 0xfe0f + 1)),
ascii_range='false'
)
category_test('is_word_char', p, {c for c in class_maps if c[0] in 'LN'}, 'L and N categories')

View File

@ -387,7 +387,8 @@ has_cell_text(Font *self, CPUCell *cell) {
char_type combining_chars[arraysz(cell->cc_idx)];
unsigned num_cc = 0;
for (unsigned i = 0; i < arraysz(cell->cc_idx) && cell->cc_idx[i]; i++) {
if (!is_non_rendered_char(cell->cc_idx[i])) combining_chars[num_cc++] = codepoint_for_mark(cell->cc_idx[i]);
const char_type ccp = codepoint_for_mark(cell->cc_idx[i]);
if (!is_non_rendered_char(ccp)) combining_chars[num_cc++] = ccp;
}
if (num_cc == 0) return true;
if (num_cc == 1) {

4
kitty/unicode-data.c generated
View File

@ -699,7 +699,7 @@ is_ignored_char(char_type code) {
bool
is_non_rendered_char(char_type code) {
// Other_Default_Ignorable_Code_Point and soft hyphen (6052 codepoints) {{{
// Other_Default_Ignorable_Code_Point and soft hyphen (6068 codepoints) {{{
if (LIKELY(0x20 <= code && code <= 0x7e)) return false;
switch(code) {
case 0x0 ... 0x1f:
@ -738,6 +738,8 @@ is_non_rendered_char(char_type code) {
return true;
case 0xd800 ... 0xdfff:
return true;
case 0xfe00 ... 0xfe0f:
return true;
case 0xfeff:
return true;
case 0xffa0: