工具
- fonttools
- gawk
- wc
操作
ttx -t cmap "/Users/username/Library/Fonts/FOT-TsukuOldMinPro-R.otf"
# will get the following content
# <map code="0xfa5d" name="cid14199"/><!-- CJK COMPATIBILITY IDEOGRAPH-FA5D -->
# <map code="0xfa5e" name="cid14198"/><!-- CJK COMPATIBILITY IDEOGRAPH-FA5E -->
# <map code="0xfa5f" name="cid13367"/><!-- CJK COMPATIBILITY IDEOGRAPH-FA5F -->
# <map code="0xfa60" name="cid13331"/><!-- CJK COMPATIBILITY IDEOGRAPH-FA60 -->
# <map code="0xfa61" name="cid13346"/><!-- CJK COMPATIBILITY IDEOGRAPH-FA61 -->
# <map code="0xfa62" name="cid13321"/><!-- CJK COMPATIBILITY IDEOGRAPH-FA62 -->
# <map code="0xfa63" name="cid13339"/><!-- CJK COMPATIBILITY IDEOGRAPH-FA63 -->
cat FOT-TsukuOldMinPro-R.ttx | gawk 'BEGIN{FS="\""}{if($2>"0x2710")printf "%s %s\n",sprintf("%c",strtonum($2)),$4}'
# or
cat FOT-TsukuOldMinPro-R.ttx | gawk -F\" '{if($2>"0x2710")printf "%s %s\n",sprintf("%c",strtonum($2)),$4}'
# will get :
#眞 cid13357
#真 cid13854
#絣 cid14180
#芽 cid13670
#諭 cid14068
#輸 cid14069
#嶲 cid15269
网友评论