取得字體的包含文字

為什麼要學這個?

可以知道某個字體檔定義了那些文字,進行知道缺字是否有缺字,及之後要先補那些字進去。


前置作業

使用前,需要先安裝FontForge,把要處理的字體先存成.sfdir 的資料夾格式。

FontForge執行檔下載:
https://fontforge.org/en-US/

Max腳本檔案下載:
https://github.com/max32002/MaxFontScripts/blob/master/get_ttf_chars.py


使用方法

get_ttf_chars.py font_forge.sfdir

參數說明:

  • 程式碼後第1個參數,就輸入 Font Forge 的 .sfdir 資料夾路徑。

操作範例:

get_ttf_chars.py source.sfdir

使用範例:產生一個文字檔,裡面記錄 source.sfdir 有定義的文字。


相關文章:

從字體專案裡取得特定文字
https://codereview.max-everyday.com/get-selected-glyph-from-font/

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *