mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-28 03:01:57 +02:00
Exclude variation selectors when finding fallback font
This commit is contained in:
23
kitty/line.c
23
kitty/line.c
@@ -183,6 +183,16 @@ cell_as_unicode(CPUCell *cell, bool include_cc, Py_UCS4 *buf, char_type zero_cha
|
||||
return n;
|
||||
}
|
||||
|
||||
size_t
|
||||
cell_as_unicode_for_fallback(CPUCell *cell, Py_UCS4 *buf) {
|
||||
size_t n = 1;
|
||||
buf[0] = cell->ch ? cell->ch : ' ';
|
||||
for (unsigned i = 0; i < arraysz(cell->cc_idx) && cell->cc_idx[i]; i++) {
|
||||
if (cell->cc_idx[i] != VS15 && cell->cc_idx[i] != VS16) buf[n++] = codepoint_for_mark(cell->cc_idx[i]);
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
size_t
|
||||
cell_as_utf8(CPUCell *cell, bool include_cc, char *buf, char_type zero_char) {
|
||||
size_t n = encode_utf8(cell->ch ? cell->ch : zero_char, buf);
|
||||
@@ -193,6 +203,19 @@ cell_as_utf8(CPUCell *cell, bool include_cc, char *buf, char_type zero_char) {
|
||||
return n;
|
||||
}
|
||||
|
||||
size_t
|
||||
cell_as_utf8_for_fallback(CPUCell *cell, char *buf) {
|
||||
size_t n = encode_utf8(cell->ch ? cell->ch : ' ', buf);
|
||||
for (unsigned i = 0; i < arraysz(cell->cc_idx) && cell->cc_idx[i]; i++) {
|
||||
if (cell->cc_idx[i] != VS15 && cell->cc_idx[i] != VS16) {
|
||||
n += encode_utf8(codepoint_for_mark(cell->cc_idx[i]), buf + n);
|
||||
}
|
||||
}
|
||||
buf[n] = 0;
|
||||
return n;
|
||||
}
|
||||
|
||||
|
||||
|
||||
PyObject*
|
||||
unicode_in_range(Line *self, index_type start, index_type limit, bool include_cc, char leading_char) {
|
||||
|
||||
Reference in New Issue
Block a user