Discussion:
Thunderbird, ligatures, and "fixed-width" fonts
(too old to reply)
George Mitchell
2024-01-14 15:36:51 UTC
Permalink
I read mail with Thunderbird and for my fixed-width font I used Noto
Mono. Since by design Noto has glyphs for all Unicode characters,
that means it contains glyphs for ligatures (those character pairs
beloved of typographers that condense certain combinations such as
"fi" and "ffl" into single glyphs. At some level between the text of
the mail I'm reading or composing, which does not use those Unicode
ligature code points, and the pixels that appear on my screen, my
fixed-width text is no longer rendered with fixed width glyphs.

Google found me this harfbuzz issue:

https://github.com/harfbuzz/harfbuzz/issues/4414

However, a search in the source of the current versions of pango,
harfbuzz, and thunderbird does not find any occurrence of "no_liga",
the option mention in the above issue. So I'm at a loss as to how
to debug this. My desired outcome, of course, is for the characters
in my plain text emails to be rendered on the screen in fixed width.
Any suggestions? -- George

P.S. I have a new unexpired PGP key:
-----BEGIN PGP PUBLIC KEY BLOCK-----

mDMEZaHDbxYJKwYBBAHaRw8BAQdA2W6oBfS8haXY0/Ft4zS1OTLYfC8EBIADPTgM
Qdh85C20IEdlb3JnZSBNaXRjaGVsbCA8Z2VvcmdlQG01cC5jb20+iJkEExYKAEEW
IQQ6b7/Z+PlMzCwCfBGaHA937rZnfQUCZaHDbwIbAwUJBaOagAULCQgHAgIiAgYV
CgkICwIEFgIDAQIeBwIXgAAKCRCaHA937rZnfW6fAQD31pIkuRusHtAaYOBEGgQD
0E/i3jCFwNZnvZaoSkUfegD9FKJlKdGVybnLQyeuh+Usfv+lpAGrxGnbCKT139mE
xwm0KEdlb3JnZSBNaXRjaGVsbCA8Z2VvcmdlK2ZyZWVic2RAbTVwLmNvbT6ImQQT
FgoAQRYhBDpvv9n4+UzMLAJ8EZocD3futmd9BQJlocSiAhsDBQkFo5qABQsJCAcC
AiICBhUKCQgLAgQWAgMBAh4HAheAAAoJEJocD3futmd9SxwBAJUi6DNdVhWCZBTv
5XGy1g0JgApLWe/3S0M0zz9sn7/LAQCcJcV5k5s2rt9J5C1AUm6XVsuneVvIWXO5
j1GKWk0NC7g4BGWhw28SCisGAQQBl1UBBQEBB0AaFz/6B95RRvjOdLZr5fSdhuIH
vwr24H3ePDZSw6wlUwMBCAeIfgQYFgoAJhYhBDpvv9n4+UzMLAJ8EZocD3futmd9
BQJlocNvAhsMBQkFo5qAAAoJEJocD3futmd9RXsBANwRD9RE56F6/jeZOrujHICL
cgPiOt50Y6866v9OUTjUAP9GlC1aopfBpNwuPLJBam7oBaGqvY98VDhzOjoT7DNb
CQ==
=7L5N
-----END PGP PUBLIC KEY BLOCK-----
George Mitchell
2024-01-15 17:57:31 UTC
Permalink
Post by George Mitchell
I read mail with Thunderbird and for my fixed-width font I used Noto
Mono.  Since by design Noto has glyphs for all Unicode characters,
that means it contains glyphs for ligatures (those character pairs
beloved of typographers that condense certain combinations such as
"fi" and "ffl" into single glyphs.  At some level between the text of
the mail I'm reading or composing, which does not use those Unicode
ligature code points, and the pixels that appear on my screen, my
fixed-width text is no longer rendered with fixed width glyphs.
[...]
With help from Bertrand Petit and Stephen Hurd, I found out that this
is a feature of the font system itself, or at least fontconfig. The
fix is to create a new file, ~/.config/fontconfig/fonts.conf, and put
the contents of:
https://bugs.freebsd.org/bugzilla/attachment.cgi?id=247050
in it.

To my mind, the idea that the font system itself would do this sort of
manipulation to the text it's rendering is a severe violation of the
Principle of Least Astonishment. Who thought this would be a good idea?
-- George
Miroslav Lachman
2024-01-16 10:46:54 UTC
Permalink
On 16/01/2024 08:45, Bertrand Petit wrote:

[..]
Post by Bertrand Petit
I don't know where my version comes from. Perhaps it was crafted from
XFCE settings GUI?
You way want to make your file read-only in order to prevent any
desktop environment from overwriting your settings.
You can also place the whole document George mentioned in a separate
file in the ~/.config/fontconfig/ directory. For reference, look in
/usr/local/etc/fonts/ how this is done system-wide.
Can this be placed as a separate file into /usr/local/etc/fonts/conf.d/?
This way it will not be overwritten by upgrade or another app.

Kind regards
Miroslav Lachman



--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Bertrand Petit
2024-01-16 11:19:19 UTC
Permalink
Post by Miroslav Lachman
Can this be placed as a separate file into /usr/local/etc/fonts/conf.d/?
This way it will not be overwritten by upgrade or another app.
Indeed, you can place the configuration file there. I would argue
against it because the settings made there apply to all users, even non
interactive ones such as daemons using fontconfig to serve bitmap content
generated on the fly. For a desktop user, the best place is still a separate
file located in any of the directories listed in
/usr/local/etc/fonts/conf.d/50-user.conf. Contrary to fonts.conf, files you
name yourself will probably not be altered by the desktop---if they are then
its a bug.
--
%!PS -- Bertrand Petit
/D{def}def/E{exch}D/G{get}D/I{2 div}D/U{dup}D/L{roll}D/Y{setgray}D/N{newpath}D
/O{N 0 0 moveto}D/P{pop}D/T{translate}D currentpagedevice/PageSize G U 0 G/w E
D 1 G /h E D w I h I T 0 Y 1 setlinewidth 0 1 2 { P 120 rotate 2 4 w U mul h U
mul add sqrt I 50 add {N 50 0 3 2 L 0 360 arc stroke}for}for/s{O true charpath
pathbbox exch 4 -1 L E sub I 3 1 L sub I} D /l(bp)D 0.94 Y /Helvetica findfont
22 scalefont setfont l s P(x)s exch P T O l show showpage


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Miroslav Lachman
2024-01-16 14:25:07 UTC
Permalink
Post by Bertrand Petit
Post by Miroslav Lachman
Can this be placed as a separate file into /usr/local/etc/fonts/conf.d/?
This way it will not be overwritten by upgrade or another app.
Indeed, you can place the configuration file there. I would argue
against it because the settings made there apply to all users, even non
interactive ones such as daemons using fontconfig to serve bitmap content
generated on the fly. For a desktop user, the best place is still a separate
file located in any of the directories listed in
/usr/local/etc/fonts/conf.d/50-user.conf. Contrary to fonts.conf, files you
name yourself will probably not be altered by the desktop---if they are then
its a bug.
Thank you for the clarification!

Kind regards
Miroslav Lachman




--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Bertrand Petit
2024-01-16 07:45:13 UTC
Permalink
I've looked up the patch you linked, but I don't know where to put it
exacly.
Extract the whole <MATCH> tag from George's document and insert it
anywhere in your fonts.conf file with the limitation that it must be placed at
the same level as the already present <MATCH>s.
I don't know where my version comes from. Perhaps it was crafted from
XFCE settings GUI?
You way want to make your file read-only in order to prevent any
desktop environment from overwriting your settings.

You can also place the whole document George mentioned in a separate
file in the ~/.config/fontconfig/ directory. For reference, look in
/usr/local/etc/fonts/ how this is done system-wide.
Is this all obsolete? Should I delete this and replace it with the given
text?
Those settings are fine and can be kept. Removing then will change
the appearance of text on screen.
--
%!PS -- Bertrand Petit
/D{def}def/E{exch}D/G{get}D/I{2 div}D/U{dup}D/L{roll}D/Y{setgray}D/N{newpath}D
/O{N 0 0 moveto}D/P{pop}D/T{translate}D currentpagedevice/PageSize G U 0 G/w E
D 1 G /h E D w I h I T 0 Y 1 setlinewidth 0 1 2 { P 120 rotate 2 4 w U mul h U
mul add sqrt I 50 add {N 50 0 3 2 L 0 360 arc stroke}for}for/s{O true charpath
pathbbox exch 4 -1 L E sub I 3 1 L sub I} D /l(bp)D 0.94 Y /Helvetica findfont
22 scalefont setfont l s P(x)s exch P T O l show showpage


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Andrea Venturoli
2024-01-16 08:58:09 UTC
Permalink
Post by Bertrand Petit
I've looked up the patch you linked, but I don't know where to put it
exacly.
Extract the whole <MATCH> tag from George's document and insert it
anywhere in your fonts.conf file with the limitation that it must be placed at
the same level as the already present <MATCH>s.
Doh!!! Helpful Firefox!!!
It completely hid the fact that the attachment was XML too! :(
Sorry for the dumb question.

I'm trying this now... seems to be working.

bye & Thanks
av.


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Loading...