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:
parent
a574081012
commit
e8b19e08fa
@ -86,6 +86,9 @@ Detailed list of changes
|
|||||||
- Fix showing debug information not working if kitty's :file:`STDIN` is not a tty
|
- Fix showing debug information not working if kitty's :file:`STDIN` is not a tty
|
||||||
(:iss:`4424`)
|
(:iss:`4424`)
|
||||||
|
|
||||||
|
- Linux: Fix a regression that broke rendering of emoji with variation selectors
|
||||||
|
(:iss:`4444`)
|
||||||
|
|
||||||
|
|
||||||
0.24.0 [2022-01-04]
|
0.24.0 [2022-01-04]
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|||||||
@ -388,7 +388,7 @@ def gen_ucd() -> None:
|
|||||||
category_test(
|
category_test(
|
||||||
'is_non_rendered_char', p, 'Cc Cs Cf'.split(),
|
'is_non_rendered_char', p, 'Cc Cs Cf'.split(),
|
||||||
'Other_Default_Ignorable_Code_Point and soft hyphen',
|
'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'
|
ascii_range='false'
|
||||||
)
|
)
|
||||||
category_test('is_word_char', p, {c for c in class_maps if c[0] in 'LN'}, 'L and N categories')
|
category_test('is_word_char', p, {c for c in class_maps if c[0] in 'LN'}, 'L and N categories')
|
||||||
|
|||||||
@ -387,7 +387,8 @@ has_cell_text(Font *self, CPUCell *cell) {
|
|||||||
char_type combining_chars[arraysz(cell->cc_idx)];
|
char_type combining_chars[arraysz(cell->cc_idx)];
|
||||||
unsigned num_cc = 0;
|
unsigned num_cc = 0;
|
||||||
for (unsigned i = 0; i < arraysz(cell->cc_idx) && cell->cc_idx[i]; i++) {
|
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 == 0) return true;
|
||||||
if (num_cc == 1) {
|
if (num_cc == 1) {
|
||||||
|
|||||||
4
kitty/unicode-data.c
generated
4
kitty/unicode-data.c
generated
@ -699,7 +699,7 @@ is_ignored_char(char_type code) {
|
|||||||
|
|
||||||
bool
|
bool
|
||||||
is_non_rendered_char(char_type code) {
|
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;
|
if (LIKELY(0x20 <= code && code <= 0x7e)) return false;
|
||||||
switch(code) {
|
switch(code) {
|
||||||
case 0x0 ... 0x1f:
|
case 0x0 ... 0x1f:
|
||||||
@ -738,6 +738,8 @@ is_non_rendered_char(char_type code) {
|
|||||||
return true;
|
return true;
|
||||||
case 0xd800 ... 0xdfff:
|
case 0xd800 ... 0xdfff:
|
||||||
return true;
|
return true;
|
||||||
|
case 0xfe00 ... 0xfe0f:
|
||||||
|
return true;
|
||||||
case 0xfeff:
|
case 0xfeff:
|
||||||
return true;
|
return true;
|
||||||
case 0xffa0:
|
case 0xffa0:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user