Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: UNICODE Private Use Area characters in BUFFER
- X-seq: zsh-workers 50817
- From: Roman Perepelitsa <roman.perepelitsa@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Cc: Mikael Magnusson <mikachu@xxxxxxxxx>, Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: UNICODE Private Use Area characters in BUFFER
- Date: Sun, 23 Oct 2022 21:26:51 +0200
- Archived-at: <https://zsh.org/workers/50817>
- In-reply-to: <CAH+w=7YKCV7yftsod+e5J761x_ZyVp9m2CYPcUnK5X8Q9ZO=zw@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAN=4vMowyKmrQtQb=QTxiVzQJXRubz-o2T12=6aQBHSpkKwOig@mail.gmail.com> <CAHYJk3SWfX7ZaFA=WgDBtSPZD0isV5OUHWgf3ienhzhzK+9xQw@mail.gmail.com> <CAN=4vMoLQBt8ST7E3EachnLra05ENPOiY0nDOC0Z_=a=8Mg4SA@mail.gmail.com> <CAH+w=7a-8TtMcXvrmq6RLHbU-maHdD1Zf2ck_h_kzK61bmEr_A@mail.gmail.com> <CAN=4vMohKT=CAx5XoSAHrDvx4J--58535h-ZgCn3dkSqvZKDZg@mail.gmail.com> <CAH+w=7YKCV7yftsod+e5J761x_ZyVp9m2CYPcUnK5X8Q9ZO=zw@mail.gmail.com>
On Sun, Oct 23, 2022 at 8:54 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> On Sun, Oct 23, 2022 at 10:29 AM Roman Perepelitsa
> <roman.perepelitsa@xxxxxxxxx> wrote:
> >
> > You are right, iswprint(0xE0B0) returns 0.
>
> Interestingly, ${(V)...} et al. don't consult iswprint(), they just
> call wcs_nicechar_sel() which only consults WCWIDTH().
As far as I can tell, WCWIDTH() always gives the right answer when
building with --enable-unicode9. It's only WC_ISPRINT() that sometimes
gives an incorrect (in my opinion) answer.
> Some characters like $'\u21A9' report and occupy a width of 1, but
> part of the character overlaps the cell to the right when displayed.
This is a property of your font and not of the character. Glyphs don't
have to be confined within their bearings. In monospace fonts they
usually are but even this rule is often broken. The font I'm using
(and the one I recommend to powerlevel10k users) has glyphs that
overlap left, right, top and bottom neighbours.
Roman.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author