免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1541 | 回复: 0
打印 上一主题 下一主题

TrueType(4) [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-02-27 14:32 |只看该作者 |倒序浏览
TrueType字体文件中用到的数据类型。字节序是Big-Endian

BYTE    8位无符号整型
CHAR    8位有符号整型
USHORT  16位无符号整型
SHORT   16位有符号整型
ULONG   32位无符号整型
LONG    32位有符号整型
FIXED   32位有符号定点实数(16.16)
FUNIT   em space中的最小可测量单位
FWORD   用来描述FUNIT的16位有符号整型
UFWORD  用来描述FUNIT的16位无符号整型
F2DOT14 16位定点实数(2.14)


TrueType字体文件开头是一个Offset Table,结构如下。

Type        Name            Description
----------------------------------------------------------------------
FIXED       sfnt version    0x00010000 for version1.0
USHORT      unmTables       Number of tables
USHORT      searchRange    (Maximum power of 2
USHORT      entrySelector   Ln(maximum power of 2
USHORT      rangeShift      NumTables X 16 - searchRange
----------------------------------------------------------------------


Offset Table的后面紧跟着的是Table Directory。

Type        Name            Description
----------------------------------------------------------------------
ULONG       tag             4-byte identifier
ULONG       checkSum        CheckSum for this table
ULONG       offset          Offset from beginning of TrueType font file
ULONG       length          Lenth of this table
----------------------------------------------------------------------


接下来就是各种表。

必需表

Tag        Name
---------------------------------------------
cmap       character to glyph mapping
glyf       glyph data
head       font header
hhea       horizontal header
hmtx       horizontal metrics
loca       index to location
maxp       maximum profile
name       naming table
post       PostScript information
OS/2       OS/2 and Windows specific metrics
---------------------------------------------

可选表

Tag        Name
----------------------------------------------------------------
cvt        Control Value Table
EBDT       Embedded bitmap data
EBLC       Embedded bitmap location data
EBSC       Embedded bitmap scaling data
fpgm       font program
gasp       grid-fitting and scan conversion procedure(grayscale)
hdmx       horizontal device metrics
kern       kerning
LTSH       Linear threshold table
prep       CVT Program
PCLT       PCL5
VDMX       Vertical Device Metrics table
vhea       Vertical Metrics header
vmtx       Vertical Metrics
-----------------------------------------------------------------


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/91477/showart_1845031.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP