Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
01e4fcb0
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
1 年多 前同步成功
通知
0
Star
18
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Harfbuzz
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
01e4fcb0
编写于
12月 21, 2006
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove the annoying HB_ prefix.
上级
6b4ce01d
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
52 addition
and
55 deletion
+52
-55
src/hb-types-private.cc
src/hb-types-private.cc
+52
-55
未找到文件。
src/hb-types-private.cc
浏览文件 @
01e4fcb0
...
...
@@ -38,59 +38,59 @@ struct NAME { \
#define DEFINE_INT_TYPE0(NAME, type) DEFINE_INT_TYPE1 (NAME, type, hb_be_##type)
#define DEFINE_INT_TYPE(NAME, u, w) DEFINE_INT_TYPE0 (NAME, u##int##w##_t)
DEFINE_INT_TYPE
(
HB_
BYTE
,
u
,
8
);
/* 8-bit unsigned integer. */
DEFINE_INT_TYPE
(
HB_
CHAR
,
,
8
);
/* 8-bit signed integer. */
DEFINE_INT_TYPE
(
HB_USHORT
,
u
,
16
);
/* 16-bit unsigned integer. */
DEFINE_INT_TYPE
(
HB_
SHORT
,
,
16
);
/* 16-bit signed integer. */
DEFINE_INT_TYPE
(
HB_
ULONG
,
u
,
32
);
/* 32-bit unsigned integer. */
DEFINE_INT_TYPE
(
HB_
LONG
,
,
32
);
/* 32-bit signed integer. */
DEFINE_INT_TYPE
(
BYTE
,
u
,
8
);
/* 8-bit unsigned integer. */
DEFINE_INT_TYPE
(
CHAR
,
,
8
);
/* 8-bit signed integer. */
DEFINE_INT_TYPE
(
USHORT
,
u
,
16
);
/* 16-bit unsigned integer. */
DEFINE_INT_TYPE
(
SHORT
,
,
16
);
/* 16-bit signed integer. */
DEFINE_INT_TYPE
(
ULONG
,
u
,
32
);
/* 32-bit unsigned integer. */
DEFINE_INT_TYPE
(
LONG
,
,
32
);
/* 32-bit signed integer. */
/* Date represented in number of seconds since 12:00 midnight, January 1,
* 1904. The value is represented as a signed 64-bit integer. */
DEFINE_INT_TYPE
(
HB_
LONGDATETIME
,
,
64
);
DEFINE_INT_TYPE
(
LONGDATETIME
,
,
64
);
/* 32-bit signed fixed-point number (16.16) */
struct
HB_Fixed
:
HB_
LONG
{
struct
Fixed
:
LONG
{
inline
operator
double
(
void
)
{
return
(
uint32_t
)
this
/
65536.
;
}
inline
int16_t
int_part
(
void
)
{
return
(
uint32_t
)
this
>>
16
;
}
inline
int16_t
frac_part
(
void
)
{
return
(
uint32_t
)
this
&
0xffff
;
}
};
/* Smallest measurable distance in the em space. */
struct
HB_
FUNIT
;
struct
FUNIT
;
/* 16-bit signed integer (SHORT) that describes a quantity in FUnits. */
struct
HB_FWORD
:
HB_
SHORT
{
struct
FWORD
:
SHORT
{
};
/* 16-bit unsigned integer (USHORT) that describes a quantity in FUnits. */
struct
HB_UFWORD
:
HB_
USHORT
{
struct
UFWORD
:
USHORT
{
};
/* 16-bit signed fixed number with the low 14 bits of fraction (2.14). */
struct
HB_F2DOT14
:
HB_
SHORT
{
struct
F2DOT14
:
SHORT
{
inline
operator
double
()
{
return
(
uint32_t
)
this
/
16384.
;
}
};
/* Array of four uint8s (length = 32 bits) used to identify a script, language
* system, feature, or baseline */
struct
HB_Tag
:
public
HB_
ULONG
{
inline
HB_Tag
(
char
*
c
)
:
HB_
ULONG
(
c
?
*
(
uint32_t
*
)
c
:
0
)
{}
struct
Tag
:
public
ULONG
{
inline
Tag
(
char
*
c
)
:
ULONG
(
c
?
*
(
uint32_t
*
)
c
:
0
)
{}
};
/* Glyph index number, same as uint16 (length = 16 bits) */
struct
HB_GlyphID
:
HB_
USHORT
{
struct
GlyphID
:
USHORT
{
};
/* Offset to a table, same as uint16 (length = 16 bits), NULL offset = 0x0000 */
struct
HB_Offset
:
HB_
USHORT
{
struct
Offset
:
USHORT
{
};
/* CheckSum */
struct
HB_CheckSum
:
HB_
ULONG
{
static
uint32_t
CalcTableChecksum
(
HB_
ULONG
*
Table
,
uint32_t
Length
)
{
struct
CheckSum
:
ULONG
{
static
uint32_t
CalcTableChecksum
(
ULONG
*
Table
,
uint32_t
Length
)
{
uint32_t
Sum
=
0L
;
HB_ULONG
*
EndPtr
=
Table
+
((
Length
+
3
)
&
~
3
)
/
sizeof
(
HB_
ULONG
);
ULONG
*
EndPtr
=
Table
+
((
Length
+
3
)
&
~
3
)
/
sizeof
(
ULONG
);
while
(
Table
<
EndPtr
)
Sum
+=
*
Table
++
;
...
...
@@ -105,10 +105,10 @@ struct HB_CheckSum : HB_ULONG {
*/
struct
HB_USHORT_Version
:
HB_
USHORT
{
struct
USHORT_Version
:
USHORT
{
};
struct
HB_Fixed_Version
:
HB_
Fixed
{
struct
Fixed_Version
:
Fixed
{
inline
int16_t
major
(
void
)
{
return
this
->
int_part
();
}
inline
int16_t
minor
(
void
)
{
return
this
->
frac_part
();
}
};
...
...
@@ -121,24 +121,22 @@ struct HB_Fixed_Version : HB_Fixed {
/* Offset Table */
struct
HB_OffsetTable
{
HB_Fixed_Version
sfnt_version
;
/* 0x00010000 for version 1.0. */
HB_USHORT
numTables
;
/* Number of tables. */
HB_USHORT
searchRange
;
/* (Maximum power of 2 <= numTables)
* x 16 */
HB_USHORT
entrySelector
;
/* Log2(maximum power of 2 <=
* numTables). */
HB_USHORT
rangeShift
;
/* NumTables x 16-searchRange. */
struct
OffsetTable
{
Fixed_Version
sfnt_version
;
/* 0x00010000 for version 1.0. */
USHORT
numTables
;
/* Number of tables. */
USHORT
searchRange
;
/* (Maximum power of 2 <= numTables) x 16 */
USHORT
entrySelector
;
/* Log2(maximum power of 2 <= numTables). */
USHORT
rangeShift
;
/* NumTables x 16-searchRange. */
};
/* Table Directory */
struct
HB_
TableDirectory
{
HB_Tag
tag
;
/* 4-byte identifier. */
HB_
CheckSum
checkSum
;
/* CheckSum for this table. */
HB_ULONG
offset
;
/* Offset from beginning of TrueType font
struct
TableDirectory
{
Tag
tag
;
/* 4-byte identifier. */
CheckSum
checkSum
;
/* CheckSum for this table. */
ULONG
offset
;
/* Offset from beginning of TrueType font
* file. */
HB_ULONG
length
;
/* Length of this table. */
ULONG
length
;
/* Length of this table. */
};
...
...
@@ -149,30 +147,29 @@ struct HB_TableDirectory {
/* TTC Header Version 1.0 */
struct
HB_
TTCHeader
{
HB_
Tag
TTCTag
;
/* TrueType Collection ID string: 'ttcf' */
HB_
ULONG
version
;
/* Version of the TTC Header (1.0 or 2.0),
struct
TTCHeader
{
Tag
TTCTag
;
/* TrueType Collection ID string: 'ttcf' */
ULONG
version
;
/* Version of the TTC Header (1.0 or 2.0),
* 0x00010000 or 0x00020000 */
HB_
ULONG
numFonts
;
/* Number of fonts in TTC */
HB_ULONG
offsetTable
[
0
];
/* Array of offsets to the OffsetTable for
* each font
from the beginning of the file.
ULONG
numFonts
;
/* Number of fonts in TTC */
ULONG
offsetTable
[
0
];
/* Array of offsets to the OffsetTable for each font
*
from the beginning of the file.
* numFonts entries long. */
inline
int
len
(
void
)
{
return
sizeof
(
HB_
TTCHeader
)
+
sizeof
(
HB_
ULONG
)
*
numFonts
;
}
inline
int
len
(
void
)
{
return
sizeof
(
TTCHeader
)
+
sizeof
(
ULONG
)
*
numFonts
;
}
};
/* TTC Header Version 2.0 tail
* Follows after
HB_
TTCHeader with appropriate size for the offsetTable. */
struct
HB_
TTCHeaderVersion2Tail
{
HB_
ULONG
ulDsigTag
;
/* Tag indicating that a DSIG table exists,
* Follows after TTCHeader with appropriate size for the offsetTable. */
struct
TTCHeaderVersion2Tail
{
ULONG
ulDsigTag
;
/* Tag indicating that a DSIG table exists,
* 0x44534947 ('DSIG') (null if no signature) */
HB_ULONG
ulDsigLength
;
/* The length (in bytes) of the DSIG table
* (null if no signature) */
HB_ULONG
ulDsigOffset
;
/* The offset (in bytes) of the DSIG table
* from the beginning of the TTC file (null if
ULONG
ulDsigLength
;
/* The length (in bytes) of the DSIG table (null if
* no signature) */
ULONG
ulDsigOffset
;
/* The offset (in bytes) of the DSIG table from the
* beginning of the TTC file (null if no signature) */
};
...
...
@@ -217,9 +214,9 @@ struct ScriptList {
int
main
(
void
)
{
HB_
Tag
y
(
"abcd"
);
HB_
Tag
&
x
=
y
;
HB_
BYTE
b
(
0
);
Tag
y
(
"abcd"
);
Tag
&
x
=
y
;
BYTE
b
(
0
);
printf
(
"%d %04x %04x
\n
"
,
sizeof
(
x
),
x
+
0
,
y
+
0
);
return
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录