@gcanvas/node
Version:
gcanvas for node developer
54 lines (49 loc) • 2.25 kB
Markdown
* font Tools 工具编译
```
g++ -o fonttool.out fonttool.cpp -I../../../../node/third_party/font/freetype2/ -lfreetype -lboost_system -lboost_filesystem
```
* 打包fontcache
```
./fonttool.out buildCache `your ttc file path`
```
eg:
```
ls -a
fontool.out wqy-microhei.ttc 站酷酷黑_0.ttf
./fontool.out dumpCache .fontcache
```
* dump打包完成的fontcache 验证
```
./fontool.out dumpCache .fontcache
```
```
the face.source is /home/mingzong/.gAssets/fonts/./站酷酷黑_0.ttf
the face.psName is HuXiaoBoKuHei
the face.familyName is HuXiaoBo_KuHei
the face.styleName is Regular
the face.source is /home/mingzong/.gAssets/fonts/./wqy-microhei.ttc
the face.psName is WenQuanYiMicroHei
the face.familyName is WenQuanYi Micro Hei
the face.styleName is Regular
the face.source is /home/mingzong/.gAssets/fonts/./wqy-microhei.ttc
the face.psName is WenQuanYiMicroHeiMono
the face.familyName is WenQuanYi Micro Hei Mono
the face.styleName is Regular
[] Number of cached typefaces: 3
[] Typeface: HuXiaoBo_KuHei, Regular. (HuXiaoBoKuHei)
[] source type: TST_LOCAL
[] source: /home/mingzong/.gAssets/fonts/./站酷酷黑_0.ttf
[] index: 0
[] face: (nil)
[] Typeface: WenQuanYi Micro Hei, Regular. (WenQuanYiMicroHei)
[] source type: TST_LOCAL
[] source: /home/mingzong/.gAssets/fonts/./wqy-microhei.ttc
[] index: 0
[] face: (nil)
[] Typeface: WenQuanYi Micro Hei Mono, Regular. (WenQuanYiMicroHeiMono)
[] source type: TST_LOCAL
[] source: /home/mingzong/.gAssets/fonts/./wqy-microhei.ttc
[] index: 1
[] face: (nil)
```