如何在 Ubuntu 中安裝 EmojiOne Color SVGinOT 字體

SVG in Open Type (SVGinOT) 是 Adob​​e 和 Mozilla 為彩色 OpenType 和 Open Font Format 字體制定的標準。 它允許字體創建者在字體中嵌入完整的 SVG 文件,從而實現全彩甚至動畫。 EmojiOne Color Font 使用免費的 Emoji One 藝術作品中的字形。 該字體適用於所有操作系統,但目前將在 Mozilla 中顯示彩色表情符號 Firefox 和雷鳥而已。 這不是字體的限制,而是操作系統和應用程序的限制。 包含常規黑白輪廓表情符號以實現向後/後備兼容性。 非 Gecko 應用程序,如 twitter 客戶端 Corebird, chrome 瀏覽器和 Nylas N1 電子郵件客戶端不支持 SVGinOT 字體。 因此,只會顯示單色情感字符。 本文介紹了在 Ubuntu 16 版本中安裝 EmojiOne Color SVGinOT。

EmojiOne Color SVGinOT 需要已安裝 Bitstream Vera,它將更改系統默認的 serif、sans-serif 和 monospace 字體。

安裝比特流維拉

大多數 Linux 發行版的默認襯線、無襯線和等寬字體是 DejaVu。 DejaVu 的符號覆蓋 EmojiOne Color 字符。 有一個解決方案可以讓 EmojiOne Color 成為默認的系統字體,但這會導致許多問題。 Bitstream Vera 不會覆蓋任何表情符號字符,因此 Vera 是 DejaVu 中使用的字形的來源。

在 Ubuntu 中使用 apt-get 安裝比特流 vera

 # sudo apt-get install ttf-bitstream-vera

以下手動方法適用於其他發行版。

 # wget https://ftp.gnome.org/pub/GNOME/sources/ttf-bitstream-vera/1.10/ttf-bitstream-vera-1.10.tar.gz
 # tar xf ttf-bitstream-vera-1.10.tar.gz
 # mkdir /usr/share/fonts/ttf-bitstream-vera
 # cd ttf-bitstream-vera-1.10 
 # mv * /usr/share/fonts/ttf-bitstream-vera/

使用 fc-cache 掃描字體目錄並為應用程序構建字體信息緩存文件,例如 firefox 用於字體處理。

 # fc-cache -vfrs
 ...............
 /usr/share/fonts/ttf-bitstream-vera: caching, new cache contents: 10 fonts, 0 dirs
 /usr/share/fonts/ucs-miscfixed: caching, new cache contents: 23 fonts, 0 dirs
 ...............

安裝 EmojiOne Color SVGinOT

在 Ubuntu 中,您可以使用 apt-get 安裝 EmojiOne Color SVGinOT。

 # sudo apt-add-repository ppa:eosrei/fonts
 # sudo apt-get update
 # sudo apt-get install fonts-emojione-svginot

使用以下手動方法為特定用戶或任何其他 linux 發行版安裝它。

 # wget https://github.com/eosrei/emojione-color-font/releases/download/v1.3/EmojiOneColor-SVGinOT-Linux-1.3.tar.gz
 # tar zxf EmojiOneColor-SVGinOT-Linux-1.3.tar.gz
 # cd EmojiOneColor-SVGinOT-Linux-1.3
 # ./install.sh 
 EmojiOne Color font installer for Linuxn
 NOTE: Changing default font family to Bitstream Vera
 Installing the font in: /root/.local/share/fonts/
 Clearing font cache
 Done!

只記得 Firefox 目前支持 SVGinOT 顏色表情符號。 Safari 和 Chrome 將使用後備黑白表情符號。

在 Ubuntu 16.04 LTS 上設置和構建

要求:-

墨景
圖像魔術師
potrace / mkbitmap
字體工具 3.0+
FontForge 20160405+
SVGO
製作
SCF構建

將 ppa:fontpage 存儲庫添加到 apt 數據庫並更新系統。

 # sudo add-apt-repository ppa:fontforge/fontforge 
 # sudo apt-get update

安裝所有依賴

 # sudo apt-get install inkscape potrace npm nodejs nodejs-legacy fontforge python-fontforge python-pip imagemagick git make

使用 npm 安裝 svgo。 SVG Optimizer 是一個基於 Nodejs 的工具,用於優化 SVG 矢量圖形文件。

 # sudo npm install -g svgo

使用 pip 安裝 fonttools 和 pyyml。 fontTools 是一個用於操作字體的庫,用 Python 編寫。

 # sudo pip install pyyaml
 # sudo pip install fonttools

使用 git 克隆 emojione-color-font,切換到 emojione-color-font 目錄,然後再次克隆 SCFBuild(SVGinOT Color Font Builder)。 SCFBuild 在命令行上從 SVG 創建彩色字體。

 # git clone https://github.com/eosrei/emojione-color-font.git
 # cd emojione-color-font
 # git clone https://github.com/eosrei/scfbuild.git SCFBuild

現在通過執行 make 構建字體。

 # make -j 4
 .......................
 .......................
 INFO:scfbuild.builder:Reading intermediate font file
 INFO:scfbuild.builder:Adding SVGinOT SVG files
 INFO:scfbuild.builder:Saving output file: build/EmojiOneColor-SVGinOT-OSX.ttf
 INFO:scfbuild.builder:Done!
 INFO:scfbuild.builder:Saving output file: build/EmojiOneColor-SVGinOT.ttf
 INFO:scfbuild.builder:Done!

構建字體大約需要 15-20 分鐘。 將 build/EmojiOneColor-SVGinOT.ttf 複製到 ~/.local/share/fonts 並清除字體緩存。

 # cp build/EmojiOneColor-SVGinOT.ttf  ~/.local/share/fonts
 # fc-cache -vfrs

現在檢查演示 EmojiOne Color SVGinOT,您將能夠查看彩色字體。

結論

當前在任何 Linux 計算機上顯示表情符號的最佳選擇是設置 Brad Erickson’s EmojiOne彩色字體 或者 Twemoji 彩色字體. 使用這兩個,您將在 Mozilla 應用程序中獲得全彩色表情符號,並按照本文安裝過程中的說明在其他地方使用黑白符號。