cairo-coloredemoji、配置由 hexchain 提供
安装 Cairo :
aur/cairo-coloredemoji
AUR 上的资源好像下载有问题,如果安装出错,手动下载后,放到 tmp 的对应位置,再安装就能成功了
安装字体 :
extra/noto-fonts-emoji
配置~/.config/fontconfig/fonts.conf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 <?xml version='1.0' encoding='UTF-8'?> <!DOCTYPE fontconfig SYSTEM 'fonts.dtd' > <fontconfig > <match target ='font' > <edit mode ='assign' name ='rgba' > <const > rgb</const > </edit > </match > <match target ='font' > <edit mode ='assign' name ='hintstyle' > <const > hintfull</const > </edit > </match > <match target ='font' > <edit mode ='assign' name ='antialias' > <bool > true</bool > </edit > </match > <match target ='font' > <edit name ='lcdfilter' mode ='assign' > <const > lcddefault</const > </edit > </match > <match > <edit mode ='prepend' name ='family' > <string > Noto Sans</string > </edit > </match > <match > <test compare ='contains' name ='lang' > <string > zh_CN</string > </test > <edit mode ='prepend' name ='family' > <string > Noto Sans CJK SC</string > </edit > </match > <match target ='pattern' > <test qual ='any' name ='family' > <string > sans-serif</string > </test > <edit name ='family' mode ='prepend' binding ='same' > <string > Noto Sans</string > </edit > </match > <match target ='pattern' > <test qual ='any' name ='family' > <string > serif</string > </test > <edit name ='family' mode ='prepend' binding ='same' > <string > Noto Serif</string > </edit > </match > <match target ='pattern' > <test qual ='any' name ='family' > <string > monospace</string > </test > <edit name ='family' mode ='prepend' binding ='same' > <string > Noto Sans</string > </edit > </match > <match target ="pattern" > <test name ="prgname" > <string > firefox</string > </test > <edit name ="family" mode ="prepend" > <string > Noto Color Emoji</string > </edit > </match > <match target ="pattern" > <test name ="prgname" > <string > chrome</string > </test > <edit name ="family" mode ="prepend" > <string > Noto Color Emoji</string > </edit > </match >
我直接使用 hexchain 的 配置
Emoji 字符宽度 安装aur/vte3-ng-fullwidth-emoji
设置wcwidth
宽度
wcwidth
对字符宽度的计算由 locale 决定,比如对于常用的en_US.UTF-8
等,glibc 提供的/usr/share/i18n/charmaps/UTF-8.gz
中WIDTH
、END WIDTH
区块给出了字符宽度信息。但其中没有列出 Emoji 字符,因此宽度将用缺省值 1。
我用 https://gist.github.com/MaskRay/86b71b50d30cfffbca7a 重新生成一个UTF-8
,gzip 压缩后覆盖/usr/share/i18n/charmaps/UTF-8.gz
,然后执行locale-gen
。修改后,可以用 https://gist.github.com/MaskRay/8042e39dc822a57c217f 确定wcwidth
计算出来的宽度确实变更了。
Arch Linux 用户 /etc/pacman.d/hooks/update-charmaps-UTF-8.hook
:
1 2 3 4 5 6 7 8 [Trigger] Operation = Upgrade Type = File Target = usr/share/i18n/charmaps/UTF-8.gz [Action] When = PostTransaction Exec = /etc/pacman.d/hooks/update-charmaps-UTF-8.py
/etc/pacman.d/hooks/update-charmaps-UTF-8.py
:
从 https://gist.github.com/MaskRay/86b71b50d30cfffbca7a 下载
by:MasKray
效果
图片展示
问题 好像 wcwidth 还是有问题的,按 tab 会遗留第一个字母