Gentoo Archives: gentoo-user

From: tastytea <gentoo@××××××××.de>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Remove codepoints from fonts with fontconfig
Date: Fri, 23 Sep 2022 18:07:04
Message-Id: 20220923200656.372a4cbc@ventiloplattform.tastytea.de
1 Hi,
2 i added a colour emoji font as my last preferred font to fontconfig and
3 want to get all emojis from it. The problem is, that my first preferred
4 font contains some mono coloured emojis that override the colour emoji
5 font. This is my config:
6
7 <alias>
8 <family>monospace</family>
9 <prefer>
10 <family>Source Code Pro</family>
11 <family>Source Han Mono</family>
12 <family>Noto Color Emoji</family>
13 </prefer>
14 </alias>
15
16 and the same for serif and sans-serif[1].
17
18 I tried to “remove” the offending codepoints from all fonts matching
19 *Source* like this:
20
21 <match target="scan">
22 <test name="family" compare="contains">
23 <string>Source</string>
24 </test>
25 <edit name="charset" mode="assign" binding="same">
26 <minus>
27 <name>charset</name>
28 <charset>
29 <int>0x2764</int> <!-- ❤ -->
30 <int>0x1f916</int> <!-- 🤖 -->
31 </charset>
32 </minus>
33 </edit>
34 </match>
35
36 but that only works partially. After running `fc-cache -f` the emojis
37 are shown correctly in xfce4-terminal and GTK 2/3 programs but not in
38 alacritty and Qt5 programs. Firefox gets only some of them right.
39 Rebooting didn't help.
40
41 Is there a way to make it work everywhere?
42
43 [1] full config:
44 <https://schlomp.space/tastytea/dotfiles/src/branch/main/.config/fontconfig/fonts.conf>