Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: UNICODE Private Use Area characters in BUFFER



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