I’m having problems where the wrong/different font is chosen on one
computer even though my setup should be the same.

On my first system, Material Icons font is chosen, but on the second
system, Symbols Nerd Font and GNU Unifont is chosen.

I copied my old operating-system configuration and only did minor tweaks
to support the new system (e.g. change hostname), but the font setup is
the same. I also use the exact same home-environment and the same emacs
configuration.

Material Icons is added by emacs `all-the-icons-install-fonts' and added
to `~/.local/share/fonts/material-design-icons.ttf'. This file exist on
both systems. fc-list shows this font too.

So I’m guessing fontconfig is not deterministic in some way here.
`fc-cache -fr' doesn’t help, and I’ve tried rebuilding the system, home
and rebooted too.

Char 1 () shows a different icon than intended as Nerd and Material
uses different symbols for the character.

First system - correct:
┌────
│              position: 57 of 1659 (3%), column: 0
│             character:  (displayed as ) (codepoint 59576, #o164270, #xe8b8)
│               charset: unicode-bmp (Unicode Basic Multilingual Plane 
(U+0000..U+FFFF))
│ code point in charset: 0xE8B8
│                syntax: w      which means: word
│              category: L:Strong L2R
│              to input: type "C-x 8 RET e8b8"
│           buffer code: #xEE #xA2 #xB8
│             file code: #xEE #xA2 #xB8 (encoded by coding system utf-8-unix)
│               display: by this font (glyph code):
│     ftcrhb:-unknown-Material 
Icons-regular-normal-normal-*-24-*-*-*-m-0-iso10646-1 (#x34A)
│
│ Character code properties: customize what to show
│   general-category: Co (Other, Private Use)
│   decomposition: (59576) ('')
└────

Second system - incorrect/different:
┌────
│              position: 50 of 53 (92%), column: 0
│             character:  (displayed as ) (codepoint 59576, #o164270, #xe8b8)
│               charset: unicode-bmp (Unicode Basic Multilingual Plane 
(U+0000..U+FFFF))
│ code point in charset: 0xE8B8
│                syntax: w      which means: word
│              category: L:Strong L2R
│              to input: type "C-x 8 RET e8b8"
│           buffer code: #xEE #xA2 #xB8
│             file code: #xEE #xA2 #xB8 (encoded by coding system utf-8-unix)
│               display: by this font (glyph code):
│     ftcrhb:-PfEd-Symbols Nerd Font 
Mono-regular-normal-normal-*-24-*-*-*-m-0-iso10646-1 (#x448)
│
│ Character code properties: customize what to show
│   general-category: Co (Other, Private Use)
│   decomposition: (59576) ('')
└────

Char 2 () choose a font which doesn’t have this character at all, so it
renders as E5 D9.

First system – correct:
┌────
│              position: 1649 of 2449 (67%), column: 0
│             character:  (displayed as ) (codepoint 58841, #o162731, #xe5d9)
│               charset: unicode-bmp (Unicode Basic Multilingual Plane 
(U+0000..U+FFFF))
│ code point in charset: 0xE5D9
│                syntax: w      which means: word
│              category: L:Strong L2R, j:Japanese
│              to input: type "C-x 8 RET e5d9"
│           buffer code: #xEE #x97 #x99
│             file code: #xEE #x97 #x99 (encoded by coding system utf-8-unix)
│               display: by this font (glyph code):
│     ftcrhb:-unknown-Material 
Icons-regular-normal-normal-*-24-*-*-*-m-0-iso10646-1 (#x27D)
│
│ Character code properties: customize what to show
│   general-category: Co (Other, Private Use)
│   decomposition: (58841) ('')
└────

Second system – incorrect font chosen:
┌────
│              position: 859 of 891 (96%), column: 0
│             character:  (displayed as ) (codepoint 58841, #o162731, #xe5d9)
│               charset: unicode-bmp (Unicode Basic Multilingual Plane 
(U+0000..U+FFFF))
│ code point in charset: 0xE5D9
│                syntax: w      which means: word
│              category: L:Strong L2R, j:Japanese
│              to input: type "C-x 8 RET e5d9"
│           buffer code: #xEE #x97 #x99
│             file code: #xEE #x97 #x99 (encoded by coding system utf-8-unix)
│               display: by this font (glyph code):
│     ftcrhb:-GNU -Unifont 
Sample-regular-normal-normal-*-24-*-*-*-d-0-iso10646-1 (#xDDD8)
│
│ Character code properties: customize what to show
│   general-category: Co (Other, Private Use)
│   decomposition: (58841) ('')
└────

The fonts in fc-list lists the fonts in different order on the two
systems, which is probably the reason why it picks different fonts on
the two systems, but it doesn’t explain why it picks a font which
doesn’t have the symbol…?

┌────
│ fc-list | grep -i material
└────

First (correct) system:
┌────
│ ~/.local/share/fonts/material-design-icons.ttf: Material Icons:style=Regular
│ ~/.guix-home/profile/share/fonts/web/MaterialIcons-Regular.woff: Material 
Icons:style=Regular
│ ~/.guix-home/profile/share/fonts/truetype/MaterialIcons-Regular.ttf: Material 
Icons:style=Regular
└────

Second (incorrect) system:
┌────
│ ~/.guix-home/profile/share/fonts/web/MaterialIcons-Regular.woff: Material 
Icons:style=Regular
│ ~/.local/share/fonts/material-design-icons.ttf: Material Icons:style=Regular
│ ~/.guix-home/profile/share/fonts/truetype/MaterialIcons-Regular.ttf: Material 
Icons:style=Regular
└────

What is the correct way to make the systems deterministic? And only
choose a font which has symbols defined? And choose the preferred fonts
in different situations?

Attachment: signature.asc
Description: PGP signature

Reply via email to