diff options
Diffstat (limited to 'src/core.c')
| -rw-r--r-- | src/core.c | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -16,13 +16,13 @@ static uint16_t cluster_presentation(const uint32_t *cps, int len) { if (len <= 1) return 0; - bool pictographic = unicode_extended_pictographic(cps[0]); + bool pictographic = term_unicode_extended_pictographic(cps[0]); if (len == 2) { uint32_t c1 = cps[1]; if (c1 == 0xFE0F) return CELL_EMOJI; if (c1 == 0xFE0E) return CELL_TEXT; - if (c1 == 0x20E3 || grapheme_regional_indicator(c1) || - (pictographic && (c1 == 0x200D || grapheme_emoji_modifier(c1) || + if (c1 == 0x20E3 || term_grapheme_regional_indicator(c1) || + (pictographic && (c1 == 0x200D || term_grapheme_emoji_modifier(c1) || (c1 >= 0xE0020 && c1 <= 0xE007F)))) return CELL_EMOJI; return 0; @@ -33,8 +33,8 @@ static uint16_t cluster_presentation(const uint32_t *cps, int len) return CELL_EMOJI; if (cps[i] == 0xFE0E) return CELL_TEXT; - if (cps[i] == 0x20E3 || grapheme_regional_indicator(cps[i]) || - (pictographic && (cps[i] == 0x200D || grapheme_emoji_modifier(cps[i]) || + if (cps[i] == 0x20E3 || term_grapheme_regional_indicator(cps[i]) || + (pictographic && (cps[i] == 0x200D || term_grapheme_emoji_modifier(cps[i]) || (cps[i] >= 0xE0020 && cps[i] <= 0xE007F)))) emoji = true; } @@ -44,9 +44,9 @@ static uint16_t cluster_presentation(const uint32_t *cps, int len) void term_sc_print_glyph(struct term *t, uint32_t cp, int width, uint16_t flags) { uint32_t base = cp; - if (TERM_EXPECT(grapheme_is_handle(cp), 0)) { - uint32_t cps[GRAPHEME_MAX_LEN]; - int len = term_gstore_expand(t->gstore, cp, cps, GRAPHEME_MAX_LEN); + if (TERM_EXPECT(term_grapheme_is_handle(cp), 0)) { + uint32_t cps[TERM_GRAPHEME_MAX_LEN]; + int len = term_gstore_expand(t->gstore, cp, cps, TERM_GRAPHEME_MAX_LEN); base = cps[0]; flags = (flags & ~(CELL_EMOJI | CELL_TEXT)) | cluster_presentation(cps, len); } @@ -179,13 +179,13 @@ bool term_sc_extend_cluster(struct term *t, uint32_t cp, int klass) return false; struct cell *prev = last_written_cell(t); - uint32_t cps[GRAPHEME_MAX_LEN]; - int len = prev && prev->c > ' ' ? term_gstore_expand(t->gstore, prev->c, cps, GRAPHEME_MAX_LEN) : 0; + uint32_t cps[TERM_GRAPHEME_MAX_LEN]; + int len = prev && prev->c > ' ' ? term_gstore_expand(t->gstore, prev->c, cps, TERM_GRAPHEME_MAX_LEN) : 0; if (!len) return joins_cluster(cp, klass); if (!cluster_joins(cps, len, cp, klass)) return false; - if (len >= GRAPHEME_MAX_LEN) + if (len >= TERM_GRAPHEME_MAX_LEN) return true; cps[len++] = cp; @@ -517,7 +517,7 @@ static inline bool next_byte_wraps(const char *buf, size_t len, size_t pos, uint { if (pos >= len) return false; uint32_t cp; - if (!utf8_decode_one(buf + pos, len - pos, &cp)) return false; + if (!term_utf8_decode_one(buf + pos, len - pos, &cp)) return false; int w = term_text_class(cp); return w > 0 && !can_extend_cluster(last, cp, w); } |
