[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: problem with emoji
From: |
Thomas Dickey |
Subject: |
Re: problem with emoji |
Date: |
Mon, 4 Feb 2019 21:11:32 -0500 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Tue, Feb 05, 2019 at 08:40:53AM +1100, Timothy Allen wrote:
> On Mon, 2019-02-04 at 17:12 +0100, folkert wrote:
> > It looks like printing UTF-8 emoji mangles the terminal when printed
> > from an ncurses application.
> > Situation is either putty on windows or gnome-terminal on linux,
> > problem
hmm - I don't even see that :-)
For a quick check, I tried this with my Debian 8 and xterm, and found that
wcwidth and the fonts don't agree (not that unusual).
To check the comment above, I ran my Debian testing machine,
and cat'd the file in both pterm and gnome-terminal.
Both programs died (probably fontconfig...).
With a couple of tries, xterm ran (see attached).
The newer system got some agreement on wcwidth versus the fonts.
fontconfig still needs some work.
ncurses "knows" about double-width characters if wcwidth says they are.
Some emojis aren't encoded in wcwidth (and some fonts don't agree with
wcwidth).
> > happens on both.
>
> Emoji are supposed to be rendered two character-cells wide. Looking at
> your screenshot, I notice that on the first line, two emojis have been
> replaced with single-cell boxes, and the alignment of that line is off
> by two. On the second line, one emoji has been replaced, and the
> alignment is off by one. The third line has four replacements and is
> off by four, etc.
>
> Given that ncurses knows nothing of fonts or replacement glyphs, it
> sounds like your terminals are predicting what the alignment *should*
> be, then asking the operating system to render the text and then
> blindly assuming the alignment was correct.
Actually the terminal's third in line for the decisions:
a) the system tells the application how wide the characters are
b) the application spaces/positions things
c) the terminal does something (perhaps unexpected)
--
Thomas E. Dickey <address@hidden>
https://invisible-island.net
ftp://ftp.invisible-island.net
untitled.png
Description: PNG image
signature.asc
Description: Digital signature