Fontconfig

出自Local Chinese Wikipedia
跳至導覽 跳至搜尋
Fontconfig
開發者基思·帕卡德
目前版本2.14.1(2022年10月21日,​3年前​(2022-10-21
預覽版本2.13.96(2022年2月4日,​4年前​(2022-02-04
原始碼庫
  • {{URL|example.com|可选的显示文本}}
Module:EditAtWikidata第29行Lua錯誤:attempt to index field 'wikibase' (a nil value)
引擎
    Module:EditAtWikidata第29行Lua錯誤:attempt to index field 'wikibase' (a nil value)
    作業系統Unix-like 系統
    類型字體處理庫
    特許條款MIT特許條款
    網站www.freedesktop.org/wiki/Software/fontconfig/

    Fontconfig是一種與字體相關的電腦程式庫,用於組態、客製化全系統的字體,或將字體提供給應用程式使用。此庫最初是由基思·帕卡德(Keith Packard)開發維護的,現由貝赫達德·埃斯法赫博德(Behdad Esfahbod)維護。Fontconfig是自由軟件,採用寬鬆開放著作權特許條款[1]

    用法[編輯]

    應用程式可以通過兩種方式從fontconfig獲得字體:

    1. 查詢
    2. 模式匹配。 Fontconfig 將返回和指定模式最匹配的字體。

    為了進行字體匹配,fontconfig 儲存所有已經安裝字體的大量排版資訊,例如字體名稱、風格、大小、DPIUnicode覆蓋範圍等。這些資訊也被用來執行字體替換。

    檔案[編輯]

    Fontconfig使用XML格式的設定檔。 Fontconfig的DTD檔案通常位於/etc/fonts/fonts.dtd

    主設定檔是/etc/fonts/fonts.conf,參照少量的其他設定檔(有可能不存在):

    • /etc/fonts/local.conf
    • /etc/fonts/conf.d directory
    • ~/.fonts.conf

    一個簡單的設定檔例子:

     <?xml version="1.0"?>
     <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
     <fontconfig>
       <!-- Enable antialiasing for all fonts -->
       <match target="font">
         <edit mode="assign" name="antialias"><bool>true</bool></edit>
       </match>
     </fontconfig>
    

    更多細節,請參見fontconfig manual頁面存檔備份,存於互聯網檔案館) 。

    工具包[編輯]

    fontconfig提供了8個命令列工具來管理字體組態:

    • fc-list:列出fontconfig知道的所有和模式匹配的字體。
    • fc-match:匹配字體模式(預設為空模式),使用正常的fontconfig匹配規則來尋找最合適的字體。
    • fc-cache:建立一個所有FreeType於指定目錄(或者設定檔中指定的所有目錄)中可讀字體的快取
    • fc-cat:從快取檔案或者相關字體目錄中讀取字體資訊,並且以ASCII格式輸出。
    • fc-query:查詢字體檔案並報告產生的模式。
    • fc-scan:掃描字體檔案和目錄並報告產生的模式。
    • fc-pattern:列舉匹配提供模式的最佳字體。
    • fc-validate:驗證字體檔案並報告結果。

    Fontconfig建立在FreeType(一個字體渲染器)和expat(一個XML解析庫)之上,這兩個都是自由軟件

    Fontmatrix 是一個有圖形用戶介面的互動工具,可以使用fontconfig列出可用的字體以及顯示資訊。

    版本號說明[編輯]

    當fontconfig接近發佈時,最末位版本號用大於等於90的數字表示。

    外部連結[編輯]

    參見[編輯]

    參照[編輯]

    1. fontconfig-2.6.0.tar.gz (see file "COPYING"). freedesktop.org. [2020-07-16]. (原始內容存檔於2010-11-23). Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Keith Packard not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission...