Sign-up....

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

使用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

[1351 byte] By [msdn] at [2007-8-14 13:07:58]
# 1 Re: 利用FreeType提取了Simsun字体,但是为设么提取不了文鼎字体?

等待高手出现中

FreeType2是接口吗?怎么msdn里查不到?

WingForce at 2005-4-9 13:43:18 >
# 2 Re: 利用FreeType提取了Simsun字体,但是为设么提取不了文鼎字体?

我测试中发现,文鼎字体的编码属于FT_ENCODING_GB2312, 而simsun和方正字体是 FT_ENCODING_APPLE_ROMAN, 本来以为FT_ENCODING_GB2312是按照区位码的规律编码的,结果'啊'的区位码是 1601, 但是在文鼎字体里的索引确实1667, 实在又是对不上,不过文鼎字体里的索引似乎和区位码的编排有一定关系。你把这个转发给“血精灵”……[此处省略废话无数,rorot 居然因为 rpwt 自己没法回帖,我狂无语]

楼上的:google 尽知天下事

Wolf0403 at 2005-4-9 16:10:42 >
# 3 Re: 利用FreeType提取了Simsun字体,但是为设么提取不了文鼎字体?

Perl?

FireEmissary at 2005-4-10 10:01:47 >
# 4 Re: 利用FreeType提取了Simsun字体,但是为设么提取不了文鼎字体?

我想我把问题解决了,重新分析了GB2312和区位码,OK:)

rorot at 2005-4-10 23:21:16 >
# 5 Re: 利用FreeType提取了Simsun字体,但是为设么提取不了文鼎字体?

恭喜……

Wolf0403 at 2005-4-11 1:17:18 >

C/C++

All Classified