mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-24 01:40:12 -05:00
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
This commit is contained in:
parent
d458d46f81
commit
4c954be7a6
5 changed files with 35 additions and 8 deletions
18
render.c
18
render.c
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue