linux字体查询
原创大约 2 分钟
本文介绍,在Linux环境下用字体查询
操作环境说明
操作环境为 Ubuntu 22.04.2 LTS, 原则上只要有lsof命令即可。
root@ubuntu:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.2 LTS
Release: 22.04
Codename: jammy
查询命令
安装字体命令
apt update
apt install fontconfig -y
1.查看所有字体
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
2.查看中文字体
fc-list :lang=zh
3.查看更多字体
fc-match -v "AR PL UKai CN"
Pattern has 38 elts (size 48)
family: "DejaVu Sans"(s)
familylang: "en"(s)
style: "Book"(s)
stylelang: "en"(s)
fullname: "DejaVu Sans"(s)
fullnamelang: "en"(s)
slant: 0(i)(s)
weight: 80(f)(s)
width: 100(f)(s)
size: 12(f)(s)
pixelsize: 12.5(f)(s)
foundry: "PfEd"(w)
antialias: True(w)
hintstyle: 1(i)(w)
hinting: True(s)
verticallayout: False(s)
autohint: False(s)
globaladvance: True(s)
file: "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf"(w)
index: 0(i)(w)
outline: True(w)
scalable: True(w)
dpi: 75(f)(s)
scale: 1(f)(s)
charset:
0000: .......
(w)
lang: aa|ab|af|ar|ast|av|ay|az-az|az-ir|ba|bm|be|bg|bi|bin|br|bs|bua|ca|ce|ch|chm|co|cs|cu|cv|cy|da|de|el|en|eo|es|et|eu|fa|fi|fj|fo|fr|ff|fur|fy|ga|gd|gl|gn|gv|ha|haw|he|ho|hr|hu|hy|ia|ig|id|ie|ik|io|is|it|iu|ka|kaa|ki|kk|kl|ku-am|ku-ir|kum|kv|kw|ky|la|lb|lez|ln|lo|lt|lv|mg|mh|mi|mk|mo|mt|nb|nds|nl|nn|no|nr|nso|ny|oc|om|os|pl|pt|rm|ro|ru|sah|sco|se|sel|sh|shs|sk|sl|sm|sma|smj|smn|sms|so|sq|sr|ss|st|sv|sw|tg|tk|tl|tn|to|tr|ts|tt|tw|tyv|ug|uk|uz|ve|vi|vo|vot|wa|wen|wo|xh|yap|yi|yo|zu|ak|an|ber-dz|ber-ma|crh|csb|ee|fat|fil|hsb|ht|hz|jv|kab|kj|kr|ku-iq|ku-tr|kwm|lg|li|mn-mn|ms|na|ng|nv|ota|pap-an|pap-aw|qu|quz|rn|rw|sc|sd|sg|sn|su|ty|za(s)
fontversion: 155320(i)(s)
capability: "otlayout:DFLT otlayout:arab otlayout:armn otlayout:brai otlayout:cans otlayout:cher otlayout:cyrl otlayout:geor otlayout:grek otlayout:hani otlayout:hebr otlayout:kana otlayout:lao otlayout:latn otlayout:math otlayout:nko otlayout:ogam otlayout:runr otlayout:tfng otlayout:thai"(w)
fontformat: "TrueType"(w)
embeddedbitmap: True(s)
decorative: False(s)
lcdfilter: 1(i)(w)
namelang: "en"(s)
prgname: "fc-match"(s)
postscriptname: "DejaVuSans"(w)
color: False(w)
symbol: False(s)
variable: False(s)
4.刷新字体 (可以下载或者复制字体文件到 /usr/share/fonts)
#进入字体目录
cd /usr/share/fonts
#建立字体索引
mkfontscale
mkfontdir
#刷新字体缓存
fc-cache