cht電腦資訊字型
adm Find login register

辨識 OpenType 字型的 outline 種類的方法

qtnez

joined: 2016-10-14
posted: 82
promoted:
bookmarked:
台灣‧屏東
1subject: 辨識 OpenType 字型的 outline 種類的方法Promote 0 Bookmark 08 days agoquote  

OpenType 字型把 CFF(Compact Font Format, type 1 outline)和 TrueType outline 包容在一起,所以看到是 *.otf 字型時(*.ttf 也可能是 OpenType 字型),他可能是 Type 1 outline,也可能是 TrueType outline。

TrueType outline 用的是 quadratic Bézier curves(二次方曲線),只有三個 control point。Type 1 outline 是用 cubic Bézier curves(三次方曲線),可有四個 control point,因此理論上 Type 1 outline 較容易控制。

這裡提供二個工具來辨識這二種 outline。一個是 otfinfo(這要安裝 texlive 才會有)。一個是 ttx(要安裝 fonttools package)。

otfinfo -t some.otf
ttx -l some.otf

這樣會輸出這個字型的所有 table。CFF 的話,會有 CFF 或 CFF2 table。TrueType 的話會有 glyf 及 loca table,這樣就很容易辨識是哪一種 outline 的 OpenType 字型了。

當然習慣使用 GUI 的話,也可以用 FontForge 來辨識。

更進階的辨識方法是去找 sfntVersion 的值,TrueType outline 是 0x00010000/Version 1,Type 1 outline 的是 0x4F54544F/OTTO

-- 
Do not feed the troll, please.

edited: 2

cht電腦資訊字型
adm Find login register
views:87