首页 > 解决方案 > 如何在 Ubuntu 上支持所有语言(字体)

问题描述

默认情况下,dockerubuntu镜像或其他最小的 ubuntu 仅支持英文。但是有一些功能,如文本到图像或 PDF 生成,取决于与内容对应的系统字体。

目前,fc-list是:

/usr/share/fonts/truetype/dejavu/DejaVuSerif-Bold.ttf: DejaVu Serif:style=Bold
/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf: DejaVu Sans Mono:style=Book
/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf: DejaVu Sans:style=Book
/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf: DejaVu Sans:style=Bold
/usr/share/fonts/truetype/dejavu/DejaVuSansMono-Bold.ttf: DejaVu Sans Mono:style=Bold
/usr/share/fonts/truetype/dejavu/DejaVuSerif.ttf: DejaVu Serif:style=Book

它导致一些非 ASCII 字符显示为正方形。有一个案例:https ://confluence.atlassian.com/confkb/non-ascii-characters-display-as-square-characters-in-confluence-317948797.html

所以,我想要一个最佳实践来支持 Ubuntu 上的所有语言。

标签: ubuntufontsapt

解决方案


I found 2 related solution:

  1. Install Google Noto Font. (https://www.google.com/get/noto/)

But it's so large about 1.1GB. I didn't try it.

  1. Install all language-pack:
apt install -y language-selector-common
check-language-support -a | xargs apt install -y

It solved my problem, but I'm not sure this is the best practice.


推荐阅读