利用FreeType提取了Simsun字体,但是为设么提取不了文鼎字体?

rorot 2005-04-08 06:48:21
使用FreeType2 利用Unicode可以从simsun.ttf里提取中文字体. 但是当我从网络里下载了文鼎行楷字体
GSKB00B.TTF, 再尝试从文鼎字体里提取中文时,FT_Get_Char_Index() 总是返回错误0值. 也就是说我
没有办法获得每个文字对应的文鼎字体的索引.

请问怎么解决?

下面是字体信息:
rorot@[examples]$ freetype-config --version
9.5.3

rorot@[examples]$ ./font-info.pl ~/program/image/FreeType/GSKB00B.TTF
Use of uninitialized value in print at ./font-info.pl line 11.
Family name:
Scalable Fixed width Glyph names (unreliable) SFNT Horizontal Vertical
Units per em: 1024
Number of glyphs: 8435

rorot@[examples]$ ./font-info.pl ~/program/image/FreeType/simsun.ttf
Family name: SimSun
Style name: Regular
PostScript name: SimSun
Scalable Glyph names (unreliable) SFNT Horizontal Vertical
Units per em: 256
Number of glyphs: 22141
Number of faces: 2
Fixed sizes:
size 12, width 6, height 14, x_res_dpi 72, y_res_dpi 72
size 14, width 7, height 16, x_res_dpi 72, y_res_dpi 72
size 16, width 8, height 18, x_res_dpi 72, y_res_dpi 72
size 18, width 9, height 21, x_res_dpi 72, y_res_dpi 72
size 15, width 8, height 17, x_res_dpi 72, y_res_dpi 72
size 13, width 7, height 15, x_res_dpi 72, y_res_dpi 72

rorot@0[examples]$ ./font-info.pl ~/program/image/FreeType/GPSK00L.TTF
Family name: ???????
Style name: Regular
Scalable Fixed width Glyph names (unreliable) SFNT Horizontal Vertical
Units per em: 1024
Number of glyphs: 8435
...全文
297 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
iPanda 2005-08-24
  • 打赏
  • 举报
回复
mark
Wolf0403 2005-04-11
  • 打赏
  • 举报
回复
恭喜……
rorot 2005-04-10
  • 打赏
  • 举报
回复
我想我把问题解决了,重新分析了GB2312和区位码,OK:)
FireEmissary 2005-04-10
  • 打赏
  • 举报
回复
Perl?
Wolf0403 2005-04-09
  • 打赏
  • 举报
回复
我测试中发现,文鼎字体的编码属于FT_ENCODING_GB2312, 而simsun和方正字体是 FT_ENCODING_APPLE_ROMAN, 本来以为FT_ENCODING_GB2312是按照区位码的规律编码的,结果'啊'的区位码是 1601, 但是在文鼎字体里的索引确实1667, 实在又是对不上,不过文鼎字体里的索引似乎和区位码的编排有一定关系。你把这个转发给“血精灵”……[此处省略废话无数,rorot 居然因为 rpwt 自己没法回帖,我狂无语]

楼上的:google 尽知天下事
WingForce 2005-04-09
  • 打赏
  • 举报
回复
等待高手出现中
FreeType2是接口吗?怎么msdn里查不到?

3,881

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 其它技术问题
社区管理员
  • 其它技术问题社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧