"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

Mark Jamsek <mark@jamsek.com>
Re: tog: don't embded utf8 glyphs in tog.c
Christian Weisgerber <naddy@mips.inka.de>
Mon, 26 Sep 2022 01:23:47 +1000

Download raw body.

On 22-09-24 03:17PM, Christian Weisgerber wrote:
> Mark Jamsek:
> > This fixes the problem stsp reported of making utf8 enabled editors
> > necessary to browse the code.
> > 
> > I also found prettier single guillemets to wrap the control chars.
> What are the chances of a font not containing those characters and
> presenting the user with some replacement box?

I'm not sure how to get a reliable measure on that, tbh, but will
investigate further. According to stsp, gnome and xfce support it out of
the box, I'll learn which other desktop environments also support it by
default. I can't recall if base xterm did. A cursory search produced
a couple lists of fonts that apparently support the glyph[0,1]. The
lists, however, are neither exhaustive nor authoritative; for example,
spleen also supports it, but spleen is not mentioned. If it were
a browser app, apparently 95% of users could view it[2].

> Why not simply use <...> everywhere?

This is what we do if the user has not set a UTF-8 locale.  We also do
this with borders, for example, and use one glyph if UTF-8 is enabled
and another if not. I think it's nice to have a couple minor
distinctions between the two supported locales. I also think it's
reasonable to expect that most users who have specified a UTF-8 locale
are aware that a capable UTF-8 font is required--particularly if
presented with replacement characters. But I'm happy to accept that I'm
wrong in this expectation.

That said, after I proposed documenting this, I had a bit of a search in
the FAQ and related man pages but didn't find any mention that a more
capable font might be needed if glyphs aren't rendered correctly when
running UTF-8. So maybe there're more unaware users than anticpated?

> Maybe it's time for a tog-x11 (GTK, Qt, whatever) so people can go
> all out on graphical design?

I don't want to go all out on graphical design so have no desire to
create another tog flavour. But if someone wanted to do that, I'd
support their effort as much as time permits.

[0]: https://www.fileformat.info/info/unicode/char/2039/fontsupport.htm
[1]: https://www.zuga.net/articles/unicode/character/2039
[2]: https://www.unicompat.com/2039

Mark Jamsek <fnc.bsdbox.org>
GPG: F2FF 13DE 6A06 C471 CA80  E6E2 2930 DC66 86EE CF68