云网牛站
所在位置:首页 > Linux教程 > 在Ubuntu Linux下启用彩色Emoji

在Ubuntu Linux下启用彩色Emoji

2018-04-07 15:16:58作者:Plum's稿源:plumz.me

Linux 下对 Emoji 的支持很不好,很多推荐你安装各种字体的结果,也只能是把 Emoji 用黑白样式显示出来。

解决方法就是找个 Linux 兼容的 Emoji 字体,其中某些 Windows 系统自带的 SegoeUIEmoji 是一个,还有今天要说的另一个选择 Emoji one。

 

相关链接

下载地址

安装文档

 

官方文档建议增加自定义字体配置,让 Emoji One 字体成为首选备用字体,然而一开始根据我测试,这些并没有什么卵用,直接安装这个字体就行了。

在Ubuntu Linux下启用彩色Emoji

 

但是很快,发现事情没那么简单,作者也在后续中给出了解释:

Yes, you won't need font.conf if your distribution doesn't include any fonts with emoji.

Both Ubuntu and Fedora (my testbeds) include the DejaVu family,so I need the font.conf to override DejaVu.

It doesn't surprise me some distributions don't include some default emoji.

What are you running? This what it looks like without the font.conf on both Ubuntu and Fedora

在Ubuntu Linux下启用彩色Emoji

 

原来对于 Fedora 和 Ubuntu 来说,配置文件还是必要的:

首先是创建配置目录:

mkdir -p ~/.config/fontconfig/

然后编辑配置文件:

vim ~/.config/fontconfig/fonts.conf

写入:

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE fontconfig SYSTEM "fonts.dtd">

<fontconfig>

<!-- Make Emoji One Color the initial fallback font-->

<match>

<test name="family"><string>sans-serif</string></test>

<edit name="family" mode="prepend" binding="strong">

<string>Emoji One Color</string>

</edit>

</match>

<match>

<test name="family"><string>serif</string></test>

<edit name="family" mode="prepend" binding="strong">

<string>Emoji One Color</string>

</edit>

</match>

<match>

<test name="family"><string>monospace</string></test>

<edit name="family" mode="prepend" binding="strong">

<string>Emoji One Color</string>

</edit>

</match>

</fontconfig>

 

重启也好不重启也好,最好重新启动一下。

测试的结果还凑合吧,虽然不能达到 100% 显示,但是大部分和常见的是没问题了。

在Ubuntu Linux下启用彩色Emoji

 

相关主题

在Linux上使用Glyphr设计自己的字体

精选文章
热门文章