我的dmenu无法检测到noto颜色的表情符号字体。它可以检测其他字体,但不能检测到这个字体。如何解决这个问题?
➜ fc-list | grep -i "notocoloremoji"
/usr/share/fonts/truetype/noto/NotoColorEmoji.ttf: Noto Color Emoji:style=Regular➜ dmenu -fn "Noto Color Emoji"
no fonts could be loaded.发布于 2022-04-13 20:51:16
dmenu和st等几种无哺乳工具使用一个名为libxft的库来处理字体呈现。这个库有一个错误,它阻止它呈现彩色字体。幸运的是,这个bug实际上已经修复了.,但不管出于什么原因,上游都没有合并。因此,要使颜色字体正常工作,您需要安装这个修补版本的libxft,然后在dmenu中删除手动禁用彩色字体的检查(因为这个bug)。我在下面编写了执行此操作的手动步骤,但作为一种更简单的解决方案,您只需安装dmenu的分叉即可:https://github.com/valeriangalliat/dmenumoji。
在arch上,您可以用这个包利布克夫特安装一个补丁版本的C11(替换旧版本)。在其他发行版上,您需要下载libxft、应用修补程序的源代码,然后手动编译并安装修补版本的libxft。
一旦得到修补程序库,就需要编辑dmenu的源代码,以删除禁用(以前已损坏的)颜色字体的代码。此检查位于drw.c顶部附近,如下所示:
/* Do not allow using color fonts. This is a workaround for a BadLength
* error from Xft with color glyphs. Modelled on the Xterm workaround. See
* https://bugzilla.redhat.com/show_bug.cgi?id=1498269
* https://lists.suckless.org/dev/1701/30932.html
* https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=916349
* and lots more all over the internet.
*/
FcBool iscol;
if(FcPatternGetBool(xfont->pattern, FC_COLOR, 0, &iscol) == FcResultMatch && iscol) {
XftFontClose(drw->dpy, xfont);
return NULL;
}删除这段代码并重新编译dmenu,您将能够使用彩色字体!这是一篇博文。
https://askubuntu.com/questions/1392585
复制相似问题