Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
238c855f
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看板
提交
238c855f
编写于
5月 17, 2009
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[HB] Use OffsetTo<> for Coverage
上级
3d54bd12
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
23 addition
and
43 deletion
+23
-43
src/hb-ot-layout-gdef-private.h
src/hb-ot-layout-gdef-private.h
+1
-0
src/hb-ot-layout-gsub-private.h
src/hb-ot-layout-gsub-private.h
+21
-34
src/hb-ot-layout-open-private.h
src/hb-ot-layout-open-private.h
+1
-9
未找到文件。
src/hb-ot-layout-gdef-private.h
浏览文件 @
238c855f
...
...
@@ -240,6 +240,7 @@ struct GDEF {
inline
bool
has_attach_list
()
const
{
return
attachList
!=
0
;
}
inline
bool
has_lig_caret_list
()
const
{
return
ligCaretList
!=
0
;
}
private:
Fixed
version
;
/* Version of the GDEF table--initially
* 0x00010000 */
OffsetTo
<
ClassDef
>
...
...
src/hb-ot-layout-gsub-private.h
浏览文件 @
238c855f
...
...
@@ -34,12 +34,6 @@
#include "harfbuzz-buffer-private.h"
/* XXX */
#define DEFINE_GET_GLYPH_COVERAGE(name) \
inline unsigned int get_##name (hb_codepoint_t glyph) const { \
const Coverage &c = get_coverage (); \
return c.get_coverage (glyph); \
}
#define SUBTABLE_SUBSTITUTE_ARGS_DEF \
hb_ot_layout_t *layout, \
hb_buffer_t *buffer, \
...
...
@@ -58,12 +52,10 @@ struct SingleSubstFormat1 {
friend
struct
SingleSubst
;
private:
DEFINE_GET_ACCESSOR
(
Coverage
,
coverage
,
coverage
);
DEFINE_GET_GLYPH_COVERAGE
(
glyph_coverage
);
inline
bool
single_substitute
(
hb_codepoint_t
&
glyph_id
)
const
{
unsigned
int
index
=
get_glyph_coverage
(
glyph_id
);
unsigned
int
index
=
(
this
+
coverage
)
(
glyph_id
);
if
(
NOT_COVERED
==
index
)
return
false
;
...
...
@@ -74,7 +66,8 @@ struct SingleSubstFormat1 {
private:
USHORT
substFormat
;
/* Format identifier--format = 1 */
Offset
coverage
;
/* Offset to Coverage table--from
OffsetTo
<
Coverage
>
coverage
;
/* Offset to Coverage table--from
* beginning of Substitution table */
SHORT
deltaGlyphID
;
/* Add to original GlyphID to get
* substitute GlyphID */
...
...
@@ -86,12 +79,10 @@ struct SingleSubstFormat2 {
friend
struct
SingleSubst
;
private:
DEFINE_GET_ACCESSOR
(
Coverage
,
coverage
,
coverage
);
DEFINE_GET_GLYPH_COVERAGE
(
glyph_coverage
);
inline
bool
single_substitute
(
hb_codepoint_t
&
glyph_id
)
const
{
unsigned
int
index
=
get_glyph_coverage
(
glyph_id
);
unsigned
int
index
=
(
this
+
coverage
)
(
glyph_id
);
if
(
index
>=
glyphCount
)
return
false
;
...
...
@@ -102,7 +93,8 @@ struct SingleSubstFormat2 {
private:
USHORT
substFormat
;
/* Format identifier--format = 2 */
Offset
coverage
;
/* Offset to Coverage table--from
OffsetTo
<
Coverage
>
coverage
;
/* Offset to Coverage table--from
* beginning of Substitution table */
USHORT
glyphCount
;
/* Number of GlyphIDs in the Substitute
* array */
...
...
@@ -209,8 +201,6 @@ struct MultipleSubstFormat1 {
private:
/* Sequence tables, in Coverage Index order */
DEFINE_OFFSET_ARRAY_TYPE
(
Sequence
,
sequence
,
sequenceCount
);
DEFINE_GET_ACCESSOR
(
Coverage
,
coverage
,
coverage
);
DEFINE_GET_GLYPH_COVERAGE
(
glyph_coverage
);
inline
bool
substitute
(
SUBTABLE_SUBSTITUTE_ARGS_DEF
)
const
{
...
...
@@ -220,7 +210,7 @@ struct MultipleSubstFormat1 {
hb_codepoint_t
glyph_id
=
IN_CURGLYPH
();
unsigned
int
index
=
get_glyph_coverage
(
glyph_id
);
unsigned
int
index
=
(
this
+
coverage
)
(
glyph_id
);
const
Sequence
&
seq
=
(
*
this
)[
index
];
return
seq
.
substitute_sequence
(
SUBTABLE_SUBSTITUTE_ARGS
,
property
);
...
...
@@ -228,7 +218,8 @@ struct MultipleSubstFormat1 {
private:
USHORT
substFormat
;
/* Format identifier--format = 1 */
Offset
coverage
;
/* Offset to Coverage table--from
OffsetTo
<
Coverage
>
coverage
;
/* Offset to Coverage table--from
* beginning of Substitution table */
USHORT
sequenceCount
;
/* Number of Sequence table offsets in
* the Sequence array */
...
...
@@ -281,8 +272,6 @@ struct AlternateSubstFormat1 {
private:
/* AlternateSet tables, in Coverage Index order */
DEFINE_OFFSET_ARRAY_TYPE
(
AlternateSet
,
alternateSet
,
alternateSetCount
);
DEFINE_GET_ACCESSOR
(
Coverage
,
coverage
,
coverage
);
DEFINE_GET_GLYPH_COVERAGE
(
glyph_coverage
);
inline
bool
substitute
(
SUBTABLE_SUBSTITUTE_ARGS_DEF
)
const
{
...
...
@@ -292,7 +281,7 @@ struct AlternateSubstFormat1 {
hb_codepoint_t
glyph_id
=
IN_CURGLYPH
();
unsigned
int
index
=
get_glyph_coverage
(
glyph_id
);
unsigned
int
index
=
(
this
+
coverage
)
(
glyph_id
);
const
AlternateSet
&
alt_set
=
(
*
this
)[
index
];
...
...
@@ -326,7 +315,8 @@ struct AlternateSubstFormat1 {
private:
USHORT
substFormat
;
/* Format identifier--format = 1 */
Offset
coverage
;
/* Offset to Coverage table--from
OffsetTo
<
Coverage
>
coverage
;
/* Offset to Coverage table--from
* beginning of Substitution table */
USHORT
alternateSetCount
;
/* Number of AlternateSet tables */
Offset
alternateSet
[];
/* Array of offsets to AlternateSet
...
...
@@ -475,8 +465,6 @@ struct LigatureSubstFormat1 {
private:
/* LigatureSet tables, in Coverage Index order */
DEFINE_OFFSET_ARRAY_TYPE
(
LigatureSet
,
ligatureSet
,
ligSetCount
);
DEFINE_GET_ACCESSOR
(
Coverage
,
coverage
,
coverage
);
DEFINE_GET_GLYPH_COVERAGE
(
glyph_coverage
);
inline
bool
substitute
(
SUBTABLE_SUBSTITUTE_ARGS_DEF
)
const
{
...
...
@@ -486,7 +474,7 @@ struct LigatureSubstFormat1 {
hb_codepoint_t
glyph_id
=
IN_CURGLYPH
();
unsigned
int
index
=
get_glyph_coverage
(
glyph_id
);
unsigned
int
index
=
(
this
+
coverage
)
(
glyph_id
);
bool
first_is_mark
=
(
property
==
HB_OT_LAYOUT_GLYPH_CLASS_MARK
||
property
&
LookupFlag
::
MarkAttachmentType
);
...
...
@@ -497,7 +485,8 @@ struct LigatureSubstFormat1 {
private:
USHORT
substFormat
;
/* Format identifier--format = 1 */
Offset
coverage
;
/* Offset to Coverage table--from
OffsetTo
<
Coverage
>
coverage
;
/* Offset to Coverage table--from
* beginning of Substitution table */
USHORT
ligSetCount
;
/* Number of LigatureSet tables */
Offset
ligatureSet
[];
/* Array of offsets to LigatureSet
...
...
@@ -648,8 +637,6 @@ struct ContextSubstFormat1 {
private:
/* SubRuleSet tables, in Coverage Index order */
DEFINE_OFFSET_ARRAY_TYPE
(
SubRuleSet
,
subRuleSet
,
subRuleSetCount
);
DEFINE_GET_ACCESSOR
(
Coverage
,
coverage
,
coverage
);
DEFINE_GET_GLYPH_COVERAGE
(
glyph_coverage
);
inline
bool
substitute
(
SUBTABLE_SUBSTITUTE_ARGS_DEF
)
const
{
...
...
@@ -659,7 +646,7 @@ struct ContextSubstFormat1 {
hb_codepoint_t
glyph_id
=
IN_CURGLYPH
();
unsigned
int
index
=
get_glyph_coverage
(
glyph_id
);
unsigned
int
index
=
(
this
+
coverage
)
(
glyph_id
);
const
SubRuleSet
&
rule_set
=
(
*
this
)[
index
];
return
rule_set
.
substitute
(
SUBTABLE_SUBSTITUTE_ARGS
);
...
...
@@ -667,7 +654,8 @@ struct ContextSubstFormat1 {
private:
USHORT
substFormat
;
/* Format identifier--format = 1 */
Offset
coverage
;
/* Offset to Coverage table--from
OffsetTo
<
Coverage
>
coverage
;
/* Offset to Coverage table--from
* beginning of Substitution table */
USHORT
subRuleSetCount
;
/* Number of SubRuleSet tables--must
* equal GlyphCount in Coverage table */
...
...
@@ -792,8 +780,6 @@ struct ContextSubstFormat2 {
private:
/* SubClassSet tables, in Coverage Index order */
DEFINE_OFFSET_ARRAY_TYPE
(
SubClassSet
,
subClassSet
,
subClassSetCnt
);
DEFINE_GET_ACCESSOR
(
Coverage
,
coverage
,
coverage
);
DEFINE_GET_GLYPH_COVERAGE
(
glyph_coverage
);
inline
bool
substitute
(
SUBTABLE_SUBSTITUTE_ARGS_DEF
)
const
{
...
...
@@ -803,7 +789,7 @@ struct ContextSubstFormat2 {
hb_codepoint_t
glyph_id
=
IN_CURGLYPH
();
unsigned
int
index
=
get_glyph_coverage
(
glyph_id
);
unsigned
int
index
=
(
this
+
coverage
)
(
glyph_id
);
const
SubClassSet
&
class_set
=
(
*
this
)[
index
];
return
class_set
.
substitute_class
(
SUBTABLE_SUBSTITUTE_ARGS
,
this
+
classDef
);
...
...
@@ -811,7 +797,8 @@ struct ContextSubstFormat2 {
private:
USHORT
substFormat
;
/* Format identifier--format = 2 */
Offset
coverage
;
/* Offset to Coverage table--from
OffsetTo
<
Coverage
>
coverage
;
/* Offset to Coverage table--from
* beginning of Substitution table */
OffsetTo
<
ClassDef
>
classDef
;
/* Offset to glyph ClassDef table--from
...
...
src/hb-ot-layout-open-private.h
浏览文件 @
238c855f
...
...
@@ -69,7 +69,7 @@
inline unsigned int get_len(void) const { return num; } \
/* An array type is one that contains a variable number of objects
* as its last item. An array object is extended with
len() and size
()
* as its last item. An array object is extended with
get_len
()
* methods, as well as overloaded [] operator. */
#define DEFINE_ARRAY_TYPE(Type, array, num) \
DEFINE_INDEX_OPERATOR(Type, array, num) \
...
...
@@ -237,14 +237,6 @@ struct Null <Type> { \
}
#define DEFINE_GET_ACCESSOR(Type, name, Name) \
inline const Type& get_##name (void) const { \
if (HB_UNLIKELY (!Name)) return Null(Type); \
return *(const Type*)((const char*)this + Name); \
}
/*
*
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录