字體
引自維基百科:「計算機字體或電腦字體,簡稱字體,是包含有一套字形與字符的電子數據文件。」
字體格式[編輯 | 編輯原始碼]
現在使用的計算機字體絕大多數都屬於點陣或輪廓數據格式。
- 點陣字體
- 用點或者像素組成的矩陣代表每種字形的每種形式和尺寸的圖像。
- 輪廓字體,或稱矢量字體
- 使用貝塞爾曲線、繪圖指令和數學公式描述每種字形,使得字符輪廓可以適應各種尺寸。
點陣格式[編輯 | 編輯原始碼]
- Adobe 的位圖字體分布格式(Glyph Bitmap Distribution Format,BDF)
- Xorg 的便攜式編譯格式(Portable Compiled Format,PCF)
- Linux 內核的控制台使用的個人電腦屏幕字體(PC Screen Font,PSF),不受 Xorg 支持(Unicode PSF 文件的擴展名是
psfu
)
這些格式也可以被 gzip 壓縮。可用的點陣字體請參見#點陣。
輪廓格式[編輯 | 編輯原始碼]
- Adobe 的 PostScript 字體,有多種格式,如打印機 ASCII 字體(Printer Font ASCII,PFA)和打印機二進制字體(Printer Font Binary,PFB)
- Apple 和 Microsoft 的 TrueType(擴展名為
ttf
) - Microsoft 的 OpenType,基於 TrueType(擴展名為
otf
或ttf
)
在大多數情況下都可以忽略 TrueType 和 OpenType 之間的技術差異。
其它格式[編輯 | 編輯原始碼]
排版程序 TeX 和配套的字體軟件 Metafont 使用它們自己的傳統方法渲染字體。部分用於這兩個程序的字體文件擴展名有 *pk
、*gf
、mf
與 vf
。更新的版本也支持 TrueType 和 OpenType 字體。
FontForge(fontforge包)是一個字體編輯程序,可以以自己基於文本的原生格式 sfd
(spline font database)儲存字體。
SVG 格式也有自己的字體描述方法。
安裝[編輯 | 編輯原始碼]
可以使用多種方法安裝字體。
Pacman[編輯 | 編輯原始碼]
可以使用 pacman 安裝已啟用的軟件源中的字體和字體集。
可用的字體可以通過查詢包查找(比如以 font
或 ttf
作為關鍵字查找)。
創建字體包[編輯 | 編輯原始碼]
字體應該由 pacman 管理,這可以通過創建 Arch 包完成。這些包也可以在 AUR 中與社區分享。用於安裝字體的包都非常相似;請參見字體打包指南。
可以用 fc-query
查看字體的字體族,例如:fc-query -f '%{family[0]}\n' /文件/路徑
。FcPatternFormat(3) 中描述了輸出的格式。
手動安裝[編輯 | 編輯原始碼]
要安裝不在源中的字體,推薦的方法是#創建字體包。這使得 pacman 在以後能夠更新或者移除它們。
或者,也可以手動安裝字體:
- 要為單個用戶安裝,則安裝到
~/.local/share/fonts/
。- 多數時候這就足夠了,除非以其他用戶的身份運行圖形程序。
- 之前曾使用過
~/.fonts/
,但現在已被棄用。
- 要為系統(所有用戶)安裝,則安裝到
/usr/local/share/fonts/
。- 可能需要先創建該目錄:
mkdir -p /usr/local/share/fonts
。 /usr/share/fonts/
由包管理器管理,請勿手動修改。
- 可能需要先創建該目錄:
是否要創建子目錄由用戶決定,各發行版也有不同。為清晰起見,可將每個字體族放在單獨的目錄裡。Fontconfig 將遞歸搜索默認路徑,確保可以發現子目錄下的文件。
以下是一個目錄結構示例:
/usr/local/share/fonts/ ├── otf │ └── SourceCodeVariable │ ├── SourceCodeVariable-Italic.otf │ └── SourceCodeVariable-Roman.otf └── ttf ├── AnonymousPro │ ├── Anonymous-Pro-B.ttf │ ├── Anonymous-Pro-I.ttf │ └── Anonymous-Pro.ttf └── CascadiaCode ├── CascadiaCode-Bold.ttf ├── CascadiaCode-Light.ttf └── CascadiaCode-Regular.ttf
請確保所有用戶都有讀取字體文件的權限,即至少將文件 chmod 為 444
,目錄為 555
。
要讓 Xserver 直接載入字體(而不是使用某些字體服務),就需要將新增字體的目錄加入到 FontPath 中。它位於 Xorg 配置文件(例如 /etc/X11/xorg.conf
或 /etc/xorg.conf
) 中。更多詳細內容請參見#較舊的應用程序。
最後,更新 Fontconfig 的緩存(通常不需要,因為使用 Fontconfig 庫的軟件會這樣做):
$ fc-cache
較舊的應用程序[編輯 | 編輯原始碼]
對於不支持 Fontconfig 的舊應用程序(例如 GTK 1.x 應用程序和 xfontsel
),需要在字體目錄中創建索引:
$ mkfontscale $ mkfontdir
或在一條命令中包含多個目錄:
$ for dir in /字体/目录1/ /字体/目录2/; do xset +fp $dir; done && xset fp rehash
或者,如果字體被安裝在不同的子文件夾中,比如在 /usr/share/fonts
下:
$ for dir in * ; do if [ -d "$dir" ]; then cd "$dir";xset +fp "$PWD" ;mkfontscale; mkfontdir;cd .. ;fi; done && xset fp rehash
有時 X 服務器可能無法加載字體目錄,這時需要重新掃描所有 fonts.dir
文件:
# xset +fp /usr/share/fonts/misc # 将新目录告诉 X 服务器 # xset fp rehash # 强制重新扫描
要查詢字體是否已經生效:
$ xlsfonts | grep fontname
這也可以在 /etc/X11/xorg.conf
或 /etc/X11/xorg.conf.d
中全局設置。
這個例子演示了必須加入到 /etc/X11/xorg.conf
中的一節內容。請根據實際需要添加或刪除路徑。
# 讓 X.Org 知道自定義字體目錄 Section "Files" FontPath "/usr/share/fonts/100dpi" FontPath "/usr/share/fonts/75dpi" FontPath "/usr/share/fonts/cantarell" FontPath "/usr/share/fonts/cyrillic" FontPath "/usr/share/fonts/encodings" FontPath "/usr/share/fonts/misc" FontPath "/usr/share/fonts/truetype" FontPath "/usr/share/fonts/TTF" FontPath "/usr/share/fonts/util" EndSection
Pango 警告[編輯 | 編輯原始碼]
如果系統使用 Pango,那它就會從 Fontconfig 讀取字體來源。
(process:5741): Pango-WARNING **: failed to choose a font, expect ugly output. engine-type='PangoRenderFc', script='common' (process:5741): Pango-WARNING **: failed to choose a font, expect ugly output. engine-type='PangoRenderFc', script='latin'
如果看到類似上面的錯誤,或在應用程序中看到方塊而不是文字,就需要添加字體並更新字體緩存。以下示例以 ttf-liberation包 字體為例講解(成功安裝軟件包後)如何解決這個問題,並以 root 權限運行使字體在系統範圍內生效。
# fc-cache
/usr/share/fonts: caching, new cache contents: 0 fonts, 3 dirs /usr/share/fonts/TTF: caching, new cache contents: 16 fonts, 0 dirs /usr/share/fonts/encodings: caching, new cache contents: 0 fonts, 1 dirs /usr/share/fonts/encodings/large: caching, new cache contents: 0 fonts, 0 dirs /usr/share/fonts/util: caching, new cache contents: 0 fonts, 0 dirs /var/cache/fontconfig: cleaning cache directory fc-cache: succeeded
可以這樣測試設置的默認字體:
$ fc-match
LiberationMono-Regular.ttf: "Liberation Mono" "Regular"
字體包[編輯 | 編輯原始碼]
以下是一個有選擇的列表,其中包括 AUR 以及官方存儲庫中的許多字體包。標記為「Unicode」的字體具有廣泛的 Unicode 支持。
點陣[編輯 | 編輯原始碼]
- 默認的 8x16 大小
- Berry(pcf-spectrum-berryAUR)——8px
- Dina(dina-font包)——6pt、8pt、9pt、10pt;等寬;基於 Proggy
- Efont(efont-unicode-bdfAUR ——10px、12px、14px、16px、24px;普通體、粗體和斜體
- Gohu(gohufontAUR)——11px、14px;普通體和粗體
- Lime(artwiz-fontsAUR)
- ProFont(ttf-profont-iixAUR)——10px、11px、12px、15px、17px、22px、29px;普通體
- Proggy(proggyfontsAUR)——有不同的變體
- Tamsyn (tamsyn-font包)
- Terminus(terminus-font包)
- Tewi(bdf-tewi-gitAUR)
- Unifont(覆蓋最廣泛,支持 Unicode 範圍的所有字體)(bdf-unifontAUR)
- 適用於 Pango 1.44:
- ProFont(profont-otbAUR)—— ProFont的 OpenType 位圖(OpenType Bitmap,OTB)變體
- Misc Fixed(xorg-fonts-misc-otbAUR)
- Gohufont(gohufont-otbAUR)
- Cozette(cozette-otbAUR)
- Terminus(terminus-font包)
- AUR 中的其他 OTB 字體
拉丁文字[編輯 | 編輯原始碼]
字體族[編輯 | 編輯原始碼]
提供基本字體集的包:
- Bitstream Vera(ttf-bitstream-vera包)——包含無襯線、襯線和等寬字體。Bitstream Vera Sans 的公制與 Verdana 兼容。
- Croscore 字體(ttf-croscore包)——與 Helvetica、Times 和 Courier 公制兼容的字體,隨 Chrome OS 提供。
- DejaVu 字體(ttf-dejavu包)—— Bitstream Vera modified for greater Unicode coverage
- Droid(ttf-droid包)—— Default font for older Android versions with wide Unicode coverage including CJK but not symbols and emojis
- GNU FreeFont(gnu-free-fonts包)—— Includes three fonts that are open-source clones of Helvetica, Times, and Courier, but are metrically slightly different. Most Latin characters are from URW fonts (e.g., Nimbus Roman, Nimbus Sans), good Unicode coverage but does not include CJK
- IBM Plex(ttf-ibm-plex包)—— Serif, sans-serif, condensed sans-serif and monospace with true italics
- Liberation 字體(ttf-liberation包)—— Metric-compatible fonts for Helvetica, Times, and Courier, but are visually different
- Linux Libertine(ttf-linux-libertine包)—— Serif (Libertine) and sans serif (Biolinum) fonts with large Unicode coverage
- 微軟字體—— Windows 和 Office 中的字體。
- Noto(noto-fonts包)—— Google font family with full Unicode coverage if installed with its emoji and CJK optional dependencies
Packages not providing a base font set:
- B612 (ttf-b612AUR) ——由 Airbus 贊助的開源字體系列(無襯線和等寬),專為在飛機駕駛艙屏幕上閱讀而設計
- Luxi fonts (font-bh-ttfAUR) ——類似 Lucida 的 X.Org 字體族
- Roboto (ttf-roboto包) – Default font for newer Android versions where it is complemented by Noto fonts for languages not supported like CJK
- TeX Gyre fonts (tex-gyre-fonts包) – Metric-compatible fonts for Helvetica, Times, and Courier by the Polish GUST association of TeX users. They have their own math companion fonts, see #數學.
- Ubuntu 字體族 (ttf-ubuntu-font-family包)
舊版 Microsoft 字體包:
- Microsoft 字體 (ttf-ms-fontsAUR) – Andalé Mono, Courier New, Arial, Arial Black, Comic Sans, Impact, Lucida Sans, Microsoft Sans Serif, Trebuchet, Verdana, Georgia, Times New Roman
- Vista 字體 (ttf-vista-fontsAUR) – Consolas, Calibri, Candara, Corbel, Cambria, Constantia
等寬[編輯 | 編輯原始碼]
支持 編程連字的字體標有 ⟶ 符號。更多等寬字體參見#點陣和#字體族。
- Anonymous Pro (ttf-anonymous-pro包, included in ttf-google-fonts-gitAUR)
- Cascadia Code (ttf-cascadia-code包) ⟶ – Designed to enhance the look of the Windows Terminal, with programming ligatures, released by Microsoft under the Open Font License.
- Courier Prime (ttf-courier-primeAUR) – Courier alternative which has been supplemented by a sans serif font and a version optimized for programming, released under the Open Font License.
- Envy Code R (ttf-envy-code-rAUR) – Font designed for programmers
- Fantasque Sans Mono (ttf-fantasque-sans-mono包, otf-fantasque-sans-mono包)
- Fira Mono (ttf-fira-mono包, otf-fira-mono包) – Font optimized for small screens and adopted by Mozilla for the Firefox OS
- Fira Code (ttf-fira-code包) ⟶ – Extension of Fira Mono with programming ligatures for common programming multi-character combinations
- Hack (ttf-hack包) - Open source monospaced font, used as the default in KDE Plasma
- Hasklig (otf-haskligAUR) - 具有等寬連字的代碼字體
- Hermit (otf-hermit包) - 由程序員為程序員設計的字體
- Inconsolata(ttf-inconsolata包,包含在 ttf-google-fonts-gitAUR 中)——為顯示源代碼設計,靈感來自 Consolas 和 Letter Gothic
- Inconsolata-g(ttf-inconsolata-gAUR)——添加一些對程序員友好的修改
- Iosevka (ttc-iosevka包) ⟶ – Slender sans-serif and slab-serif typeface inspired by Pragmata Pro, M+ and PF DIN Mono, designed to be the ideal font for programming; it supports programming ligatures and over 2000 latin, greek, cyrillic, phonetic and PowerLine glyphs
- JetBrains Mono (ttf-jetbrains-mono包) ⟶ – JetBrains 開發的免費開源字體
- Lucida Typewriter(包含在 jreAUR 軟件包中)
- Menlo (ttf-mesloAUR) – Customized version of Apple's Menlo Regular font for OS X with larger vertical gap spacing
- Monaco (ttf-monacoAUR) – Apple 為 OS X 設計的專有字體
- Monofur (ttf-monofur包)
- Mononoki(ttf-mononokiAUR)——用於編程和 code review 的字體
- Source Code Pro(adobe-source-code-pro-fonts包,包含在 ttf-google-fonts-gitAUR 中)
相關網站:
- Trevor Lowing 的字體清單
- Slant:最好的編程字體是什麼?
- Stack Overflow:推薦編程字體
- 編程字體 - 試駕
- 編程字體比較
- Coding Font by Typogram
無襯線[編輯 | 編輯原始碼]
- Andika (ttf-andikaAUR)
- Cantarell (cantarell-fonts包) – Default font supplied with GNOME, it is required by the GNOME and GTK 3 related packages
- DMCA Sans Serif (ttf-dmcasansserifAUR) – General purpose sans serif font metric-compatible with Microsoft Consolas
- Fira Sans (ttf-fira-sans包, otf-fira-sans包) – Sans serif font designed by Erik Spiekermann for Mozilla and the Firefox OS. Fira Mono and Fira Code are monospaced companions of Fira Sans (see #等寬)
- FreeSans (gnu-free-fonts包) – Visually similar to Helvetica but metrically different, see #字體族
- Inter (inter-font包) – A geometric neo-grotesque font designed for user interfaces
- Jost* (otf-jostAUR) – An open-source typeface based on Futura
- Liberation Sans (ttf-liberation包) – Metric-compatible with Helvetica but visually distinct, see #字體族
- Montserrat (montserrat-otfAUR) – An open source font that shares similarities with Gotham and Proxima Nova
- Nunito (ttf-nunitoAUR) – An open source font with rounded terminal, hence shares similarities with Gotham Rounded and Proxima Soft
- Open Sans (ttf-opensans包) – Sans serif font commissioned by Google, based on Droid sans but slightly wider.
- PT Sans (ttf-google-fonts-gitAUR) – 3 major variations: normal, narrow, and caption - Unicode: Latin, Cyrillic
- Source Sans (adobe-source-sans-fonts包) – Open source sans serif font from Adobe with a design based on News Gothic and Franklin Gothic
- Tahoma (Wine Replacement) (ttf-tahomaAUR) – Open source substitute for Tahoma developed by the Wine project. It was created because many Windows applications expected Tahoma to be available
襯線[編輯 | 編輯原始碼]
- Bitstream Charter (ttf-bitstream-charterAUR, otf-bitstream-charterAUR) – Originally a commercial font designed by Matthew Carter. A version was released under a free license and later converted to modern formats (provided as the aforementioned packages).
- Bodoni* (otf-bodoniAUR) – An open-source Bodoni revival
- Crimson (otf-crimson包) – An open-source font that shares similarities with Minion
- EB Garamond (ebgaramond-otfAUR) – An open-source Garamond revival, the aforementioned package is the version developed by Octavio Pardo
- FreeSerif (gnu-free-fonts包) – Visually similar to Times New Roman but metrically different, see #字體族
- Gentium (gentium-plus-font包) – Unicode: Latin, Greek, Cyrillic, Phonetic Alphabet
- Heuristica (ttf-heuristicaAUR) – Based on a version of Utopia that was released under a free license
- Liberation Serif (ttf-liberation包) – Metric-compatible with Times New Roman but visually distinct, see #字體族
- Libre Baskerville (ttf-librebaskervilleAUR) – An open-source Baskerville revival designed by Impallari Type
- Libre Caslon (otf-libre-caslonAUR) – An open-source Caslon revival designed by Impallari Type
- Linux Libertine (ttf-linux-libertine包) – Developed as a substitute of Times New Roman, but different both visually and metrically (the metric differences are more notable for italic and bold fonts)
- TeX Gyre Termes (tex-gyre-fonts包) – Visually similar to Times New Roman (but there are some minor metric differences), see #字體族
- Tinos (ttf-croscore包) – Metric-compatible with Times New Roman but visually distinct (and looks similar to Liberation Serif), see #字體族
非拉丁文字[編輯 | 編輯原始碼]
古代文字[編輯 | 編輯原始碼]
- ttf-ancient-fontsAUR —— 包含 Aegean、Egyptian、Cuneiform、Anatolian、Maya 和 Analecta 文字的 Unicode 符號的字體
阿拉伯文[編輯 | 編輯原始碼]
- ttf-amiriAUR —— 一個典型的阿拉伯文謄抄體 (Naskh) 字體,一開始由 Amiria Press 採用。其拉丁字符基於 Crimson (otf-crimson包) [1] [2]
- ttf-arabeyes-fontsAUR —— 自由的阿拉伯文字體集合
- ttf-qurancomplex-fontsAUR —— 位於麥地那的 King Fahd Glorious Quran Printing Complex 製作的字體
- ttf-sil-lateefAUR —— 來自 SIL 的 Unicode 阿拉伯文字體
- ttf-sil-scheherazadeAUR —— 來自 SIL 的 Unicode 阿拉伯文字體(傳統阿拉伯文字體的替代品)
孟加拉文[編輯 | 編輯原始碼]
詳見 Localization/Bengali#Fonts。
盲文[編輯 | 編輯原始碼]
- ttf-ubrailleAUR —— 包含 Unicode 盲文符號的字體。
中日韓越文字[編輯 | 編輯原始碼]
泛 CJK[編輯 | 編輯原始碼]
- 思源字體 —— 大量字體集合,全面支持簡體中文、繁體中文、日文和韓文,具有一致的設計和外觀。
- adobe-source-han-sans-otc-fonts包 —— 思源黑體,無襯線字體
- adobe-source-han-serif-otc-fonts包 —— 思源宋體,襯線字體
- noto-fonts-cjk包 —— 大量字體集合,全面支持簡體中文、繁體中文、日文和韓文,具有一致的設計和外觀。它目前是 adobe-source-han-sans-otc-fonts包 重新貼標的版本。
中文[編輯 | 編輯原始碼]
參見 Localization/Chinese#Fonts。
日文[編輯 | 編輯原始碼]
參見 Localization/Japanese#Fonts。
韓文[編輯 | 編輯原始碼]
越南語[編輯 | 編輯原始碼]
- ttf-hannom包 – 用於喃字的越南語 TrueType 字體
西里爾文字[編輯 | 編輯原始碼]
另請參閱#拉丁文字。
- ttf-paratypeAUR – Font family by ParaType: sans, serif, mono, extended cyrillic and latin, OFL 許可證
- otf-russkopisAUR – A free OpenType cursive font for Cyrillic script
希臘文字[編輯 | 編輯原始碼]
幾乎所有 Unicode 字體都包含希臘代碼集 (也包含多調變音符號)。某些額外字體包雖然不包含完整的 Unicode 集,但擁有高質量的希臘字字形 (也包含拉丁字):
- otf-gfsAUR - 由 Greek Font Society 選用的 OpenType 字體
- ttf-mgopenAUR - 來自 Magenta 的專業 TrueType 字體
希伯來文字[編輯 | 編輯原始碼]
- opensiddur-hebrew-fontsAUR – Large collection of Open-source licensed Hebrew fonts. There are also few Latin, Greek, Cyrillic, Arabic, and Amharic.
- culmusAUR —— 不錯的自由的希伯來文字體集合。
- alefbetAUR – 2 Hebrew fonts (at the moment): the commonly used "David Libre", and the handwriting font "Gveret Levin".
- ttf-ms-fontsAUR —— 包含 Arial 和其他字體。
印地文字[編輯 | 編輯原始碼]
另請參閱 Localization/Indic#Fonts。
高棉文字[編輯 | 編輯原始碼]
- ttf-khmer包 - 涵蓋高棉語 (Khmer) 文字的字體
- Hanuman (ttf-google-fonts-gitAUR)
蒙古語和通古斯語[編輯 | 編輯原始碼]
- ttf-abkaiAUR – Fonts for Sibe, Manchu and Daur scripts (incomplete, currently in development)
波斯文字[編輯 | 編輯原始碼]
- persian-fontsAUR – 用於安裝 AUR 中所有波斯字體的元包。
- borna-fontsAUR – Borna Rayaneh Co. Persian B font series.
- iran-nastaliq-fontsAUR – 自由的 Unicode 書法波斯字體。
- iranian-fontsAUR – Iranian-Sans and Iranian-Serif Persian font family.
- ir-standard-fontsAUR – 伊朗信息與通信技術高級理事會(SCICT)的標準波斯字體。
- persian-hm-ftx-fontsAUR – A Persian font series derived from X Series 2, Metafont and FarsiTeX fonts with Kashida feature.
- persian-hm-xs2-fontsAUR – A Persian font series derived from X Series 2 fonts with Kashida feature.
- gandom-fontsAUR, parastoo-fontsAUR, sahel-fontsAUR, samim-fontsAUR, shabnam-fontsAUR, tanha-fontsAUR, vazirmatn-fontsAUR, vazir-code-fontsAUR – Beautiful Persian fonts made by Saber RastiKerdar.
- ttf-yasAUR – The Yas Persian font series (with hollow zero).
- ttf-x2AUR – Free fonts with support for Persian, Arabic, Urdu, Pashto, Dari, Uzbek, Kurdish, Uighur, old Turkish (Ottoman) and modern Turkish (Roman).
壯侗語系[編輯 | 編輯原始碼]
- fonts-tlwgAUR – Collection of scalable Thai fonts
- ttf-laoAUR – Lao TTF font (Phetsarath_OT)
藏緬語族[編輯 | 編輯原始碼]
- ttf-tibetan-machine包 —— 藏文 (Tibetan) Machine TTFont
- ttf-sil-padaukAUR —— 支持多種使用緬文的語言的 Unicode 字體
Emoji 和符號[編輯 | 編輯原始碼]
Unicode 標準的一部分用於稱為「emoji」的象形字符。
Emoji 字體有不同的格式:CBDT/CBLC(Google)、SBIX(Apple)、COLR/CPAL(Microsoft)和 SVG(Mozilla/Adobe)。
只要安裝了一種支持 Emoji 的字體,它就應當開箱即用。根據標準,Emoji 字體的回退需要額外的代碼來處理。
有關 Emoji 的發現和輸入,參見 應用程序列表/工具#文字輸入。
軟件 | CBDT/CBLC | SBIX | COLR/CPAL | SVG | Emoji font fallback |
---|---|---|---|---|---|
Freetype | 是 | 是 | 是 | 否 | – |
Pango | Freetype | 是 | |||
WebKitGTK | Freetype | 是 | |||
Qt | Freetype | 否 [3] [4] [5] | |||
Chromium | Freetype | 是 | |||
Firefox | Freetype | 是 | 否,參閱 Firefox#字體問題以獲得解決方案。 |
CBDT/CBLC:
- noto-fonts-emoji包 —— Google 的開源 Emoji 14.0。
- ttf-joypixels包 —— EmojiOne 創作者的專有 Emoji 13.1。
- ttf-twemojiAUR —— Twitter 的開源 Emoji 13.0。
SVG:
- otf-openmojiAUR —— 施瓦本格明德德國設計大學的開源 Emoji 13.0。
- ttf-twemoji-colorAUR —— Twitter 的開源 Emoji 13.0。
僅輪廓字體:
- ttf-symbolaAUR —— 提供許多 Unicode 符號,包括 Emoji。
顏文字,有時被稱為「日式表情符號」,由來自各種字符集的字符組成,包括 CJK 和印度字符。下面的一組包涵蓋了大部分現有顏文字中所使用的字符:gnu-free-fonts包、ttf-arphic-uming包 和 ttf-indic-otf包。
數學[編輯 | 編輯原始碼]
- Computer Modern (ttf-cm-unicodeAUR, otf-cm-unicodeAUR)
- Computer Modern (otf-latin-modern包, otf-latinmodern-math包) – LaTeX 中使用的改進版本
- STIX fonts (otf-stixAUR) – Released under a royalty-free license and designed to be a math compansion of Times New Roman. The current version is called STIX Two Math.
- TeX Gyre math fonts (tex-gyre-math-fontsAUR) – Math compansions of TeX Gyre fonts (see #字體族). Notably, TeX Gyre Termes Math is a math compansion of Times New Roman.
- XITS fonts (otf-xitsAUR) – A fork of STIX and is therefore a math compansion of Times New Roman. XITS and STIX Two Math have similar levels of completeness for mathematical symbols and alphabets [7], but do have some visual differences.
此外,texlive-core包 和 texlive-fontsextra包 中包含許多數學字體,例如 Latin Modern Math 和 STIX 字體。有關配置參見 TeX Live#Making fonts available to Fontconfig。
其他操作系統字體[編輯 | 編輯原始碼]
- ttf-mac-fontsAUR - Apple MacOS TrueType 字體
後備字體順序[編輯 | 編輯原始碼]
Fontconfig 會自動選擇一個滿足當前顯示需求的字體。例如,如果瀏覽一個既有英文又有中文的窗口,而默認的字體不支持中文,它會自動用另外的字體顯示中文。
Fontconfig 允許每個用戶通過 $XDG_CONFIG_HOME/fontconfig/fonts.conf
調整字體的選擇順序。
如果要優先使用襯線字體,遇到中文再使用某個特定的中文字體,配置文件會是這樣:
<?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <fontconfig> <alias> <family>serif</family> <prefer> <family>喜欢的拉丁衬线字体名称</family> <family>中文字体名称</family> </prefer> </alias> </fontconfig>
- 如果系統的 locale 是中文,請將
LC_LANG
設置為und
,否則中英文都會使用中文字體渲染。 - 修改配置後可以用
fc-match -a monospace | head
檢查後備字體設置是否正確。
無襯線和等寬字體也可以增加一樣的設置,更多信息請參考 fontconfig 手冊。
另請參閱 字體配置#設置默認和後備字體。
字體別名[編輯 | 編輯原始碼]
有幾種字體別名實際上代表着別的字體,以讓應用程序可以使用類似的字體。最常見的別名是:serif
代表襯線字體(如 DejaVu Serif);sans-serif
代表無襯線字體(如 DejaVu Sans);以及 monospace
代表等寬字體(如 DejaVu Sans Mono)。然而,這些別名所代表的字體有可能會變化,但 KDE 和其他桌面環境的字體管理工具通常不會顯示對應關係。
如果想通過別名反向查找是展現了哪種字體,請運行:
$ fc-match monospace
DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"
在這種情況下 monospace 別名展現的是 DejaVuSansMono.ttf
字體。
提示與技巧[編輯 | 編輯原始碼]
列出所有已安裝的字體[編輯 | 編輯原始碼]
可以使用以下命令列出系統上所有已安裝且可用的 Fontconfig 字體。
$ fc-list
列出特定語言的已安裝字體[編輯 | 編輯原始碼]
應用程序和瀏覽器根據 fontconfig 首選項和 Unicode 文本的可用字體字形選擇和顯示字體。要列出特定語言的已安裝字體,請使用命令 fc-list :lang="雙字母語言代碼"
。例如,要列出已安裝的阿拉伯字體或支持阿拉伯字形的字體:
$ fc-list -f '%{file}\n' :lang=ar
/usr/share/fonts/TTF/FreeMono.ttf /usr/share/fonts/TTF/DejaVuSansCondensed.ttf /usr/share/fonts/truetype/custom/DroidKufi-Bold.ttf /usr/share/fonts/TTF/DejaVuSansMono.ttf /usr/share/fonts/TTF/FreeSerif.ttf
列出特定 Unicode 字符的已安裝字體[編輯 | 編輯原始碼]
要搜索支持特定 Unicode 碼點的等寬字體:
$ fc-match -s monospace:charset=1F4A9
Set terminal font on-the-fly[編輯 | 編輯原始碼]
For terminal emulators that use X resources, e.g. xterm or rxvt-unicode, fonts can be set by using escape sequences. Specifically, echo -e "\033]710;$font\007"
to change the normal font (*font
in ~/.Xresources
), and replace 710
with 711
, 712
, and 713
to change the *boldFont
, *italicFont
, and *boldItalicFont
, respectively.
$font
uses the same syntax as in ~/.Xresources
and can be anything the terminal emulator will support. (Example: xft:dejavu sans mono:size=9
)
應用程序專用的字體緩存[編輯 | 編輯原始碼]
Matplotlib (python-matplotlib包) 使用自己的字體緩存,因此更新字體後記得刪除 $HOME/.matplotlib/fontList.cache
,$HOME/.cache/matplotlib/fontList.cache
, $HOME/.sage/matplotlib-1.2.1/fontList.cache
等文件,這樣它才會重新生成緩存並找到新字體 [8]。
終端中的雙向文本[編輯 | 編輯原始碼]
要在終端中正確的顯示阿拉伯語和希伯來語,請運行 BiCon(bicon-gitAUR)。
參見[編輯 | 編輯原始碼]
- State of Text Rendering
- Font Library - Fonts under Free licenses
- Fonts on screenshots.debian.net