|
|
发表于 2004-3-23 08:37:26
|
显示全部楼层
技术细节。。。
1. 获取字体信息
用ftdump这个工具
- $ ftdump ~/.fonts/simsun.ttc
- font name table entries
- ------------------------------------------------------------------------------
- SimSun - Version 3.03
- PostScript name: SimSun
- (c) Copyright ZHONGYI Electronic Co. 1995
- Trademark of ZHONGYI Electronic Co., Beijing
- ------------------------------------------------------------------------------
- character map encodings
- ------------------------------------------------------------------------------
- There are 2 encodings:
- encoding 0: Apple Roman
- encoding 1: Windows Unicode
- ------------------------------------------------------------------------------
- ftxcmap test
- ------------------------------------------------------------------------------
- There are 2 encodings:
- encoding 0:
- first: glyph index 1, character code 0x0
- next: glyph index 0, character code 0x1
- last: glyph index 92, character code 0xff
- encoding 1:
- first: glyph index 3, character code 0x20
- next: glyph index 4, character code 0x21
- last: glyph index 0, character code 0xffff
- ------------------------------------------------------------------------------
- embedded bitmap table
- ------------------------------------------------------------------------------
- version of embedded bitmap table: 0x20000
- number of embedded bitmap strikes: 6
- bitmap strike 1/6: 12x12 pixels, 1-bit depth, glyphs [98..21983]
- range format (5:5) glyphs 98..114
- range format (2:5) glyphs 136..685
- range format (2:5) glyphs 701..905
- range format (2:5) glyphs 925..21902
- range format (2:5) glyphs 21983..21983
- bitmap strike 2/6: 14x14 pixels, 1-bit depth, glyphs [98..21983]
- range format (5:5) glyphs 98..114
- range format (2:5) glyphs 136..685
- range format (2:5) glyphs 701..905
- range format (2:5) glyphs 925..21902
- range format (2:5) glyphs 21983..21983
- bitmap strike 3/6: 16x16 pixels, 1-bit depth, glyphs [98..21983]
- range format (5:5) glyphs 98..114
- range format (2:5) glyphs 136..685
- range format (2:5) glyphs 701..905
- range format (2:5) glyphs 925..21902
- range format (2:5) glyphs 21983..21983
- bitmap strike 4/6: 18x18 pixels, 1-bit depth, glyphs [98..21983]
- range format (5:5) glyphs 98..114
- range format (2:5) glyphs 136..685
- range format (2:5) glyphs 701..905
- range format (2:5) glyphs 925..21902
- range format (2:5) glyphs 21983..21983
- bitmap strike 5/6: 15x15 pixels, 1-bit depth, glyphs [98..21983]
- range format (5:5) glyphs 98..114
- range format (2:5) glyphs 136..685
- range format (2:5) glyphs 701..905
- range format (2:5) glyphs 925..21902
- range format (2:5) glyphs 21983..21983
- bitmap strike 6/6: 13x13 pixels, 1-bit depth, glyphs [98..21983]
- range format (5:5) glyphs 98..114
- range format (2:5) glyphs 136..685
- range format (2:5) glyphs 701..905
- range format (2:5) glyphs 925..21902
- range format (2:5) glyphs 21983..21983
- ------------------------------------------------------------------------------
- GSUB table
- ------------------------------------------------------------------------------
- script `hani' (index 0):
- default language system:
- feature `vert' (index 0; lookup 0)
- language `CHN ' (index 0):
- feature `vert' (index 0; lookup 0)
- Lookups:
- 0: type 1, flag 0x1
- ------------------------------------------------------------------------------
- Memory footprint statistics:
- ------------------------------------------------------------------------------
- 269875 Bytes ( 264 kByte): face object
- 6387 Bytes ( 7 kByte): glyph object
- 2852 Bytes ( 3 kByte): instance object
- 12070 Bytes ( 12 kByte): exec. context object
- ------------------------------------------------------------------------------
- 291184 Bytes ( 285 kByte): total memory usage
复制代码 这个东西我没编译成功,直接从网上找了一个rpm解开用的,能用 ;)
2. 提取ttf内嵌的点阵字体
freetype必须打开了bytecode功能(firefly有patch,事实上,在gentoo里面,直接USE="-bindist cjk" emerge freetype就行,这样会打开bytecode,同时使用akito的patch)
然后正确的配置fonts.conf- <match target="font" >
- <test name="family"><string>SimSun</string></test>
- <edit name="antialias" >
- <bool>true</bool>
- </edit>
- <edit name="hinting" >
- <bool>true</bool>
- </edit>
- <edit name="autohint" >
- <bool>false</bool>
- </edit>
- </match>
复制代码 也就是,打开hinting, 关闭autohint。这样,当遇到合适的字号时,freetype会自动提取内嵌的bitmap字体。当然还可以设置多少号以下字体关闭AA,不过我觉得没什么必要。我上面截图中的字体,英文有AA,中文就是simsun内嵌的点阵字体。 |
|