ubuntu - 如何在 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 上的所有语言。
解决方案
I found 2 related solution:
- Install Google Noto Font. (https://www.google.com/get/noto/)
But it's so large about 1.1GB. I didn't try it.
- 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.
推荐阅读
- c# - 英特尔 MKL 错误:进入 cblas_zgemm (C# Linux) 时参数 9 不正确
- aggregate - 在 Tableau 中聚合调查结果的 MDX Cube 数据
- java - 匹配阿拉伯日期或普通日期的正则表达式
- postgresql - 如何更改默认使用的 psql 版本?
- assembly - 在嵌入式 ARM 设备上,使用 Keil 将 PC (R15) 设置为指向我的代码的所需地址
- java - 模拟器:qemu-system-i386.exe:无法打开`/path/pstore.bin`:权限被拒绝
- ios - HSV 转换的错误结果?
- angular - 使用 angular-meteor 在 Angular 中延迟加载不可路由的模块
- python - 如何检查没有参数发送到 Python 中的函数
- swift - Xcode 我收集视图我在 cellForRowAtIndexpath 函数中排队 urlsession 数据任务