Difference between revisions of "Fonts (正體中文)"
m (→X11 的字型採用順序) |
|||
(27 intermediate revisions by 12 users not shown) | |||
Line 1: | Line 1: | ||
− | [[Category: | + | [[Category:正體中文]] |
− | [[Category: | + | [[Category:Fonts (正體中文)]] |
+ | [[Category:Graphics and desktop publishing (正體中文)]] | ||
+ | [[cs:Fonts]] | ||
+ | [[de:Schriftarten]] | ||
+ | [[en:Fonts]] | ||
+ | [[es:Fonts]] | ||
+ | [[it:Fonts]] | ||
+ | [[ja:Fonts]] | ||
+ | [[ru:Fonts]] | ||
+ | [[tr:Yazıtipleri]] | ||
+ | [[zh-CN:Fonts]] | ||
+ | {{Related articles start (正體中文)}} | ||
+ | {{Related2|Font Configuration|字型設定 (英)}} | ||
+ | {{Related2|Java Runtime Environment Fonts|Java 執行環境字型 (英)}} | ||
+ | {{Related2|MS Fonts|微軟字型 (英)}} | ||
+ | {{Related articles end}} | ||
+ | {{翻譯狀態|Fonts|2014-01-25|285531}} | ||
+ | 摘自[[Wikipedia:Computer font|維基百科]]: | ||
+ | :「'''電腦字型''' (computer font),或稱'''字型''' (font),是包含字 (glyph)、字元或符號 (如 dingbats) 的電子檔案資料。」 | ||
− | + | 注意,某些字型的授權有訂定合理使用限制。 | |
− | |||
− | |||
− | |||
− | |||
− | = | + | == 字型格式 == |
− | |||
− | + | 現今電腦所使用的字型中,絕大部分屬於'''點陣''' (bitmap) 或'''輪廓''' (outline)資料格式。 | |
− | + | ;點陣字型: 由點 (像素) 陣列構成的圖像,代表每種字樣、大小的字 (glyph)。 | |
+ | ;輪廓字型: 又稱作'''向量''' (vector) 字型。使用貝茲曲線 (Bézier curve)、繪圖指引和數學公式描繪每個字,產生的字元可以縮放至任意大小。 | ||
− | == | + | === 常見副檔名 === |
− | |||
− | + | * {{ic|bdf}}, {{ic|bdf.gz}} – 點陣字型,''b''itmap ''d''istribution ''f''ormat 的縮寫,以及用 gzip 壓縮的 {{ic|bdf}} | |
− | + | * {{ic|pcf}}, {{ic|pcf.gz}} – 點陣字型,''p''ortable ''c''ompiled ''f''ont 的縮寫,以及用 gzip 壓縮的 {{ic|pcf}} | |
+ | * {{ic|psf}}, {{ic|psfu}}, {{ic|psf.gz}}, {{ic|psfu.gz}} – 點陣字型,''P''C ''s''creen ''f''ont 與 ''P''C ''s''creen ''f''ont ''U''nicode 的縮寫,以及用 gzip 壓縮的版本 (跟 X.Org 不相容) | ||
+ | * {{ic|pfa}}, {{ic|pfb}} – 輪廓字型,''P''ostScript ''f''ont ''A''SCII 與 ''P''ostScript ''f''ont ''b''inary 的縮寫。PostScript 字型內建印表機指令。 | ||
+ | * {{ic|ttf}} – 輪廓字型,''T''rue''T''ype ''f''ont 的縮寫。原本設計為 PostScript 字型的替代品。 | ||
+ | * {{ic|otf}} – 輪廓字型,''O''pen''T''ype ''f''ont 的縮寫。TrueType 附帶 PostScript 排版指令。 | ||
− | + | TrueType 與 OpenType 的技術差異,在大部分的用途之下可被忽略。某些 OpenType 字型使用了 {{ic|ttf}} 副檔名。 | |
− | |||
− | = | + | === 其他格式 === |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | 排版程式 ''TeX'' 與字型軟體 ''Metafont'' 有它們自己算繪字元的方法。這兩個程式使用的字型副檔名有 {{ic|*pk}}, {{ic|*gf}}, {{ic|mf}} 和 {{ic|vf}}。 | |
− | |||
− | {{Wikipedia|Fonts}} | + | ''FontForge'' 字型編輯程式會將字型存為自己的文字檔格式 {{ic|sfd}},這是 ''s''pline ''f''ont ''d''atabase 的縮寫。 |
+ | |||
+ | [http://www.w3.org/TR/SVG/fonts.html SVG] 格式也有一套自己的字型描述方法。 | ||
+ | |||
+ | == 安裝 == | ||
+ | |||
+ | 安裝字型的方式有很多種。 | ||
+ | |||
+ | === Pacman === | ||
+ | |||
+ | 透過 [[pacman (正體中文)|pacman]] 可以安裝啟用軟體庫的字型。使用以下指令搜尋可供使用的字型: | ||
+ | $ pacman -Ss font | ||
+ | 或只搜尋 {{ic|ttf}} 字型: | ||
+ | $ pacman -Ss ttf | ||
+ | |||
+ | 某些字型,像是 {{pkg|terminus-font}},會安裝在 {{ic|/usr/share/fonts/local}},這個目錄預設沒有被加進字型路徑。將以下內容加入 {{ic|~/.xinitrc}},就可以在 X11 使用這類字型: | ||
+ | {{bc| | ||
+ | xset +fp /usr/share/fonts/local | ||
+ | xset fp rehash | ||
+ | }} | ||
+ | 如果執行第一行指令後出現以下錯誤 | ||
+ | {{bc| | ||
+ | $ xset +fp /usr/share/fonts/local/ | ||
+ | xset: bad font path element (#0), possible causes are: | ||
+ | Directory does not exist or has wrong permissions | ||
+ | Directory missing fonts.dir | ||
+ | Incorrect font server address or syntax | ||
+ | }} | ||
+ | 需要執行 | ||
+ | {{bc| | ||
+ | # cd /usr/share/fonts/local;mkfontdir | ||
+ | }} | ||
+ | |||
+ | === 建立軟體包 === | ||
+ | |||
+ | 您應該將管理字型的工作交給 pacman。字型可以打包成一份 Arch 軟體包,還可以透過 [[AUR]] 和社群分享。這裡有一個建立基本軟體包的範例。若想要更了解如何組建軟體包,請閱讀 [[PKGBUILD]]。 | ||
+ | |||
+ | {{bc|<nowiki> | ||
+ | pkgname=ttf-fontname | ||
+ | pkgver=1.0 | ||
+ | pkgrel=1 | ||
+ | pkgdesc="custom fonts" | ||
+ | arch=('any') | ||
+ | depends=('fontconfig' 'xorg-font-utils') | ||
+ | source=("http://someurl.org/$pkgname.tar.bz2") | ||
+ | install=$pkgname.install | ||
+ | |||
+ | package() { | ||
+ | install -d "$pkgdir/usr/share/fonts/TTF" | ||
+ | cp -dpr --no-preserve=ownership "$srcdir/$pkgname/"*.ttf "$pkgdir/usr/share/fonts/TTF/" | ||
+ | } | ||
+ | </nowiki>}} | ||
+ | |||
+ | 這份 PKGBUILD 假定字型為 TrueType 類型。之後還必須建立一份安裝檔案 ({{ic|ttf-fontname.install}}) 更新字型快取: | ||
+ | |||
+ | {{bc|<nowiki> | ||
+ | post_install() { | ||
+ | echo -n "Updating font cache... " | ||
+ | fc-cache -fs >/dev/null | ||
+ | mkfontscale /usr/share/fonts/TTF /usr/share/fonts/Type1 | ||
+ | mkfontdir /usr/share/fonts/TTF /usr/share/fonts/Type1 | ||
+ | echo "done" | ||
+ | } | ||
+ | |||
+ | post_upgrade() { | ||
+ | post_install | ||
+ | } | ||
+ | |||
+ | post_remove() { | ||
+ | post_install | ||
+ | } | ||
+ | </nowiki>}} | ||
+ | |||
+ | 若需要更方便的 ttf 字型建立方式,可以使用 [[AUR]] 提供的 {{AUR|makefontpkg}}。 | ||
+ | |||
+ | === 手動安裝 === | ||
+ | |||
+ | 要為系統新增一個軟體庫未收錄的字型,建議方法是[[#建立軟體包]]。採用這個方式讓 pacman 之後能夠移除或升級字型。不過您也可以用手動的方式安裝字型。 | ||
+ | |||
+ | 若要將字型安裝到系統 (讓所有使用者都能使用),將字型資料夾移至 {{ic|/usr/share/fonts/}} 目錄。如果只要為單一使用者安裝字型,則改移至 {{ic|~/.fonts/}} 目錄。 | ||
+ | |||
+ | 要讓 X 伺服器可以直接載入字型 (不使用「字型伺服器」),需要將新增字型的所在目錄加為 FontPath 項目。這個項目位在[[Xorg#Configuration|您的 Xorg 設定檔案]] (例如 {{ic|/etc/X11/xorg.conf}} 或 {{ic|/etc/xorg.conf}}) 的 ''Files'' 區。更多詳細資訊請參閱[[#讓字型搭配 X.Org]]。 | ||
+ | |||
+ | 接著更新 fontconfig 字型快取: | ||
+ | |||
+ | $ fc-cache -vf | ||
+ | |||
+ | === 手動安裝:進階方式 === | ||
+ | |||
+ | 如果您有特殊的字型收集需求:使用商業字型、使用不同格式的字型、安裝/移除字型檔相當頻繁,或只是希望可以更能夠控制存取自己的字型資源,那就相當適合用手動的方式來安裝維護字型。採用這種方案會獲得很多好處: | ||
+ | |||
+ | * 避免重複安裝不同版本、格式的同一種字型家族 (一個常見原因是算繪問題)。 | ||
+ | * 字型可使用多個非標準的實體來源 (例如額外的硬碟、分割區)。 | ||
+ | * 避免依賴隱晦又佔體積的本地字型來源 (例如 TeX Live & {{ic|09-texlive-fonts.conf}},或是從 AUR 抓下來的某個字型集合);您可能只需要其中 5 種字型,卻連帶安裝其它 55 種不需要的字型。 | ||
+ | * 避免字型算繪問題,因為您的 fontconfig 設定檔已被調成和與安裝在系統的那份不同的格式。 | ||
+ | * 只要觀察主字型目錄下的內容,就能夠確定系統上有哪種格式的字型家族可供應用程式使用。您不需要複雜、佔用大量資源的字型管理程式;{{Pkg|gtk2fontsel}} 和基本的指令工具 (如 {{Pkg|fontconfig}} 軟體包下的 {{ic|fc-query}}) 就可以將這件差事辦得又快又好。 | ||
+ | * 當您安裝或升級單一字型,所有應用程式都可以使用該版本,包含 LaTeX 相關軟體。 | ||
+ | * 有必要的話,可以快速啟用 / 停用某個字型家族,因為您知道它們在哪個目錄下 (除錯時很好用)。 | ||
+ | * 不需擔心有任何多餘的 {{ic|/etc/fonts/conf.avail/nn-foo.conf}} fontconfig 檔案會潛在跟您的算繪設定起衝突 (特別是當您使用[[Font_Configuration#Patched_packages|自訂的字型設定與修補過的函式庫]])。 | ||
+ | * 長遠來看,可以省下那些因軟體包管理者的失誤,解決問題和清除衝突所浪費的寶貴時間。 | ||
+ | |||
+ | 實作上有幾種方式,有必要的話可由任何軟體包管理員採用。以下所舉出的實作方式相當有效率,即使字型數目眾多也相當安全。 | ||
+ | |||
+ | * 我們要將字型來源位置 (例如 {{ic|/usr/share/fonts.avail}}:這是我們要存放字型的位置) 和包含字型家族軟連結的目錄 ({{ic|/usr/share/fonts}}) 給分隔開來。 | ||
+ | |||
+ | * 將每個字型家族分別放在一個明確命名的子目錄下。命名規則必須一致且明確,例如這樣: | ||
+ | |||
+ | {{bc|<nowiki> | ||
+ | <ttf|otf|t1>-<字型作者或組織(選用)>-<字型家族名稱> | ||
+ | </nowiki>}} | ||
+ | |||
+ | 字型來源目錄的內容會長得像這樣: | ||
+ | |||
+ | {{bc|<nowiki> | ||
+ | $ ls /usr/share/fonts.avail | ||
+ | |||
+ | /usr/share/fonts.avail/otf-heuristica | ||
+ | /usr/share/fonts.avail/ttf-liberation | ||
+ | /usr/share/fonts.avail/ttf-ms-arial | ||
+ | ... | ||
+ | </nowiki>}} | ||
+ | |||
+ | * 我們不會動到 TeX Live 的字型目錄,以避免 LaTeX 軟體發生任何問題。既然我們可以使用多個位置,我們將在 {{ic|/usr/share/fonts}} 建立軟連結,讓應用程式可以存取特定的字型家族: | ||
+ | |||
+ | {{bc|<nowiki> | ||
+ | # cd /usr/share/fonts | ||
+ | # ln -s ../fonts.avail/otf-heuristica . | ||
+ | # ln -s /opt/texlive/texmf-dist/fonts/truetype/public/opensans ttf-texlive-open.sans | ||
+ | </nowiki>}} | ||
+ | |||
+ | 結果如下: | ||
+ | |||
+ | {{bc|<nowiki> | ||
+ | $ ls /usr/share/fonts | ||
+ | |||
+ | ttf-liberation -> ..fonts.avail/ttf-liberation | ||
+ | ttf-ms-arial -> ..fonts.avail/ttf-ms-arial | ||
+ | otf-heuristica -> ..fonts.avail/otf-heuristica | ||
+ | otf-texlive-tex.gyre -> /opt/texlive/texmf-dist/fonts/opentype/public/tex-gyre | ||
+ | ttf-texlive-open.sans -> /opt/texlive/texmf-dist/fonts/truetype/public/opensans | ||
+ | ... | ||
+ | </nowiki>}} | ||
+ | |||
+ | 最後,依照慣例執行: | ||
+ | |||
+ | {{bc|<nowiki> | ||
+ | # fc-cache && mkfontscale && mkfontdir | ||
+ | </nowiki>}} | ||
+ | |||
+ | [[TeX_Live|TeX Live]] Wiki 文章內也有一個類似做法,比較簡單,但較適用於單一使用者的情境,而非全域設定。 | ||
+ | |||
+ | === 舊版應用程式 === | ||
+ | |||
+ | 對於不支援 fontconfig 的舊版應用程式 (例如 GTK+ 1.x 應用程式和 {{ic|xfontsel}}),必須在字型目錄下建立索引: | ||
+ | |||
+ | $ mkfontscale | ||
+ | $ mkfontdir | ||
+ | |||
+ | 或者,用一行指令將多個資料夾包含進來: | ||
+ | |||
+ | $ for dir in /font/dir1/ /font/dir2/; do xset +fp $dir; done && xset fp rehash | ||
+ | |||
+ | 有時候 X 伺服器會無法成功載入字型資料夾,這時您需要重新掃描所有 {{ic|fonts.dir}} 檔案: | ||
+ | |||
+ | # xset +fp /usr/share/fonts/misc # 告知 X 伺服器新的目錄 | ||
+ | # xset fp rehash # 強制進行新的掃描 | ||
+ | |||
+ | 檢查字型是否被包含進來: | ||
+ | |||
+ | $ xlsfonts | grep fontname | ||
+ | |||
+ | === Pango 警告訊息 === | ||
+ | 若您的系統有在使用 [http://www.pango.org/ Pango],它會從 [http://www.freedesktop.org/wiki/Software/fontconfig 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' | ||
+ | |||
+ | 如果您看到與上面類似的錯誤,或者應用程式內的字元變成了方框,您需要新增字型並更新字型快取。這個範例使用 {{Pkg|ttf-liberation}} 字型演示,並以 root 執行以套用至全系統。 | ||
+ | |||
+ | # pacman -S ttf-liberation | ||
+ | -- 略過部分輸出,假設安裝已經成功 -- | ||
+ | |||
+ | # fc-cache -vfs | ||
+ | /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" | ||
+ | |||
+ | === 讓字型搭配 X.Org === | ||
+ | |||
+ | 為了讓 [[Xorg]] 可以找到並使用您新安裝的字型,必須將字型路徑加入 {{ic|/etc/X11/xorg.conf}} (另一個 X.Org 設定檔也可以)。 | ||
+ | |||
+ | 這是必須加入 {{ic|/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/local" | ||
+ | FontPath "/usr/share/fonts/misc" | ||
+ | FontPath "/usr/share/fonts/truetype" | ||
+ | FontPath "/usr/share/fonts/TTF" | ||
+ | FontPath "/usr/share/fonts/util" | ||
+ | EndSection | ||
+ | |||
+ | == 終端機字型 == | ||
+ | |||
+ | [[Wikipedia:Virtual console|虛擬終端機]]使用核心內建字型,預設顯示 ASCII 字元,這兩種設定都可以輕易改變。 | ||
+ | |||
+ | 終端機字型限定為 256 或 512 個字元。可供使用的字型存放在 {{ic|/usr/share/kbd/consolefonts/}} 目錄。 | ||
+ | |||
+ | 鍵盤映射 (Keymap) 是按鍵和電腦使用字元的對應關係表,可以在 {{ic|/usr/share/kbd/keymaps/}} 的子目錄下找到。 | ||
+ | |||
+ | === 預覽和測試 === | ||
+ | |||
+ | {{提示|一個整理過的預覽影像資料庫:[http://alexandre.deverteuil.net/consolefonts/consolefonts.html Linux 終端機字型截圖]。}} | ||
+ | |||
+ | ''showconsolefont'' 指令會以表格形式顯示可用字與字元: | ||
+ | |||
+ | $ showconsolefont | ||
+ | |||
+ | ''setfont'' 工具可以暫時改變字型,讓使用者可以決定是否要採為預設值。只要指定字型名稱即可 (這些字型位於 {{ic|/usr/share/kbd/consolefonts/}}): | ||
+ | |||
+ | $ setfont Lat2-Terminus16 | ||
+ | |||
+ | 您可以用 {{ic|-m}} 選項指定使用什麼字元集: | ||
+ | |||
+ | $ setfont Lat2-Terminus16 -m 8859-2 | ||
+ | |||
+ | 如果對新換的字型不滿意,用以下指令可以還原至預設字型 (就算終端機顯示亂碼,這個指令依然可以執行 -- 將指令「盲打」進去即可): | ||
+ | |||
+ | $ setfont | ||
+ | |||
+ | {{註記|''setfont'' 只作用於目前正在使用的終端機。其它終端機無論活躍與否都不受影響。}} | ||
+ | |||
+ | === 更改預設字型 === | ||
+ | |||
+ | {{ic|/etc/vconsole.conf}} 的 {{ic|FONT}} 和 {{ic|FONT_MAP}} 變數可用來改變預設字型。 | ||
+ | |||
+ | 若要顯示 ''Č, ž, đ, š'' 或 ''Ł, ę, ą, ś'' 之類的字元,使用 {{ic|lat2-16.psfu.gz}} 這個字型: | ||
+ | |||
+ | FONT=lat2-16 | ||
+ | |||
+ | 這代表使用 ISO/IEC 8859 字元的第二部分,大小設定為 16。您可以使用其它值更改字型大小 (如 {{ic|lat2-08}})。您可以在[[wikipedia:ISO/IEC_8859#The_Parts_of_ISO.2FIEC_8859|維基百科的這張表]]查詢 8859 規格定義的區域。如果您經常在沒有 X 伺服器的終端機上工作,建議可以使用一種 Terminus 字型。比如說 ter-216b,代表包含 latin-2 部分,大小 16,粗體字。ter-216n 是正常磅數的版本。Terminus 字型大小最大可以到 32。 | ||
+ | |||
+ | 現在設定適當的字型映射,若使用 lat2-16 則會是: | ||
+ | |||
+ | FONT_MAP=8859-2 | ||
+ | |||
+ | 若要為早期的使用者空間套用指定字型,在 {{ic|/etc/mkinitcpio.conf}} 使用 {{ic|keymap}} 勾子。更多資訊請參閱 [[Mkinitcpio#HOOKS]]。 | ||
+ | |||
+ | 如果開機時字型沒有任何變化,或只變化一下就回復原樣,則有可能是因為圖形驅動啟動時字型被重設,然後終端機被切至幀緩衝 (framebuffer)。提早載入圖形驅動可以避免這個問題。若要在套用 {{ic|/etc/vconsole.conf}} 之前將幀緩衝準備好,請參閱[[Kernel Mode Setting#Early KMS start|核心模式設定#提早啟動 KMS]]、[https://bbs.archlinux.org/viewtopic.php?id=145765] 或其它方式。 | ||
+ | |||
+ | == 字型軟體包 == | ||
+ | 以下是收錄於官方軟體庫和 [[AUR]] 的字型軟體包列表,種類繁多,可依照需求選用。若字型有廣泛的萬國碼 (Unicode) 支援,會加註 "Unicode" 標記,詳情請參閱字型專案或相關的維基百科頁面。 | ||
+ | |||
+ | 一位 Github 使用者 Ternstor 用 python 腳本產生 [http://ternstor.github.com/archfonts/extra.html extra], [http://ternstor.github.com/archfonts/community.html community] 和 [http://ternstor.github.com/archfonts/aur.html AUR] 庫內字型的 PNG 圖像,您可以在那裡預覽以下所提到的字型。 | ||
+ | |||
+ | === 盲文點字 === | ||
+ | *{{Pkg|ttf-ubraille}} - 包含 Unicode '''盲文點字'''符號的字型 | ||
+ | |||
+ | === 國際 (非英語系) 使用者 === | ||
+ | 應用程式與瀏覽器會根據 fontconfig 設定和 Unicode 文字可用的字型來選擇其顯示字型。用指令 {{ic|<nowiki>fc-list :lang="雙字母的語言代碼"</nowiki>}} 列舉系統安裝了哪些可對應該語言的字型。例如,列舉已經安裝的阿拉伯文字型,以及支援阿拉伯字的字型: | ||
+ | {{hc|$ fc-list :lang=ar | cut -d: -f1|2= | ||
+ | <nowiki> | ||
+ | /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 | ||
+ | </nowiki> | ||
+ | }} | ||
+ | |||
+ | 若要在多國語言的網站 (如維基百科、Arch Linux wiki) 正確描繪字形,安裝這些軟體包:{{Pkg|ttf-freefont}}, {{Pkg|ttf-arphic-uming}}, {{Pkg|ttf-baekmuk}} | ||
+ | |||
+ | ==== 阿拉伯和烏爾都文字 ==== | ||
+ | *{{AUR|ttf-qurancomplex-fonts}} - 位於麥地那的 King Fahd Glorious Quran Printing Complex 製作的字型 ''(AUR)'' | ||
+ | *{{AUR|ttf-amiri}} - 一個典型的阿拉伯文謄抄體 (Naskh) 字型,一開始由 Amiria Press 採用 ''(AUR)'' | ||
+ | *{{AUR|ttf-sil-lateef}} - 來自 SIL 的 Unicode 阿拉伯文字型 ''(AUR)'' | ||
+ | *{{AUR|ttf-sil-scheherazade}} - 來自 SIL 的 Unicode 阿拉伯文字型 ''(AUR)'' | ||
+ | *{{AUR|ttf-arabeyes-fonts}} - 自由的阿拉伯文字型集合 ''(AUR)'' | ||
+ | |||
+ | ==== 緬甸文字 ==== | ||
+ | *{{AUR|ttf-myanmar3}} - 緬甸手寫體字型 ''(AUR)'' | ||
+ | |||
+ | ==== 中日韓越文字 ==== | ||
+ | |||
+ | ===== 中文字 ===== | ||
+ | *{{AUR|ttf-tw}} - 台灣 (中華民國) 教育部標準楷書、宋體字型 ''(AUR)''。 | ||
+ | *{{AUR|cwttf-baseline}}、{{AUR|cwttf-center}} - cwTeX 排版系統使用的字型集 (仿宋、粗黑、楷書、明體、圓體)。這兩個軟體包有標點符號位置的區別。 | ||
+ | *{{AUR|cwtex-q-fonts}} - cwTeX 字型集的一些修正 (仍在開發狀態) | ||
+ | *{{Pkg|wqy-microhei}} - 無襯線形式的高品質中日韓越 (CJKV) 輪廓字型。 | ||
+ | *{{Pkg|wqy-zenhei}} - 黑體 (無襯線) 的中文輪廓字型,附帶點陣宋體 (也支援部分日韓字元)。 | ||
+ | *{{Pkg|ttf-arphic-ukai}} - '''楷書''' (帶有筆觸) Unicode 字型 (建議啟用反鋸齒) | ||
+ | *{{Pkg|ttf-arphic-uming}} - '''明體''' (印刷) Unicode 字型 | ||
+ | *{{Pkg|opendesktop-fonts}} - '''新宋'''字型,之前為 ttf-fireflysung | ||
+ | *{{Pkg|wqy-bitmapfont}} - 點陣宋體 (襯線) 中文字型 | ||
+ | *{{Pkg|ttf-hannom}} - 中文、越南文 TrueType 字型 | ||
+ | |||
+ | ===== 日文字 ===== | ||
+ | *{{Pkg|otf-ipafont}} - 正規的日文哥特體 (無襯線) 與明朝體 (襯線) 字形集;其中一項高品質的開放原始碼字形。openSUSE-ja 的預設字形。 | ||
+ | *{{AUR|ttf-vlgothic}} - 日文哥特體字形。Debian/Fedora/Vine Linux 的預設字型 ''(AUR)'' | ||
+ | *{{AUR|ttf-mplus}} - 現代哥特體的日文輪廓字型。包含所有日文平假名/片假名、Basic Latin、Latin-1 Supplement、Latin Extended-A、IPA Extensions。另外還有大部分日文漢字、希臘字母、西里爾字與越南文字,可以 7 磅 (等比例) 或 5 磅 (等寬) 字重顯示。 ''(AUR)'' | ||
+ | *{{AUR|ttf-ipa-mona}}, {{AUR|ttf-monapo}} - 日文字型,可正確顯示 [[wikipedia:2channel_Shift_JIS_art|2ch 的 Shift JIS 藝術創作]]。 ''(AUR)'' | ||
+ | *{{Pkg|ttf-sazanami}} - 自由的日文 TrueType 字型。已經過期無人維護,但在某些環境下可當作備案字型使用。 | ||
+ | |||
+ | ===== 韓文字 ===== | ||
+ | *{{Pkg|ttf-baekmuk}} - 韓文 TrueType 字型集合 | ||
+ | *{{AUR|ttf-alee}} - 自由的韓文 (諺文;Hangul) TrueType 字型 (''AUR'') | ||
+ | *{{AUR|ttf-unfonts-core}} - Un 字型 (預設的 Baekmuk 字型較讓人不滿意) (''AUR'') | ||
+ | *{{AUR|ttf-nanum}} - 共享體 (Nanum) 系列 TrueType 字型 (''AUR'') | ||
+ | *{{AUR|ttf-nanumgothic_coding}} - 共享體 (Nanum) 系列 TrueType 等寬字型 (''AUR'') | ||
+ | |||
+ | ==== 西里爾文字 ==== | ||
+ | 另請參閱[[#等寬字型]]、[[#無襯線字型]]和[[#襯線字型]] | ||
+ | *{{AUR|font-arhangai}} - 蒙古文西里爾字 (''AUR'') | ||
+ | *{{AUR|ttf-pingwi-typography}} - PingWi Typography (PWT) 字型 (''AUR'') | ||
+ | |||
+ | ==== 希臘文字 ==== | ||
+ | 幾乎所有 Unicode 字型都包含希臘字元集 (也包含多調變音符號)。某些額外的字型軟體包未包含完整的 Unicode 集,但擁有高品質的希臘字字形 (當然包含拉丁字): | ||
+ | *{{AUR|otf-gfs}} - 由 Greek Font Society 選用的 OpenType 字型 ''(AUR)'' | ||
+ | *{{AUR|ttf-mgopen}} - 來自 Magenta 的專業 TrueType 字型 ''(AUR)'' | ||
+ | |||
+ | ==== 希伯來文字 ==== | ||
+ | *{{AUR|culmus}} - 自由的希伯來文字型集合 ''(AUR)'' | ||
+ | |||
+ | ==== 印地文字 ==== | ||
+ | *{{Pkg|ttf-freebanglafont}} - 孟加拉文字型 | ||
+ | *{{Pkg|ttf-indic-otf}} - 印地文 OpenType 字型集合 (包含 ttf-freebanglafont) | ||
+ | :(This one contains a "look of disapproval" that might be more to your liking than the {{Pkg|bdf-unifont}} one mentioned elsewhere in this document) | ||
+ | * {{AUR|lohit-fonts}} - 來自 Fedora 專案的印地文 TrueType 字型 (包含 Oriya 字型以及更多) ''(AUR)'' | ||
+ | |||
+ | ==== 高棉文字 ==== | ||
+ | *{{Pkg|ttf-khmer}} - 涵蓋高棉語 (Khmer) 文字的字型 | ||
+ | *[http://code.google.com/webfonts/family?family=Hanuman&subset=khmer Hanuman] ({{AUR|ttf-google-fonts-hg}} 或 {{AUR|ttf-google-fonts-git}}) | ||
+ | |||
+ | ==== 僧伽羅文字 ==== | ||
+ | *{{AUR|ttf-lklug}} - 僧伽羅文 (Sinhala) Unicode 字型 (''AUR'') | ||
+ | |||
+ | ==== 塔米爾文字 ==== | ||
+ | *{{AUR|ttf-tamil}} - 塔米爾文 (Tamil) Unicode 字型 (''AUR'') | ||
+ | |||
+ | ==== 藏文字 ==== | ||
+ | *{{Pkg|ttf-tibetan-machine}} - 藏文 (Tibetan) Machine TTFont | ||
+ | |||
+ | === 數學字型 === | ||
+ | *{{Pkg|font-mathematica}} - Wolfram 公司的 Mathematica 字型 | ||
+ | *{{AUR|ttf-mathtype}} - MathType 字型 ''(AUR)'' | ||
+ | *{{AUR|ttf-computer-modern-fonts}} - ''(AUR)'' | ||
+ | |||
+ | === Microsoft 字型 === | ||
+ | 參閱[[MS Fonts|微軟字型]]。 | ||
+ | |||
+ | === Apple Mac OS X 字型 === | ||
+ | |||
+ | * {{AUR|ttf-mac-fonts}} - Mac OS X TrueType 字型 | ||
+ | * {{AUR|ttf-mac}} - Mac OS X TrueType 字型。這個軟體包沒有內含 ttf 字型 (只有 otf 字型),使用者必須自備這些字型。 | ||
+ | |||
+ | === 等寬字型 === | ||
+ | 有一些建議要給各位。每個使用者所偏好的字型不同,因此要找到您心目中的理想字型,就請多加嘗試。 | ||
+ | 如果您沒有太多時間,可以閱讀 Dan Benjamin 的部落格文章:[http://hivelogic.com/articles/top-10-programming-fonts ''Top 10 Programming Fonts''] (前十名適合寫程式的字型)。 | ||
+ | |||
+ | 這裡有 Trevor Lowing 整理的一長串字型清單:http://www.lowing.org/fonts/ 。 | ||
+ | |||
+ | ==== TrueType 字型 ==== | ||
+ | * Agave ({{AUR|ttf-agave}}) | ||
+ | * [[Wikipedia:Andalé Mono|Andalé Mono]] ({{AUR|ttf-ms-fonts}}) | ||
+ | * Anka/Coder ({{AUR|ttf-anka-coder}}) | ||
+ | * [http://www.marksimonson.com/fonts/view/anonymous-pro Anonymous Pro] ({{AUR|ttf-anonymous-pro}},也包含在 {{AUR|ttf-google-fonts-hg}} 和 {{AUR|ttf-google-fonts-git}}) | ||
+ | * [[Wikipedia:Bitstream Vera|Bitstream Vera Mono]] ({{Pkg|ttf-bitstream-vera}}) | ||
+ | * [[Wikipedia:Consolas|Consolas]] ({{AUR|ttf-vista-fonts}}) - Windows 下的編程用字型 | ||
+ | * [[Wikipedia:Courier New|Courier New]] ({{AUR|ttf-ms-fonts}}) | ||
+ | * Cousine ({{AUR|ttf-google-fonts-hg}} 或 {{AUR|ttf-google-fonts-git}}) - Chrome/Chromium OS 的 Courier New 替代 (metric-compatible) | ||
+ | * [[Wikipedia:DejaVu fonts|DejaVu Sans Mono]] ({{Pkg|ttf-dejavu}}) - Unicode | ||
+ | * [[Wikipedia:Droid (font)|Droid Sans Mono]] ({{Pkg|ttf-droid}},也包含在 {{AUR|ttf-google-fonts-hg}} 和 {{AUR|ttf-google-fonts-git}}) | ||
+ | * Envy Code R ({{AUR|ttf-envy-code-r}}) | ||
+ | * [[Wikipedia:GNU FreeFont|FreeMono]] ({{Pkg|ttf-freefont}}) - Unicode | ||
+ | * [[Wikipedia:Inconsolata|Inconsolata]] ({{Pkg|ttf-inconsolata}}) - 極佳的編程用字型 | ||
+ | * [[Wikipedia:Inconsolata|Inconsolata-g]] ({{AUR|ttf-inconsolata-g}}) - 加入一些親近編程人員的調整 | ||
+ | * [[Wikipedia:Liberation fonts|Liberation Mono]] ({{Pkg|ttf-liberation}}) - 可代替 Courier New (metric-compatible) | ||
+ | * [[Wikipedia:Lucida Console|Lucida Console]] ({{AUR|ttf-ms-fonts}}) | ||
+ | * [[Wikipedia:Lucida Typewriter|Lucida Typewriter]] (包含於 {{Pkg|jre}} 軟體包) | ||
+ | * [[Wikipedia:Monaco (typeface)|Monaco]] ({{AUR|ttf-monaco}}) - OSX/Textmate 下知名的編程用字型 | ||
+ | * Monofur ({{AUR|ttf-monofur}}) | ||
+ | |||
+ | ==== 點陣字型 ==== | ||
+ | *Default 8x16 | ||
+ | *Dina ({{Pkg|dina-font}}) | ||
+ | *[http://font.gohu.org/ Gohu] ({{AUR|gohufont}}) | ||
+ | *Lime ({{Pkg|artwiz-fonts}}) | ||
+ | *[[Wikipedia:ProFont|ProFont]] ({{Pkg|profont}}) | ||
+ | *[[Wikipedia:Proggy Programming Fonts|Proggy Programming Fonts]] ({{AUR|proggyfonts}}) | ||
+ | *Proggy opti cyrillic ({{AUR|proggyopticyr-font}}) | ||
+ | *Tamsyn ({{Pkg|tamsyn-font}}) | ||
+ | *[[Wikipedia:Terminus (typeface)|Terminus]] ({{Pkg|terminus-font}}) | ||
+ | *Unifont (glyphs like (look of disapproval)) ({{Pkg|bdf-unifont}}) | ||
+ | |||
+ | === 無襯線字型 === | ||
+ | |||
+ | *[http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=andika Andika] ({{AUR|ttf-andika}},包含於 {{AUR|ttf-sil-fonts}}) | ||
+ | *[[Wikipedia:Arial|Arial]] ({{AUR|ttf-ms-fonts}}) | ||
+ | *[[Wikipedia:Arial Black|Arial Black]] ({{AUR|ttf-ms-fonts}}) | ||
+ | *Arimo ({{AUR|ttf-google-fonts-hg}} 或 {{AUR|ttf-google-fonts-git}}) - Chrome/Chromium OS 的 Arial 替代 (metric-compatible) | ||
+ | *[[Wikipedia:Calibri|Calibri]] ({{AUR|ttf-vista-fonts}}) | ||
+ | *[[Wikipedia:Candara|Candara]] ({{AUR|ttf-vista-fonts}}) | ||
+ | *[[Wikipedia:Constantia (typeface)|Constantia]] ({{AUR|ttf-vista-fonts}}) | ||
+ | *[[Wikipedia:Corbel (typeface)|Corbel]] ({{AUR|ttf-vista-fonts}}) | ||
+ | *[[Wikipedia:DejaVu fonts|DejaVu Sans]] ({{Pkg|ttf-dejavu}}) - Unicode | ||
+ | *[[Wikipedia:Droid (font)|Droid Sans]] ({{Pkg|ttf-droid}},包含於 {{AUR|ttf-google-fonts-hg}} 和 {{AUR|ttf-google-fonts-git}}) | ||
+ | *[[Wikipedia:GNU FreeFont|FreeSans]] ({{Pkg|ttf-freefont}}) - Unicode | ||
+ | *[[Wikipedia:Impact (typeface)|Impact]] ({{AUR|ttf-ms-fonts}}) | ||
+ | *[[Wikipedia:Liberation fonts|Liberation Sans]] ({{Pkg|ttf-liberation}},品質提升的西里爾字:{{AUR|ttf-liberastika}}) - 可替代 Arial (metric-compatible) | ||
+ | *[[Wikipedia:Linux Libertine|Linux Biolinum]] ({{Pkg|ttf-linux-libertine}}) | ||
+ | *[[Wikipedia:Lucida Sans|Lucida Sans]] ({{AUR|ttf-ms-fonts}}) | ||
+ | *[[Wikipedia:Microsoft Sans Serif|Microsoft Sans Serif]] ({{AUR|ttf-ms-fonts}}) | ||
+ | *[[Wikipedia:PT Sans|PT Sans]] ({{AUR|ttf-google-fonts-hg}} 或 {{AUR|ttf-google-fonts-git}}) - 3 種主要變體:正常、變窄與標題 - Unicode:拉丁字、西里爾字 | ||
+ | *[[Wikipedia:Tahoma (typeface)|Tahoma]] ({{AUR|ttf-tahoma}}) | ||
+ | *[[Wikipedia:Trebuchet MS|Trebuchet]] ({{AUR|ttf-ms-fonts}}) | ||
+ | *[[Wikipedia:Ubuntu-Title|Ubuntu-Title]] ({{AUR|ttf-ubuntu-title}}) | ||
+ | *[[Wikipedia:Ubuntu Font Family|Ubuntu Font Family]] ({{Pkg|ttf-ubuntu-font-family}}) | ||
+ | *[[Wikipedia:Verdana|Verdana]] ({{AUR|ttf-ms-fonts}}) | ||
+ | |||
+ | === 手寫體 === | ||
+ | |||
+ | *[[Wikipedia:Comic Sans|Comic Sans]] ({{AUR|ttf-ms-fonts}}) | ||
+ | |||
+ | === 襯線字型 === | ||
+ | *[[Wikipedia:Cambria (typeface)|Cambria]] ({{AUR|ttf-vista-fonts}}) | ||
+ | *[[Wikipedia:Charis SIL|Charis]] ({{AUR|ttf-charis}},包含於 {{AUR|ttf-sil-fonts}}) - Unicode:拉丁字、西里爾字 | ||
+ | *[[Wikipedia:DejaVu fonts|DejaVu Serif]] ({{Pkg|ttf-dejavu}}) - Unicode | ||
+ | *[[Wikipedia:Doulos SIL|Doulos]] ({{AUR|doulos-sil}},包含於 {{AUR|ttf-sil-fonts}}) - Unicode:拉丁字、西里爾字 | ||
+ | *[[Wikipedia:Droid (font)|Droid Serif]] ({{Pkg|ttf-droid}},包含於 {{AUR|ttf-google-fonts-hg}} 和 {{AUR|ttf-google-fonts-git}}) | ||
+ | *[[Wikipedia:GNU FreeFont|FreeSerif]] ({{Pkg|ttf-freefont}}) - Unicode | ||
+ | *[[Wikipedia:Gentium|Gentium]] ({{Pkg|ttf-gentium}},包含於 {{AUR|ttf-sil-fonts}}) - Unicode:拉丁字、希臘字、西里爾字、音標字母 | ||
+ | *[[Wikipedia:Georgia (typeface)|Georgia]] ({{AUR|ttf-ms-fonts}}) | ||
+ | *[[Wikipedia:Liberation fonts|Liberation Serif]] ({{Pkg|ttf-liberation}}) - Times New Roman 替代 (metric-compatible) | ||
+ | *[[Wikipedia:Linux Libertine|Linux Libertine]] ({{Pkg|ttf-linux-libertine}}) - Unicode:拉丁字、希臘字、西里爾字、希伯來字 | ||
+ | *[[Wikipedia:Times New Roman|Times New Roman]] ({{AUR|ttf-ms-fonts}}) | ||
+ | *Tinos ({{AUR|ttf-google-fonts-hg}} 或 {{AUR|ttf-google-fonts-git}}) - Chrome/Chromium OS 的 Times New Roman 替代 (metric-compatible) | ||
+ | |||
+ | === 未分類字型 === | ||
+ | <!--This section should be absorbed into the Monospace/Serif/Sans-Serif structure--> | ||
+ | *{{AUR|ttf-google-fonts-git}} and {{AUR|ttf-google-fonts-hg}} — a huge collection of free fonts (including ubuntu, inconsolata, droid, etc.) - Note: Your font dialog might get very long as >100 fonts will be added. {{AUR|ttf-google-fonts-hg}} pulls down the entire Mercurial repository from the upstream Web Fonts project. {{AUR|ttf-google-fonts-git}} pulls from a much smaller and leaner unofficial repository hosted on GitHub. ''(AUR)'' | ||
+ | *{{Pkg|ttf-mph-2b-damase}} — Covers full plane 1 and several scripts | ||
+ | *{{Pkg|ttf-symbola}} — Provides emoji and many many other symbols | ||
+ | *{{AUR|ttf-sil-fonts}} — Gentium, Charis, Doulos, Andika and Abyssinica from SIL ''(AUR)'' | ||
+ | *{{Pkg|font-bh-ttf}} — X.Org Luxi fonts | ||
+ | *{{Pkg|ttf-cheapskate}} — Font collection from ''dustismo.com'' | ||
+ | *{{AUR|ttf-isabella}} — Calligraphic font based on the ''Isabella Breviary'' of 1497 | ||
+ | *{{Pkg|ttf-junicode}} — Junius font containing almost complete medieval latin script glyphs | ||
+ | *arkpandorafonts {{AUR|ttf-arkpandora}} — Alternative to Arial and Times New Roman fonts ''(AUR)'' | ||
+ | *{{Pkg|xorg-fonts-type1}} — IBM Courier and Adobe Utopia sets of [[Wikipedia:PostScript fonts|PostScript fonts]] | ||
+ | |||
+ | == X11 的字型採用順序 == | ||
+ | Fontconfig 會自動選擇符合目前需求的字型。這麼說好了,假設有一個包含英文和中文的視窗,如果預設字型不支援中文,就會換成有中文字支援的字型來顯示。 | ||
+ | |||
+ | Fontconfig 透過 {{ic|$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> | ||
+ | |||
+ | 您也可以新增無襯線和等寬字型的部分。更多資訊可參考 fontconfig 手冊。 | ||
+ | |||
+ | == 字型別名 == | ||
+ | Linux 下有數個字型別名,實際上它們指向別的真實字型,這是為了讓所有應用程式使用的字型能夠相似。最常見的別名有:{{ic|serif}} 襯線字型 (如 DejaVu Serif);{{ic|sans-serif}} 無襯線字型 (如 DejaVu Sans);以及 {{ic|monospace}} 等寬字型 (如 DejaVu Sans Mono)。不過這些別名所代表的字型可能會有變化,且通常它們不會顯示在 KDE 和其他桌面環境的字型管理工具之中。 | ||
+ | |||
+ | 若要查詢別名所代表的字型,執行: | ||
+ | $ fc-match monospace | ||
+ | DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book" | ||
+ | |||
+ | 在上面的範例中,{{ic|DejaVuSansMono.ttf}} 是 monospace 別名所指向的字型。 | ||
+ | |||
+ | == 小提示 == | ||
+ | === 從官方軟體庫安裝字型 === | ||
+ | 您可以將'''官方軟體倉庫'''有提供的字型全部抓下來安裝。 | ||
+ | ;所有字型: | ||
+ | # pacman -S $(pacman -Ssq font) | ||
+ | ;所有 ''TrueType'' 字型: | ||
+ | # pacman -S $(pacman -Ssq ttf) | ||
+ | |||
+ | === 應用程式專用的字型快取 === | ||
+ | |||
+ | Matplotlib ({{pkg|python-matplotlib}} 或 {{pkg|python2-matplotlib}}) 使用自己的字型快取,因此更新字型後記得移除 {{ic|$HOME/.matplotlib/fontList.cache}},這樣它才會再產生一次快取並找到新字型 [http://matplotlib.1069221.n5.nabble.com/getting-matplotlib-to-recognize-a-new-font-td40500.html]。 | ||
+ | |||
+ | == 另請參閱 == | ||
+ | |||
+ | * [[Font Configuration|字型設定 (英)]] |
Revision as of 13:47, 30 January 2014
摘自維基百科:
- 「電腦字型 (computer font),或稱字型 (font),是包含字 (glyph)、字元或符號 (如 dingbats) 的電子檔案資料。」
注意,某些字型的授權有訂定合理使用限制。
Contents
字型格式
現今電腦所使用的字型中,絕大部分屬於點陣 (bitmap) 或輪廓 (outline)資料格式。
- 點陣字型
- 由點 (像素) 陣列構成的圖像,代表每種字樣、大小的字 (glyph)。
- 輪廓字型
- 又稱作向量 (vector) 字型。使用貝茲曲線 (Bézier curve)、繪圖指引和數學公式描繪每個字,產生的字元可以縮放至任意大小。
常見副檔名
-
bdf
,bdf.gz
– 點陣字型,bitmap distribution format 的縮寫,以及用 gzip 壓縮的bdf
-
pcf
,pcf.gz
– 點陣字型,portable compiled font 的縮寫,以及用 gzip 壓縮的pcf
-
psf
,psfu
,psf.gz
,psfu.gz
– 點陣字型,PC screen font 與 PC screen font Unicode 的縮寫,以及用 gzip 壓縮的版本 (跟 X.Org 不相容) -
pfa
,pfb
– 輪廓字型,PostScript font ASCII 與 PostScript font binary 的縮寫。PostScript 字型內建印表機指令。 -
ttf
– 輪廓字型,TrueType font 的縮寫。原本設計為 PostScript 字型的替代品。 -
otf
– 輪廓字型,OpenType font 的縮寫。TrueType 附帶 PostScript 排版指令。
TrueType 與 OpenType 的技術差異,在大部分的用途之下可被忽略。某些 OpenType 字型使用了 ttf
副檔名。
其他格式
排版程式 TeX 與字型軟體 Metafont 有它們自己算繪字元的方法。這兩個程式使用的字型副檔名有 *pk
, *gf
, mf
和 vf
。
FontForge 字型編輯程式會將字型存為自己的文字檔格式 sfd
,這是 spline font database 的縮寫。
SVG 格式也有一套自己的字型描述方法。
安裝
安裝字型的方式有很多種。
Pacman
透過 pacman 可以安裝啟用軟體庫的字型。使用以下指令搜尋可供使用的字型:
$ pacman -Ss font
或只搜尋 ttf
字型:
$ pacman -Ss ttf
某些字型,像是 terminus-font,會安裝在 /usr/share/fonts/local
,這個目錄預設沒有被加進字型路徑。將以下內容加入 ~/.xinitrc
,就可以在 X11 使用這類字型:
xset +fp /usr/share/fonts/local xset fp rehash
如果執行第一行指令後出現以下錯誤
$ xset +fp /usr/share/fonts/local/ xset: bad font path element (#0), possible causes are: Directory does not exist or has wrong permissions Directory missing fonts.dir Incorrect font server address or syntax
需要執行
# cd /usr/share/fonts/local;mkfontdir
建立軟體包
您應該將管理字型的工作交給 pacman。字型可以打包成一份 Arch 軟體包,還可以透過 AUR 和社群分享。這裡有一個建立基本軟體包的範例。若想要更了解如何組建軟體包,請閱讀 PKGBUILD。
pkgname=ttf-fontname pkgver=1.0 pkgrel=1 pkgdesc="custom fonts" arch=('any') depends=('fontconfig' 'xorg-font-utils') source=("http://someurl.org/$pkgname.tar.bz2") install=$pkgname.install package() { install -d "$pkgdir/usr/share/fonts/TTF" cp -dpr --no-preserve=ownership "$srcdir/$pkgname/"*.ttf "$pkgdir/usr/share/fonts/TTF/" }
這份 PKGBUILD 假定字型為 TrueType 類型。之後還必須建立一份安裝檔案 (ttf-fontname.install
) 更新字型快取:
post_install() { echo -n "Updating font cache... " fc-cache -fs >/dev/null mkfontscale /usr/share/fonts/TTF /usr/share/fonts/Type1 mkfontdir /usr/share/fonts/TTF /usr/share/fonts/Type1 echo "done" } post_upgrade() { post_install } post_remove() { post_install }
若需要更方便的 ttf 字型建立方式,可以使用 AUR 提供的 makefontpkgAUR。
手動安裝
要為系統新增一個軟體庫未收錄的字型,建議方法是#建立軟體包。採用這個方式讓 pacman 之後能夠移除或升級字型。不過您也可以用手動的方式安裝字型。
若要將字型安裝到系統 (讓所有使用者都能使用),將字型資料夾移至 /usr/share/fonts/
目錄。如果只要為單一使用者安裝字型,則改移至 ~/.fonts/
目錄。
要讓 X 伺服器可以直接載入字型 (不使用「字型伺服器」),需要將新增字型的所在目錄加為 FontPath 項目。這個項目位在您的 Xorg 設定檔案 (例如 /etc/X11/xorg.conf
或 /etc/xorg.conf
) 的 Files 區。更多詳細資訊請參閱#讓字型搭配 X.Org。
接著更新 fontconfig 字型快取:
$ fc-cache -vf
手動安裝:進階方式
如果您有特殊的字型收集需求:使用商業字型、使用不同格式的字型、安裝/移除字型檔相當頻繁,或只是希望可以更能夠控制存取自己的字型資源,那就相當適合用手動的方式來安裝維護字型。採用這種方案會獲得很多好處:
- 避免重複安裝不同版本、格式的同一種字型家族 (一個常見原因是算繪問題)。
- 字型可使用多個非標準的實體來源 (例如額外的硬碟、分割區)。
- 避免依賴隱晦又佔體積的本地字型來源 (例如 TeX Live &
09-texlive-fonts.conf
,或是從 AUR 抓下來的某個字型集合);您可能只需要其中 5 種字型,卻連帶安裝其它 55 種不需要的字型。 - 避免字型算繪問題,因為您的 fontconfig 設定檔已被調成和與安裝在系統的那份不同的格式。
- 只要觀察主字型目錄下的內容,就能夠確定系統上有哪種格式的字型家族可供應用程式使用。您不需要複雜、佔用大量資源的字型管理程式;gtk2fontsel 和基本的指令工具 (如 fontconfig 軟體包下的
fc-query
) 就可以將這件差事辦得又快又好。 - 當您安裝或升級單一字型,所有應用程式都可以使用該版本,包含 LaTeX 相關軟體。
- 有必要的話,可以快速啟用 / 停用某個字型家族,因為您知道它們在哪個目錄下 (除錯時很好用)。
- 不需擔心有任何多餘的
/etc/fonts/conf.avail/nn-foo.conf
fontconfig 檔案會潛在跟您的算繪設定起衝突 (特別是當您使用自訂的字型設定與修補過的函式庫)。 - 長遠來看,可以省下那些因軟體包管理者的失誤,解決問題和清除衝突所浪費的寶貴時間。
實作上有幾種方式,有必要的話可由任何軟體包管理員採用。以下所舉出的實作方式相當有效率,即使字型數目眾多也相當安全。
- 我們要將字型來源位置 (例如
/usr/share/fonts.avail
:這是我們要存放字型的位置) 和包含字型家族軟連結的目錄 (/usr/share/fonts
) 給分隔開來。
- 將每個字型家族分別放在一個明確命名的子目錄下。命名規則必須一致且明確,例如這樣:
<ttf|otf|t1>-<字型作者或組織(選用)>-<字型家族名稱>
字型來源目錄的內容會長得像這樣:
$ ls /usr/share/fonts.avail /usr/share/fonts.avail/otf-heuristica /usr/share/fonts.avail/ttf-liberation /usr/share/fonts.avail/ttf-ms-arial ...
- 我們不會動到 TeX Live 的字型目錄,以避免 LaTeX 軟體發生任何問題。既然我們可以使用多個位置,我們將在
/usr/share/fonts
建立軟連結,讓應用程式可以存取特定的字型家族:
# cd /usr/share/fonts # ln -s ../fonts.avail/otf-heuristica . # ln -s /opt/texlive/texmf-dist/fonts/truetype/public/opensans ttf-texlive-open.sans
結果如下:
$ ls /usr/share/fonts ttf-liberation -> ..fonts.avail/ttf-liberation ttf-ms-arial -> ..fonts.avail/ttf-ms-arial otf-heuristica -> ..fonts.avail/otf-heuristica otf-texlive-tex.gyre -> /opt/texlive/texmf-dist/fonts/opentype/public/tex-gyre ttf-texlive-open.sans -> /opt/texlive/texmf-dist/fonts/truetype/public/opensans ...
最後,依照慣例執行:
# fc-cache && mkfontscale && mkfontdir
TeX Live Wiki 文章內也有一個類似做法,比較簡單,但較適用於單一使用者的情境,而非全域設定。
舊版應用程式
對於不支援 fontconfig 的舊版應用程式 (例如 GTK+ 1.x 應用程式和 xfontsel
),必須在字型目錄下建立索引:
$ mkfontscale $ mkfontdir
或者,用一行指令將多個資料夾包含進來:
$ for dir in /font/dir1/ /font/dir2/; do xset +fp $dir; done && xset fp rehash
有時候 X 伺服器會無法成功載入字型資料夾,這時您需要重新掃描所有 fonts.dir
檔案:
# xset +fp /usr/share/fonts/misc # 告知 X 伺服器新的目錄 # xset fp rehash # 強制進行新的掃描
檢查字型是否被包含進來:
$ xlsfonts | grep fontname
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 執行以套用至全系統。
# pacman -S ttf-liberation -- 略過部分輸出,假設安裝已經成功 -- # fc-cache -vfs /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"
讓字型搭配 X.Org
為了讓 Xorg 可以找到並使用您新安裝的字型,必須將字型路徑加入 /etc/X11/xorg.conf
(另一個 X.Org 設定檔也可以)。
這是必須加入 /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/local" FontPath "/usr/share/fonts/misc" FontPath "/usr/share/fonts/truetype" FontPath "/usr/share/fonts/TTF" FontPath "/usr/share/fonts/util" EndSection
終端機字型
虛擬終端機使用核心內建字型,預設顯示 ASCII 字元,這兩種設定都可以輕易改變。
終端機字型限定為 256 或 512 個字元。可供使用的字型存放在 /usr/share/kbd/consolefonts/
目錄。
鍵盤映射 (Keymap) 是按鍵和電腦使用字元的對應關係表,可以在 /usr/share/kbd/keymaps/
的子目錄下找到。
預覽和測試
showconsolefont 指令會以表格形式顯示可用字與字元:
$ showconsolefont
setfont 工具可以暫時改變字型,讓使用者可以決定是否要採為預設值。只要指定字型名稱即可 (這些字型位於 /usr/share/kbd/consolefonts/
):
$ setfont Lat2-Terminus16
您可以用 -m
選項指定使用什麼字元集:
$ setfont Lat2-Terminus16 -m 8859-2
如果對新換的字型不滿意,用以下指令可以還原至預設字型 (就算終端機顯示亂碼,這個指令依然可以執行 -- 將指令「盲打」進去即可):
$ setfont
更改預設字型
/etc/vconsole.conf
的 FONT
和 FONT_MAP
變數可用來改變預設字型。
若要顯示 Č, ž, đ, š 或 Ł, ę, ą, ś 之類的字元,使用 lat2-16.psfu.gz
這個字型:
FONT=lat2-16
這代表使用 ISO/IEC 8859 字元的第二部分,大小設定為 16。您可以使用其它值更改字型大小 (如 lat2-08
)。您可以在維基百科的這張表查詢 8859 規格定義的區域。如果您經常在沒有 X 伺服器的終端機上工作,建議可以使用一種 Terminus 字型。比如說 ter-216b,代表包含 latin-2 部分,大小 16,粗體字。ter-216n 是正常磅數的版本。Terminus 字型大小最大可以到 32。
現在設定適當的字型映射,若使用 lat2-16 則會是:
FONT_MAP=8859-2
若要為早期的使用者空間套用指定字型,在 /etc/mkinitcpio.conf
使用 keymap
勾子。更多資訊請參閱 Mkinitcpio#HOOKS。
如果開機時字型沒有任何變化,或只變化一下就回復原樣,則有可能是因為圖形驅動啟動時字型被重設,然後終端機被切至幀緩衝 (framebuffer)。提早載入圖形驅動可以避免這個問題。若要在套用 /etc/vconsole.conf
之前將幀緩衝準備好,請參閱核心模式設定#提早啟動 KMS、[1] 或其它方式。
字型軟體包
以下是收錄於官方軟體庫和 AUR 的字型軟體包列表,種類繁多,可依照需求選用。若字型有廣泛的萬國碼 (Unicode) 支援,會加註 "Unicode" 標記,詳情請參閱字型專案或相關的維基百科頁面。
一位 Github 使用者 Ternstor 用 python 腳本產生 extra, community 和 AUR 庫內字型的 PNG 圖像,您可以在那裡預覽以下所提到的字型。
盲文點字
- ttf-ubraille - 包含 Unicode 盲文點字符號的字型
國際 (非英語系) 使用者
應用程式與瀏覽器會根據 fontconfig 設定和 Unicode 文字可用的字型來選擇其顯示字型。用指令 fc-list :lang="雙字母的語言代碼"
列舉系統安裝了哪些可對應該語言的字型。例如,列舉已經安裝的阿拉伯文字型,以及支援阿拉伯字的字型:
$ fc-list :lang=ar | cut -d: -f1
/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
若要在多國語言的網站 (如維基百科、Arch Linux wiki) 正確描繪字形,安裝這些軟體包:ttf-freefont, ttf-arphic-uming, ttf-baekmuk
阿拉伯和烏爾都文字
- ttf-qurancomplex-fontsAUR - 位於麥地那的 King Fahd Glorious Quran Printing Complex 製作的字型 (AUR)
- ttf-amiriAUR - 一個典型的阿拉伯文謄抄體 (Naskh) 字型,一開始由 Amiria Press 採用 (AUR)
- ttf-sil-lateefAUR - 來自 SIL 的 Unicode 阿拉伯文字型 (AUR)
- ttf-sil-scheherazadeAUR - 來自 SIL 的 Unicode 阿拉伯文字型 (AUR)
- ttf-arabeyes-fontsAUR - 自由的阿拉伯文字型集合 (AUR)
緬甸文字
- ttf-myanmar3AUR - 緬甸手寫體字型 (AUR)
中日韓越文字
中文字
- ttf-twAUR - 台灣 (中華民國) 教育部標準楷書、宋體字型 (AUR)。
- cwttf-baselineAUR、cwttf-centerAUR - cwTeX 排版系統使用的字型集 (仿宋、粗黑、楷書、明體、圓體)。這兩個軟體包有標點符號位置的區別。
- cwtex-q-fontsAUR - cwTeX 字型集的一些修正 (仍在開發狀態)
- wqy-microhei - 無襯線形式的高品質中日韓越 (CJKV) 輪廓字型。
- wqy-zenhei - 黑體 (無襯線) 的中文輪廓字型,附帶點陣宋體 (也支援部分日韓字元)。
- ttf-arphic-ukai - 楷書 (帶有筆觸) Unicode 字型 (建議啟用反鋸齒)
- ttf-arphic-uming - 明體 (印刷) Unicode 字型
- opendesktop-fonts - 新宋字型,之前為 ttf-fireflysung
- wqy-bitmapfont - 點陣宋體 (襯線) 中文字型
- ttf-hannom - 中文、越南文 TrueType 字型
日文字
- otf-ipafont - 正規的日文哥特體 (無襯線) 與明朝體 (襯線) 字形集;其中一項高品質的開放原始碼字形。openSUSE-ja 的預設字形。
- ttf-vlgothicAUR - 日文哥特體字形。Debian/Fedora/Vine Linux 的預設字型 (AUR)
- ttf-mplusAUR - 現代哥特體的日文輪廓字型。包含所有日文平假名/片假名、Basic Latin、Latin-1 Supplement、Latin Extended-A、IPA Extensions。另外還有大部分日文漢字、希臘字母、西里爾字與越南文字,可以 7 磅 (等比例) 或 5 磅 (等寬) 字重顯示。 (AUR)
- ttf-ipa-monaAUR, ttf-monapoAUR - 日文字型,可正確顯示 2ch 的 Shift JIS 藝術創作。 (AUR)
- ttf-sazanami - 自由的日文 TrueType 字型。已經過期無人維護,但在某些環境下可當作備案字型使用。
韓文字
- ttf-baekmuk - 韓文 TrueType 字型集合
- ttf-aleeAUR - 自由的韓文 (諺文;Hangul) TrueType 字型 (AUR)
- ttf-unfonts-coreAUR - Un 字型 (預設的 Baekmuk 字型較讓人不滿意) (AUR)
- ttf-nanumAUR - 共享體 (Nanum) 系列 TrueType 字型 (AUR)
- ttf-nanumgothic_codingAUR - 共享體 (Nanum) 系列 TrueType 等寬字型 (AUR)
西里爾文字
- font-arhangaiAUR - 蒙古文西里爾字 (AUR)
- ttf-pingwi-typographyAUR - PingWi Typography (PWT) 字型 (AUR)
希臘文字
幾乎所有 Unicode 字型都包含希臘字元集 (也包含多調變音符號)。某些額外的字型軟體包未包含完整的 Unicode 集,但擁有高品質的希臘字字形 (當然包含拉丁字):
- otf-gfsAUR - 由 Greek Font Society 選用的 OpenType 字型 (AUR)
- ttf-mgopenAUR - 來自 Magenta 的專業 TrueType 字型 (AUR)
希伯來文字
- culmusAUR - 自由的希伯來文字型集合 (AUR)
印地文字
- ttf-freebanglafont - 孟加拉文字型
- ttf-indic-otf - 印地文 OpenType 字型集合 (包含 ttf-freebanglafont)
- (This one contains a "look of disapproval" that might be more to your liking than the bdf-unifont one mentioned elsewhere in this document)
- lohit-fontsAUR - 來自 Fedora 專案的印地文 TrueType 字型 (包含 Oriya 字型以及更多) (AUR)
高棉文字
- ttf-khmer - 涵蓋高棉語 (Khmer) 文字的字型
- Hanuman (ttf-google-fonts-hgAUR 或 ttf-google-fonts-gitAUR)
僧伽羅文字
- ttf-lklugAUR - 僧伽羅文 (Sinhala) Unicode 字型 (AUR)
塔米爾文字
- ttf-tamilAUR - 塔米爾文 (Tamil) Unicode 字型 (AUR)
藏文字
- ttf-tibetan-machine - 藏文 (Tibetan) Machine TTFont
數學字型
- font-mathematica - Wolfram 公司的 Mathematica 字型
- ttf-mathtypeAUR - MathType 字型 (AUR)
- ttf-computer-modern-fontsAUR - (AUR)
Microsoft 字型
參閱微軟字型。
Apple Mac OS X 字型
- ttf-mac-fontsAUR - Mac OS X TrueType 字型
- ttf-macAUR - Mac OS X TrueType 字型。這個軟體包沒有內含 ttf 字型 (只有 otf 字型),使用者必須自備這些字型。
等寬字型
有一些建議要給各位。每個使用者所偏好的字型不同,因此要找到您心目中的理想字型,就請多加嘗試。 如果您沒有太多時間,可以閱讀 Dan Benjamin 的部落格文章:Top 10 Programming Fonts (前十名適合寫程式的字型)。
這裡有 Trevor Lowing 整理的一長串字型清單:http://www.lowing.org/fonts/ 。
TrueType 字型
- Agave (ttf-agaveAUR)
- Andalé Mono (ttf-ms-fontsAUR)
- Anka/Coder (ttf-anka-coderAUR)
- Anonymous Pro (ttf-anonymous-proAUR,也包含在 ttf-google-fonts-hgAUR 和 ttf-google-fonts-gitAUR)
- Bitstream Vera Mono (ttf-bitstream-vera)
- Consolas (ttf-vista-fontsAUR) - Windows 下的編程用字型
- Courier New (ttf-ms-fontsAUR)
- Cousine (ttf-google-fonts-hgAUR 或 ttf-google-fonts-gitAUR) - Chrome/Chromium OS 的 Courier New 替代 (metric-compatible)
- DejaVu Sans Mono (ttf-dejavu) - Unicode
- Droid Sans Mono (ttf-droid,也包含在 ttf-google-fonts-hgAUR 和 ttf-google-fonts-gitAUR)
- Envy Code R (ttf-envy-code-rAUR)
- FreeMono (ttf-freefont) - Unicode
- Inconsolata (ttf-inconsolata) - 極佳的編程用字型
- Inconsolata-g (ttf-inconsolata-gAUR) - 加入一些親近編程人員的調整
- Liberation Mono (ttf-liberation) - 可代替 Courier New (metric-compatible)
- Lucida Console (ttf-ms-fontsAUR)
- Lucida Typewriter (包含於 jre 軟體包)
- Monaco (ttf-monacoAUR) - OSX/Textmate 下知名的編程用字型
- Monofur (ttf-monofurAUR)
點陣字型
- Default 8x16
- Dina (dina-font)
- Gohu (gohufontAUR)
- Lime (artwiz-fonts)
- ProFont (profont)
- Proggy Programming Fonts (proggyfontsAUR)
- Proggy opti cyrillic (proggyopticyr-fontAUR)
- Tamsyn (tamsyn-font)
- Terminus (terminus-font)
- Unifont (glyphs like (look of disapproval)) (bdf-unifont)
無襯線字型
- Andika (ttf-andikaAUR,包含於 ttf-sil-fontsAUR)
- Arial (ttf-ms-fontsAUR)
- Arial Black (ttf-ms-fontsAUR)
- Arimo (ttf-google-fonts-hgAUR 或 ttf-google-fonts-gitAUR) - Chrome/Chromium OS 的 Arial 替代 (metric-compatible)
- Calibri (ttf-vista-fontsAUR)
- Candara (ttf-vista-fontsAUR)
- Constantia (ttf-vista-fontsAUR)
- Corbel (ttf-vista-fontsAUR)
- DejaVu Sans (ttf-dejavu) - Unicode
- Droid Sans (ttf-droid,包含於 ttf-google-fonts-hgAUR 和 ttf-google-fonts-gitAUR)
- FreeSans (ttf-freefont) - Unicode
- Impact (ttf-ms-fontsAUR)
- Liberation Sans (ttf-liberation,品質提升的西里爾字:ttf-liberastikaAUR) - 可替代 Arial (metric-compatible)
- Linux Biolinum (ttf-linux-libertine)
- Lucida Sans (ttf-ms-fontsAUR)
- Microsoft Sans Serif (ttf-ms-fontsAUR)
- PT Sans (ttf-google-fonts-hgAUR 或 ttf-google-fonts-gitAUR) - 3 種主要變體:正常、變窄與標題 - Unicode:拉丁字、西里爾字
- Tahoma (ttf-tahomaAUR)
- Trebuchet (ttf-ms-fontsAUR)
- Ubuntu-Title (ttf-ubuntu-titleAUR)
- Ubuntu Font Family (ttf-ubuntu-font-family)
- Verdana (ttf-ms-fontsAUR)
手寫體
- Comic Sans (ttf-ms-fontsAUR)
襯線字型
- Cambria (ttf-vista-fontsAUR)
- Charis (ttf-charisAUR,包含於 ttf-sil-fontsAUR) - Unicode:拉丁字、西里爾字
- DejaVu Serif (ttf-dejavu) - Unicode
- Doulos (doulos-silAUR,包含於 ttf-sil-fontsAUR) - Unicode:拉丁字、西里爾字
- Droid Serif (ttf-droid,包含於 ttf-google-fonts-hgAUR 和 ttf-google-fonts-gitAUR)
- FreeSerif (ttf-freefont) - Unicode
- Gentium (ttf-gentium,包含於 ttf-sil-fontsAUR) - Unicode:拉丁字、希臘字、西里爾字、音標字母
- Georgia (ttf-ms-fontsAUR)
- Liberation Serif (ttf-liberation) - Times New Roman 替代 (metric-compatible)
- Linux Libertine (ttf-linux-libertine) - Unicode:拉丁字、希臘字、西里爾字、希伯來字
- Times New Roman (ttf-ms-fontsAUR)
- Tinos (ttf-google-fonts-hgAUR 或 ttf-google-fonts-gitAUR) - Chrome/Chromium OS 的 Times New Roman 替代 (metric-compatible)
未分類字型
- ttf-google-fonts-gitAUR and ttf-google-fonts-hgAUR — a huge collection of free fonts (including ubuntu, inconsolata, droid, etc.) - Note: Your font dialog might get very long as >100 fonts will be added. ttf-google-fonts-hgAUR pulls down the entire Mercurial repository from the upstream Web Fonts project. ttf-google-fonts-gitAUR pulls from a much smaller and leaner unofficial repository hosted on GitHub. (AUR)
- ttf-mph-2b-damase — Covers full plane 1 and several scripts
- ttf-symbola — Provides emoji and many many other symbols
- ttf-sil-fontsAUR — Gentium, Charis, Doulos, Andika and Abyssinica from SIL (AUR)
- font-bh-ttf — X.Org Luxi fonts
- ttf-cheapskate — Font collection from dustismo.com
- ttf-isabellaAUR — Calligraphic font based on the Isabella Breviary of 1497
- ttf-junicode — Junius font containing almost complete medieval latin script glyphs
- arkpandorafonts ttf-arkpandoraAUR — Alternative to Arial and Times New Roman fonts (AUR)
- xorg-fonts-type1 — IBM Courier and Adobe Utopia sets of PostScript fonts
X11 的字型採用順序
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>
您也可以新增無襯線和等寬字型的部分。更多資訊可參考 fontconfig 手冊。
字型別名
Linux 下有數個字型別名,實際上它們指向別的真實字型,這是為了讓所有應用程式使用的字型能夠相似。最常見的別名有:serif
襯線字型 (如 DejaVu Serif);sans-serif
無襯線字型 (如 DejaVu Sans);以及 monospace
等寬字型 (如 DejaVu Sans Mono)。不過這些別名所代表的字型可能會有變化,且通常它們不會顯示在 KDE 和其他桌面環境的字型管理工具之中。
若要查詢別名所代表的字型,執行:
$ fc-match monospace DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"
在上面的範例中,DejaVuSansMono.ttf
是 monospace 別名所指向的字型。
小提示
從官方軟體庫安裝字型
您可以將官方軟體倉庫有提供的字型全部抓下來安裝。
- 所有字型
# pacman -S $(pacman -Ssq font)
- 所有 TrueType 字型
# pacman -S $(pacman -Ssq ttf)
應用程式專用的字型快取
Matplotlib (python-matplotlib 或 python2-matplotlib) 使用自己的字型快取,因此更新字型後記得移除 $HOME/.matplotlib/fontList.cache
,這樣它才會再產生一次快取並找到新字型 [2]。