Harfbuzz 测试程序
Libharfbuzz 严重参考《Harfbuzz-ng API Basic Usage》
#下载源码
wget http://www.freedesktop.org/software/harfbuzz/release/harfbuzz-0.9.10.tar.bz2 || exit 1
#解压
tar xvjf harfbuzz-0.9.10.tar.bz2 && cd harfbuzz-0.9.10/ || exit 1
#配置编译
./configure && make
输入的是ttf字体文件和utf-16。输出Glyphs and Positions.如下:
$ ./src/test ./NotoSansHans-Regular.otf
Opened font file NotoSansHans-Regular.otf: 8364644 bytes long
cluster 0 glyph 0x3276 at (0,0)+(1000,0)
cluster 3 glyph 0x25e5 at (0,0)+(1000,0)
cluster 6 glyph 0x224c at (0,0)+(1000,0)
cluster 9 glyph 0x61f7 at (0,0)+(1000,0)
$
info->cluster,
info->codepoint,
pos->x_offset,
pos->x_offset,
pos->x_advance,
pos->y_advance
我暂时不太清楚,这些都代表了什么,想像着应该是字的轮廓和位置。类似这样的一个信息: