diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2021-05-31 15:10:05 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2021-06-01 15:51:09 +0000 |
| commit | 4c954be7a6d86b21da512fc533eb3362ac737221 (patch) | |
| tree | ee27fc9e3705fe75355a5d08c6450a552b5efeca /render.c | |
| parent | Merge branch 'selection-recognizes-hard-linebreaks' (diff) | |
config: add boolean option tweak.pua-double-width
When enabled, PUA (Private Usage Area) codepoints are always treated
as double-width glyphs, regardless of the actual glyph width.
Requires allow-overflowing-double-width-glyphs=yes
Diffstat (limited to 'render.c')
| -rw-r--r-- | render.c | 18 |
1 files changed, 11 insertions, 7 deletions
@@ -499,9 +499,9 @@ render_cell(struct terminal *term, pixman_image_t *pix, const struct fcft_glyph *glyph = NULL; const struct composed *composed = NULL; - if (cell->wc != 0) { - wchar_t base = cell->wc; + wchar_t base = cell->wc; + if (base != 0) { if (base >= CELL_COMB_CHARS_LO && base < (CELL_COMB_CHARS_LO + term->composed_count)) { @@ -576,11 +576,15 @@ render_cell(struct terminal *term, pixman_image_t *pix, * - *this* cells is followed by an empty cell, or a space */ if (term->conf->tweak.allow_overflowing_double_width_glyphs && - glyph != NULL && - glyph->cols == 1 && - glyph->width >= term->cell_width * 15 / 10 && - glyph->width < 3 * term->cell_width && - col < term->cols - 1 && + ((glyph != NULL && + glyph->cols == 1 && + glyph->width >= term->cell_width * 15 / 10 && + glyph->width < 3 * term->cell_width && + col < term->cols - 1) || + (term->conf->tweak.pua_double_width && + ((base >= 0x00e000 && base <= 0x00f8ff) || + (base >= 0x0f0000 && base <= 0x0ffffd) || + (base >= 0x100000 && base <= 0x10fffd)))) && (row->cells[col + 1].wc == 0 || row->cells[col + 1].wc == L' ')) { cell_cols = 2; |
