Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
eb0dfc83
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
接近 2 年 前同步成功
通知
1
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看板
提交
eb0dfc83
编写于
5月 18, 2009
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[HB] Rename LOOKUP_ARGS to APPLY_ARGS
上级
2a8e6acc
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
131 addition
and
131 deletion
+131
-131
src/hb-ot-layout-gpos-private.h
src/hb-ot-layout-gpos-private.h
+44
-44
src/hb-ot-layout-gsub-private.h
src/hb-ot-layout-gsub-private.h
+42
-42
src/hb-ot-layout-gsubgpos-private.h
src/hb-ot-layout-gsubgpos-private.h
+45
-45
未找到文件。
src/hb-ot-layout-gpos-private.h
浏览文件 @
eb0dfc83
...
@@ -211,7 +211,7 @@ struct SinglePosFormat1 {
...
@@ -211,7 +211,7 @@ struct SinglePosFormat1 {
friend
struct
SinglePos
;
friend
struct
SinglePos
;
private:
private:
inline
bool
apply
(
LOOKUP_ARGS
_DEF
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
)
const
{
/* TODO */
/* TODO */
return
false
;
return
false
;
}
}
...
@@ -234,7 +234,7 @@ struct SinglePosFormat2 {
...
@@ -234,7 +234,7 @@ struct SinglePosFormat2 {
friend
struct
SinglePos
;
friend
struct
SinglePos
;
private:
private:
inline
bool
apply
(
LOOKUP_ARGS
_DEF
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
)
const
{
/* TODO */
/* TODO */
return
false
;
return
false
;
}
}
...
@@ -258,10 +258,10 @@ struct SinglePos {
...
@@ -258,10 +258,10 @@ struct SinglePos {
private:
private:
inline
bool
apply
(
LOOKUP_ARGS
_DEF
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
)
const
{
switch
(
u
.
format
)
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
->
apply
(
LOOKUP_ARGS
);
case
1
:
return
u
.
format1
->
apply
(
APPLY_ARG
);
case
2
:
return
u
.
format2
->
apply
(
LOOKUP_ARGS
);
case
2
:
return
u
.
format2
->
apply
(
APPLY_ARG
);
default:
return
false
;
default:
return
false
;
}
}
}
}
...
@@ -297,7 +297,7 @@ struct PairPosFormat1 {
...
@@ -297,7 +297,7 @@ struct PairPosFormat1 {
friend
struct
PairPos
;
friend
struct
PairPos
;
private:
private:
inline
bool
apply
(
LOOKUP_ARGS
_DEF
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
)
const
{
/* TODO */
/* TODO */
return
false
;
return
false
;
}
}
...
@@ -324,7 +324,7 @@ struct PairPosFormat2 {
...
@@ -324,7 +324,7 @@ struct PairPosFormat2 {
friend
struct
PairPos
;
friend
struct
PairPos
;
private:
private:
inline
bool
apply
(
LOOKUP_ARGS
_DEF
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
)
const
{
/* TODO */
/* TODO */
return
false
;
return
false
;
}
}
...
@@ -364,10 +364,10 @@ struct PairPos {
...
@@ -364,10 +364,10 @@ struct PairPos {
private:
private:
inline
bool
apply
(
LOOKUP_ARGS
_DEF
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
)
const
{
switch
(
u
.
format
)
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
->
apply
(
LOOKUP_ARGS
);
case
1
:
return
u
.
format1
->
apply
(
APPLY_ARG
);
case
2
:
return
u
.
format2
->
apply
(
LOOKUP_ARGS
);
case
2
:
return
u
.
format2
->
apply
(
APPLY_ARG
);
default:
return
false
;
default:
return
false
;
}
}
}
}
...
@@ -402,7 +402,7 @@ struct CursivePosFormat1 {
...
@@ -402,7 +402,7 @@ struct CursivePosFormat1 {
friend
struct
CursivePos
;
friend
struct
CursivePos
;
private:
private:
inline
bool
apply
(
LOOKUP_ARGS
_DEF
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
)
const
{
/* TODO */
/* TODO */
return
false
;
return
false
;
}
}
...
@@ -424,9 +424,9 @@ struct CursivePos {
...
@@ -424,9 +424,9 @@ struct CursivePos {
private:
private:
inline
bool
apply
(
LOOKUP_ARGS
_DEF
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
)
const
{
switch
(
u
.
format
)
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
->
apply
(
LOOKUP_ARGS
);
case
1
:
return
u
.
format1
->
apply
(
APPLY_ARG
);
default:
return
false
;
default:
return
false
;
}
}
}
}
...
@@ -466,7 +466,7 @@ struct MarkBasePosFormat1 {
...
@@ -466,7 +466,7 @@ struct MarkBasePosFormat1 {
friend
struct
MarkBasePos
;
friend
struct
MarkBasePos
;
private:
private:
inline
bool
apply
(
LOOKUP_ARGS
_DEF
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
)
const
{
/* TODO */
/* TODO */
return
false
;
return
false
;
}
}
...
@@ -492,9 +492,9 @@ struct MarkBasePos {
...
@@ -492,9 +492,9 @@ struct MarkBasePos {
private:
private:
inline
bool
apply
(
LOOKUP_ARGS
_DEF
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
)
const
{
switch
(
u
.
format
)
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
->
apply
(
LOOKUP_ARGS
);
case
1
:
return
u
.
format1
->
apply
(
APPLY_ARG
);
default:
return
false
;
default:
return
false
;
}
}
}
}
...
@@ -551,7 +551,7 @@ struct MarkLigPosFormat1 {
...
@@ -551,7 +551,7 @@ struct MarkLigPosFormat1 {
friend
struct
MarkLigPos
;
friend
struct
MarkLigPos
;
private:
private:
inline
bool
apply
(
LOOKUP_ARGS
_DEF
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
)
const
{
/* TODO */
/* TODO */
return
false
;
return
false
;
}
}
...
@@ -577,9 +577,9 @@ struct MarkLigPos {
...
@@ -577,9 +577,9 @@ struct MarkLigPos {
private:
private:
inline
bool
apply
(
LOOKUP_ARGS
_DEF
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
)
const
{
switch
(
u
.
format
)
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
->
apply
(
LOOKUP_ARGS
);
case
1
:
return
u
.
format1
->
apply
(
APPLY_ARG
);
default:
return
false
;
default:
return
false
;
}
}
}
}
...
@@ -618,7 +618,7 @@ struct MarkMarkPosFormat1 {
...
@@ -618,7 +618,7 @@ struct MarkMarkPosFormat1 {
friend
struct
MarkMarkPos
;
friend
struct
MarkMarkPos
;
private:
private:
inline
bool
apply
(
LOOKUP_ARGS
_DEF
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
)
const
{
/* TODO */
/* TODO */
return
false
;
return
false
;
}
}
...
@@ -644,9 +644,9 @@ struct MarkMarkPos {
...
@@ -644,9 +644,9 @@ struct MarkMarkPos {
private:
private:
inline
bool
apply
(
LOOKUP_ARGS
_DEF
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
)
const
{
switch
(
u
.
format
)
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
->
apply
(
LOOKUP_ARGS
);
case
1
:
return
u
.
format1
->
apply
(
APPLY_ARG
);
default:
return
false
;
default:
return
false
;
}
}
}
}
...
@@ -660,20 +660,20 @@ struct MarkMarkPos {
...
@@ -660,20 +660,20 @@ struct MarkMarkPos {
ASSERT_SIZE
(
MarkMarkPos
,
2
);
ASSERT_SIZE
(
MarkMarkPos
,
2
);
static
inline
bool
position_lookup
(
LOOKUP_ARGS
_DEF
,
unsigned
int
lookup_index
);
static
inline
bool
position_lookup
(
APPLY_ARG
_DEF
,
unsigned
int
lookup_index
);
struct
ContextPos
:
Context
{
struct
ContextPos
:
Context
{
inline
bool
apply
(
LOOKUP_ARGS
_DEF
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
)
const
{
return
Context
::
apply
(
LOOKUP_ARGS
,
position_lookup
);
return
Context
::
apply
(
APPLY_ARG
,
position_lookup
);
}
}
};
};
ASSERT_SIZE
(
ContextPos
,
2
);
ASSERT_SIZE
(
ContextPos
,
2
);
struct
ChainContextPos
:
ChainContext
{
struct
ChainContextPos
:
ChainContext
{
inline
bool
apply
(
LOOKUP_ARGS
_DEF
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
)
const
{
return
ChainContext
::
apply
(
LOOKUP_ARGS
,
position_lookup
);
return
ChainContext
::
apply
(
APPLY_ARG
,
position_lookup
);
}
}
};
};
ASSERT_SIZE
(
ChainContextPos
,
2
);
ASSERT_SIZE
(
ChainContextPos
,
2
);
...
@@ -686,7 +686,7 @@ struct ExtensionPosFormat1 {
...
@@ -686,7 +686,7 @@ struct ExtensionPosFormat1 {
private:
private:
inline
unsigned
int
get_type
(
void
)
const
{
return
extensionLookupType
;
}
inline
unsigned
int
get_type
(
void
)
const
{
return
extensionLookupType
;
}
inline
unsigned
int
get_offset
(
void
)
const
{
return
(
extensionOffset
[
0
]
<<
16
)
+
extensionOffset
[
1
];
}
inline
unsigned
int
get_offset
(
void
)
const
{
return
(
extensionOffset
[
0
]
<<
16
)
+
extensionOffset
[
1
];
}
inline
bool
apply
(
LOOKUP_ARGS
_DEF
)
const
;
inline
bool
apply
(
APPLY_ARG
_DEF
)
const
;
private:
private:
USHORT
format
;
/* Format identifier. Set to 1. */
USHORT
format
;
/* Format identifier. Set to 1. */
...
@@ -714,9 +714,9 @@ struct ExtensionPos {
...
@@ -714,9 +714,9 @@ struct ExtensionPos {
}
}
}
}
inline
bool
apply
(
LOOKUP_ARGS
_DEF
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
)
const
{
switch
(
u
.
format
)
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
->
apply
(
LOOKUP_ARGS
);
case
1
:
return
u
.
format1
->
apply
(
APPLY_ARG
);
default:
return
false
;
default:
return
false
;
}
}
}
}
...
@@ -751,18 +751,18 @@ struct PosLookupSubTable {
...
@@ -751,18 +751,18 @@ struct PosLookupSubTable {
friend
struct
PosLookup
;
friend
struct
PosLookup
;
inline
bool
apply
(
LOOKUP_ARGS
_DEF
,
unsigned
int
lookup_type
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
,
unsigned
int
lookup_type
)
const
{
switch
(
lookup_type
)
{
switch
(
lookup_type
)
{
case
GPOS_Single
:
return
u
.
single
->
apply
(
LOOKUP_ARGS
);
case
GPOS_Single
:
return
u
.
single
->
apply
(
APPLY_ARG
);
case
GPOS_Pair
:
return
u
.
pair
->
apply
(
LOOKUP_ARGS
);
case
GPOS_Pair
:
return
u
.
pair
->
apply
(
APPLY_ARG
);
case
GPOS_Cursive
:
return
u
.
cursive
->
apply
(
LOOKUP_ARGS
);
case
GPOS_Cursive
:
return
u
.
cursive
->
apply
(
APPLY_ARG
);
case
GPOS_MarkBase
:
return
u
.
markBase
->
apply
(
LOOKUP_ARGS
);
case
GPOS_MarkBase
:
return
u
.
markBase
->
apply
(
APPLY_ARG
);
case
GPOS_MarkLig
:
return
u
.
markLig
->
apply
(
LOOKUP_ARGS
);
case
GPOS_MarkLig
:
return
u
.
markLig
->
apply
(
APPLY_ARG
);
case
GPOS_MarkMark
:
return
u
.
markMark
->
apply
(
LOOKUP_ARGS
);
case
GPOS_MarkMark
:
return
u
.
markMark
->
apply
(
APPLY_ARG
);
case
GPOS_Context
:
return
u
.
context
->
apply
(
LOOKUP_ARGS
);
case
GPOS_Context
:
return
u
.
context
->
apply
(
APPLY_ARG
);
case
GPOS_ChainContext
:
return
u
.
chainContext
->
apply
(
LOOKUP_ARGS
);
case
GPOS_ChainContext
:
return
u
.
chainContext
->
apply
(
APPLY_ARG
);
case
GPOS_Extension
:
return
u
.
extension
->
apply
(
LOOKUP_ARGS
);
case
GPOS_Extension
:
return
u
.
extension
->
apply
(
APPLY_ARG
);
default:
return
false
;
default:
return
false
;
}
}
}
}
...
@@ -817,7 +817,7 @@ struct PosLookup : Lookup {
...
@@ -817,7 +817,7 @@ struct PosLookup : Lookup {
unsigned
int
lookup_flag
=
get_flag
();
unsigned
int
lookup_flag
=
get_flag
();
for
(
unsigned
int
i
=
0
;
i
<
get_subtable_count
();
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
get_subtable_count
();
i
++
)
if
(
get_subtable
(
i
).
apply
(
LOOKUP_ARGS
,
lookup_type
))
if
(
get_subtable
(
i
).
apply
(
APPLY_ARG
,
lookup_type
))
return
true
;
return
true
;
return
false
;
return
false
;
...
@@ -896,16 +896,16 @@ ASSERT_SIZE (GPOS, 10);
...
@@ -896,16 +896,16 @@ ASSERT_SIZE (GPOS, 10);
/* Out-of-class implementation for methods recursing */
/* Out-of-class implementation for methods recursing */
inline
bool
ExtensionPosFormat1
::
apply
(
LOOKUP_ARGS
_DEF
)
const
{
inline
bool
ExtensionPosFormat1
::
apply
(
APPLY_ARG
_DEF
)
const
{
unsigned
int
lookup_type
=
get_type
();
unsigned
int
lookup_type
=
get_type
();
if
(
HB_UNLIKELY
(
lookup_type
==
GPOS_Extension
))
if
(
HB_UNLIKELY
(
lookup_type
==
GPOS_Extension
))
return
false
;
return
false
;
return
((
PosLookupSubTable
&
)
*
(((
char
*
)
this
)
+
get_offset
())).
apply
(
LOOKUP_ARGS
,
lookup_type
);
return
((
PosLookupSubTable
&
)
*
(((
char
*
)
this
)
+
get_offset
())).
apply
(
APPLY_ARG
,
lookup_type
);
}
}
static
inline
bool
position_lookup
(
LOOKUP_ARGS
_DEF
,
unsigned
int
lookup_index
)
{
static
inline
bool
position_lookup
(
APPLY_ARG
_DEF
,
unsigned
int
lookup_index
)
{
const
GPOS
&
gpos
=
*
(
layout
->
gpos
);
const
GPOS
&
gpos
=
*
(
layout
->
gpos
);
const
PosLookup
&
l
=
gpos
.
get_lookup
(
lookup_index
);
const
PosLookup
&
l
=
gpos
.
get_lookup
(
lookup_index
);
...
...
src/hb-ot-layout-gsub-private.h
浏览文件 @
eb0dfc83
...
@@ -111,7 +111,7 @@ struct SingleSubst {
...
@@ -111,7 +111,7 @@ struct SingleSubst {
}
}
}
}
inline
bool
apply
(
LOOKUP_ARGS
_DEF
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
)
const
{
hb_codepoint_t
glyph_id
=
IN_CURGLYPH
();
hb_codepoint_t
glyph_id
=
IN_CURGLYPH
();
...
@@ -152,7 +152,7 @@ struct Sequence {
...
@@ -152,7 +152,7 @@ struct Sequence {
_hb_ot_layout_set_glyph_property
(
layout
,
substitute
[
n
],
property
);
_hb_ot_layout_set_glyph_property
(
layout
,
substitute
[
n
],
property
);
}
}
inline
bool
apply
(
LOOKUP_ARGS
_DEF
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
)
const
{
if
(
HB_UNLIKELY
(
!
substitute
.
len
))
if
(
HB_UNLIKELY
(
!
substitute
.
len
))
return
false
;
return
false
;
...
@@ -186,13 +186,13 @@ struct MultipleSubstFormat1 {
...
@@ -186,13 +186,13 @@ struct MultipleSubstFormat1 {
private:
private:
inline
bool
apply
(
LOOKUP_ARGS
_DEF
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
)
const
{
unsigned
int
index
=
(
this
+
coverage
)
(
IN_CURGLYPH
());
unsigned
int
index
=
(
this
+
coverage
)
(
IN_CURGLYPH
());
if
(
HB_LIKELY
(
index
==
NOT_COVERED
))
if
(
HB_LIKELY
(
index
==
NOT_COVERED
))
return
false
;
return
false
;
return
(
this
+
sequence
[
index
]).
apply
(
LOOKUP_ARGS
);
return
(
this
+
sequence
[
index
]).
apply
(
APPLY_ARG
);
}
}
private:
private:
...
@@ -212,9 +212,9 @@ struct MultipleSubst {
...
@@ -212,9 +212,9 @@ struct MultipleSubst {
private:
private:
inline
bool
apply
(
LOOKUP_ARGS
_DEF
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
)
const
{
switch
(
u
.
format
)
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
->
apply
(
LOOKUP_ARGS
);
case
1
:
return
u
.
format1
->
apply
(
APPLY_ARG
);
default:
return
false
;
default:
return
false
;
}
}
}
}
...
@@ -238,7 +238,7 @@ struct AlternateSubstFormat1 {
...
@@ -238,7 +238,7 @@ struct AlternateSubstFormat1 {
private:
private:
inline
bool
apply
(
LOOKUP_ARGS
_DEF
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
)
const
{
hb_codepoint_t
glyph_id
=
IN_CURGLYPH
();
hb_codepoint_t
glyph_id
=
IN_CURGLYPH
();
...
@@ -293,9 +293,9 @@ struct AlternateSubst {
...
@@ -293,9 +293,9 @@ struct AlternateSubst {
private:
private:
inline
bool
apply
(
LOOKUP_ARGS
_DEF
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
)
const
{
switch
(
u
.
format
)
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
->
apply
(
LOOKUP_ARGS
);
case
1
:
return
u
.
format1
->
apply
(
APPLY_ARG
);
default:
return
false
;
default:
return
false
;
}
}
}
}
...
@@ -314,7 +314,7 @@ struct Ligature {
...
@@ -314,7 +314,7 @@ struct Ligature {
friend
struct
LigatureSet
;
friend
struct
LigatureSet
;
private:
private:
inline
bool
apply
(
LOOKUP_ARGS
_DEF
,
bool
is_mark
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
,
bool
is_mark
)
const
{
unsigned
int
i
,
j
;
unsigned
int
i
,
j
;
unsigned
int
count
=
component
.
len
;
unsigned
int
count
=
component
.
len
;
...
@@ -393,12 +393,12 @@ struct LigatureSet {
...
@@ -393,12 +393,12 @@ struct LigatureSet {
private:
private:
inline
bool
apply
(
LOOKUP_ARGS
_DEF
,
bool
is_mark
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
,
bool
is_mark
)
const
{
unsigned
int
num_ligs
=
ligature
.
len
;
unsigned
int
num_ligs
=
ligature
.
len
;
for
(
unsigned
int
i
=
0
;
i
<
num_ligs
;
i
++
)
{
for
(
unsigned
int
i
=
0
;
i
<
num_ligs
;
i
++
)
{
const
Ligature
&
lig
=
this
+
ligature
[
i
];
const
Ligature
&
lig
=
this
+
ligature
[
i
];
if
(
lig
.
apply
(
LOOKUP_ARGS
,
is_mark
))
if
(
lig
.
apply
(
APPLY_ARG
,
is_mark
))
return
true
;
return
true
;
}
}
...
@@ -418,7 +418,7 @@ struct LigatureSubstFormat1 {
...
@@ -418,7 +418,7 @@ struct LigatureSubstFormat1 {
private:
private:
inline
bool
apply
(
LOOKUP_ARGS
_DEF
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
)
const
{
hb_codepoint_t
glyph_id
=
IN_CURGLYPH
();
hb_codepoint_t
glyph_id
=
IN_CURGLYPH
();
...
@@ -430,7 +430,7 @@ struct LigatureSubstFormat1 {
...
@@ -430,7 +430,7 @@ struct LigatureSubstFormat1 {
return
false
;
return
false
;
const
LigatureSet
&
lig_set
=
this
+
ligatureSet
[
index
];
const
LigatureSet
&
lig_set
=
this
+
ligatureSet
[
index
];
return
lig_set
.
apply
(
LOOKUP_ARGS
,
first_is_mark
);
return
lig_set
.
apply
(
APPLY_ARG
,
first_is_mark
);
}
}
private:
private:
...
@@ -450,9 +450,9 @@ struct LigatureSubst {
...
@@ -450,9 +450,9 @@ struct LigatureSubst {
private:
private:
inline
bool
apply
(
LOOKUP_ARGS
_DEF
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
)
const
{
switch
(
u
.
format
)
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
->
apply
(
LOOKUP_ARGS
);
case
1
:
return
u
.
format1
->
apply
(
APPLY_ARG
);
default:
return
false
;
default:
return
false
;
}
}
}
}
...
@@ -467,20 +467,20 @@ ASSERT_SIZE (LigatureSubst, 2);
...
@@ -467,20 +467,20 @@ ASSERT_SIZE (LigatureSubst, 2);
static
inline
bool
substitute_lookup
(
LOOKUP_ARGS
_DEF
,
unsigned
int
lookup_index
);
static
inline
bool
substitute_lookup
(
APPLY_ARG
_DEF
,
unsigned
int
lookup_index
);
struct
ContextSubst
:
Context
{
struct
ContextSubst
:
Context
{
inline
bool
apply
(
LOOKUP_ARGS
_DEF
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
)
const
{
return
Context
::
apply
(
LOOKUP_ARGS
,
substitute_lookup
);
return
Context
::
apply
(
APPLY_ARG
,
substitute_lookup
);
}
}
};
};
ASSERT_SIZE
(
ContextSubst
,
2
);
ASSERT_SIZE
(
ContextSubst
,
2
);
struct
ChainContextSubst
:
ChainContext
{
struct
ChainContextSubst
:
ChainContext
{
inline
bool
apply
(
LOOKUP_ARGS
_DEF
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
)
const
{
return
ChainContext
::
apply
(
LOOKUP_ARGS
,
substitute_lookup
);
return
ChainContext
::
apply
(
APPLY_ARG
,
substitute_lookup
);
}
}
};
};
ASSERT_SIZE
(
ChainContextSubst
,
2
);
ASSERT_SIZE
(
ChainContextSubst
,
2
);
...
@@ -493,7 +493,7 @@ struct ExtensionSubstFormat1 {
...
@@ -493,7 +493,7 @@ struct ExtensionSubstFormat1 {
private:
private:
inline
unsigned
int
get_type
(
void
)
const
{
return
extensionLookupType
;
}
inline
unsigned
int
get_type
(
void
)
const
{
return
extensionLookupType
;
}
inline
unsigned
int
get_offset
(
void
)
const
{
return
(
extensionOffset
[
0
]
<<
16
)
+
extensionOffset
[
1
];
}
inline
unsigned
int
get_offset
(
void
)
const
{
return
(
extensionOffset
[
0
]
<<
16
)
+
extensionOffset
[
1
];
}
inline
bool
apply
(
LOOKUP_ARGS
_DEF
)
const
;
inline
bool
apply
(
APPLY_ARG
_DEF
)
const
;
private:
private:
USHORT
format
;
/* Format identifier. Set to 1. */
USHORT
format
;
/* Format identifier. Set to 1. */
...
@@ -521,9 +521,9 @@ struct ExtensionSubst {
...
@@ -521,9 +521,9 @@ struct ExtensionSubst {
}
}
}
}
inline
bool
apply
(
LOOKUP_ARGS
_DEF
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
)
const
{
switch
(
u
.
format
)
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
->
apply
(
LOOKUP_ARGS
);
case
1
:
return
u
.
format1
->
apply
(
APPLY_ARG
);
default:
return
false
;
default:
return
false
;
}
}
}
}
...
@@ -542,7 +542,7 @@ struct ReverseChainSingleSubstFormat1 {
...
@@ -542,7 +542,7 @@ struct ReverseChainSingleSubstFormat1 {
friend
struct
ReverseChainSingleSubst
;
friend
struct
ReverseChainSingleSubst
;
private:
private:
inline
bool
apply
(
LOOKUP_ARGS
_DEF
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
)
const
{
if
(
HB_UNLIKELY
(
context_length
!=
NO_CONTEXT
))
if
(
HB_UNLIKELY
(
context_length
!=
NO_CONTEXT
))
return
false
;
/* No chaining to this type */
return
false
;
/* No chaining to this type */
...
@@ -556,10 +556,10 @@ struct ReverseChainSingleSubstFormat1 {
...
@@ -556,10 +556,10 @@ struct ReverseChainSingleSubstFormat1 {
const
ArrayOf
<
GlyphID
>
&
substitute
=
*
(
const
ArrayOf
<
GlyphID
>
*
)
const
ArrayOf
<
GlyphID
>
&
substitute
=
*
(
const
ArrayOf
<
GlyphID
>
*
)
((
const
char
*
)
&
lookahead
+
lookahead
.
get_size
());
((
const
char
*
)
&
lookahead
+
lookahead
.
get_size
());
if
(
match_backtrack
(
LOOKUP_ARGS
,
if
(
match_backtrack
(
APPLY_ARG
,
backtrack
.
len
,
(
USHORT
*
)
backtrack
.
array
,
backtrack
.
len
,
(
USHORT
*
)
backtrack
.
array
,
match_coverage
,
(
char
*
)
this
)
&&
match_coverage
,
(
char
*
)
this
)
&&
match_lookahead
(
LOOKUP_ARGS
,
match_lookahead
(
APPLY_ARG
,
lookahead
.
len
,
(
USHORT
*
)
lookahead
.
array
,
lookahead
.
len
,
(
USHORT
*
)
lookahead
.
array
,
match_coverage
,
(
char
*
)
this
,
match_coverage
,
(
char
*
)
this
,
1
))
1
))
...
@@ -597,9 +597,9 @@ struct ReverseChainSingleSubst {
...
@@ -597,9 +597,9 @@ struct ReverseChainSingleSubst {
private:
private:
inline
bool
apply
(
LOOKUP_ARGS
_DEF
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
)
const
{
switch
(
u
.
format
)
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
->
apply
(
LOOKUP_ARGS
);
case
1
:
return
u
.
format1
->
apply
(
APPLY_ARG
);
default:
return
false
;
default:
return
false
;
}
}
}
}
...
@@ -633,17 +633,17 @@ struct SubstLookupSubTable {
...
@@ -633,17 +633,17 @@ struct SubstLookupSubTable {
friend
struct
SubstLookup
;
friend
struct
SubstLookup
;
inline
bool
apply
(
LOOKUP_ARGS
_DEF
,
unsigned
int
lookup_type
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
,
unsigned
int
lookup_type
)
const
{
switch
(
lookup_type
)
{
switch
(
lookup_type
)
{
case
GSUB_Single
:
return
u
.
single
->
apply
(
LOOKUP_ARGS
);
case
GSUB_Single
:
return
u
.
single
->
apply
(
APPLY_ARG
);
case
GSUB_Multiple
:
return
u
.
multiple
->
apply
(
LOOKUP_ARGS
);
case
GSUB_Multiple
:
return
u
.
multiple
->
apply
(
APPLY_ARG
);
case
GSUB_Alternate
:
return
u
.
alternate
->
apply
(
LOOKUP_ARGS
);
case
GSUB_Alternate
:
return
u
.
alternate
->
apply
(
APPLY_ARG
);
case
GSUB_Ligature
:
return
u
.
ligature
->
apply
(
LOOKUP_ARGS
);
case
GSUB_Ligature
:
return
u
.
ligature
->
apply
(
APPLY_ARG
);
case
GSUB_Context
:
return
u
.
context
->
apply
(
LOOKUP_ARGS
);
case
GSUB_Context
:
return
u
.
context
->
apply
(
APPLY_ARG
);
case
GSUB_ChainContext
:
return
u
.
chainContext
->
apply
(
LOOKUP_ARGS
);
case
GSUB_ChainContext
:
return
u
.
chainContext
->
apply
(
APPLY_ARG
);
case
GSUB_Extension
:
return
u
.
extension
->
apply
(
LOOKUP_ARGS
);
case
GSUB_Extension
:
return
u
.
extension
->
apply
(
APPLY_ARG
);
case
GSUB_ReverseChainSingle
:
return
u
.
reverseChainContextSingle
->
apply
(
LOOKUP_ARGS
);
case
GSUB_ReverseChainSingle
:
return
u
.
reverseChainContextSingle
->
apply
(
APPLY_ARG
);
default:
return
false
;
default:
return
false
;
}
}
}
}
...
@@ -704,7 +704,7 @@ struct SubstLookup : Lookup {
...
@@ -704,7 +704,7 @@ struct SubstLookup : Lookup {
unsigned
int
lookup_flag
=
get_flag
();
unsigned
int
lookup_flag
=
get_flag
();
for
(
unsigned
int
i
=
0
;
i
<
get_subtable_count
();
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
get_subtable_count
();
i
++
)
if
(
get_subtable
(
i
).
apply
(
LOOKUP_ARGS
,
lookup_type
))
if
(
get_subtable
(
i
).
apply
(
APPLY_ARG
,
lookup_type
))
return
true
;
return
true
;
return
false
;
return
false
;
...
@@ -795,16 +795,16 @@ ASSERT_SIZE (GSUB, 10);
...
@@ -795,16 +795,16 @@ ASSERT_SIZE (GSUB, 10);
/* Out-of-class implementation for methods recursing */
/* Out-of-class implementation for methods recursing */
inline
bool
ExtensionSubstFormat1
::
apply
(
LOOKUP_ARGS
_DEF
)
const
{
inline
bool
ExtensionSubstFormat1
::
apply
(
APPLY_ARG
_DEF
)
const
{
unsigned
int
lookup_type
=
get_type
();
unsigned
int
lookup_type
=
get_type
();
if
(
HB_UNLIKELY
(
lookup_type
==
GSUB_Extension
))
if
(
HB_UNLIKELY
(
lookup_type
==
GSUB_Extension
))
return
false
;
return
false
;
return
((
SubstLookupSubTable
&
)
*
(((
char
*
)
this
)
+
get_offset
())).
apply
(
LOOKUP_ARGS
,
lookup_type
);
return
((
SubstLookupSubTable
&
)
*
(((
char
*
)
this
)
+
get_offset
())).
apply
(
APPLY_ARG
,
lookup_type
);
}
}
static
inline
bool
substitute_lookup
(
LOOKUP_ARGS
_DEF
,
unsigned
int
lookup_index
)
{
static
inline
bool
substitute_lookup
(
APPLY_ARG
_DEF
,
unsigned
int
lookup_index
)
{
const
GSUB
&
gsub
=
*
(
layout
->
gsub
);
const
GSUB
&
gsub
=
*
(
layout
->
gsub
);
const
SubstLookup
&
l
=
gsub
.
get_lookup
(
lookup_index
);
const
SubstLookup
&
l
=
gsub
.
get_lookup
(
lookup_index
);
...
...
src/hb-ot-layout-gsubgpos-private.h
浏览文件 @
eb0dfc83
...
@@ -31,14 +31,14 @@
...
@@ -31,14 +31,14 @@
#include "harfbuzz-buffer-private.h"
/* XXX */
#include "harfbuzz-buffer-private.h"
/* XXX */
#define
LOOKUP_ARGS
_DEF \
#define
APPLY_ARG
_DEF \
hb_ot_layout_t *layout, \
hb_ot_layout_t *layout, \
hb_buffer_t *buffer, \
hb_buffer_t *buffer, \
unsigned int context_length HB_GNUC_UNUSED, \
unsigned int context_length HB_GNUC_UNUSED, \
unsigned int nesting_level_left HB_GNUC_UNUSED, \
unsigned int nesting_level_left HB_GNUC_UNUSED, \
unsigned int lookup_flag, \
unsigned int lookup_flag, \
unsigned int property HB_GNUC_UNUSED
/* propety of first glyph */
unsigned int property HB_GNUC_UNUSED
/* propety of first glyph */
#define
LOOKUP_ARGS
\
#define
APPLY_ARG
\
layout, \
layout, \
buffer, \
buffer, \
context_length, \
context_length, \
...
@@ -48,7 +48,7 @@
...
@@ -48,7 +48,7 @@
typedef
bool
(
*
match_func_t
)
(
hb_codepoint_t
glyph_id
,
const
USHORT
&
value
,
char
*
data
);
typedef
bool
(
*
match_func_t
)
(
hb_codepoint_t
glyph_id
,
const
USHORT
&
value
,
char
*
data
);
typedef
bool
(
*
apply_lookup_func_t
)
(
LOOKUP_ARGS
_DEF
,
unsigned
int
lookup_index
);
typedef
bool
(
*
apply_lookup_func_t
)
(
APPLY_ARG
_DEF
,
unsigned
int
lookup_index
);
struct
ContextFuncs
{
struct
ContextFuncs
{
match_func_t
match
;
match_func_t
match
;
...
@@ -71,7 +71,7 @@ static inline bool match_coverage (hb_codepoint_t glyph_id, const USHORT &value,
...
@@ -71,7 +71,7 @@ static inline bool match_coverage (hb_codepoint_t glyph_id, const USHORT &value,
}
}
static
inline
bool
match_input
(
LOOKUP_ARGS
_DEF
,
static
inline
bool
match_input
(
APPLY_ARG
_DEF
,
unsigned
int
count
,
/* Including the first glyph (not matched) */
unsigned
int
count
,
/* Including the first glyph (not matched) */
const
USHORT
input
[],
/* Array of input values--start with second glyph */
const
USHORT
input
[],
/* Array of input values--start with second glyph */
match_func_t
match_func
,
match_func_t
match_func
,
...
@@ -99,7 +99,7 @@ static inline bool match_input (LOOKUP_ARGS_DEF,
...
@@ -99,7 +99,7 @@ static inline bool match_input (LOOKUP_ARGS_DEF,
return
true
;
return
true
;
}
}
static
inline
bool
match_backtrack
(
LOOKUP_ARGS
_DEF
,
static
inline
bool
match_backtrack
(
APPLY_ARG
_DEF
,
unsigned
int
count
,
unsigned
int
count
,
const
USHORT
backtrack
[],
const
USHORT
backtrack
[],
match_func_t
match_func
,
match_func_t
match_func
,
...
@@ -122,7 +122,7 @@ static inline bool match_backtrack (LOOKUP_ARGS_DEF,
...
@@ -122,7 +122,7 @@ static inline bool match_backtrack (LOOKUP_ARGS_DEF,
return
true
;
return
true
;
}
}
static
inline
bool
match_lookahead
(
LOOKUP_ARGS
_DEF
,
static
inline
bool
match_lookahead
(
APPLY_ARG
_DEF
,
unsigned
int
count
,
unsigned
int
count
,
const
USHORT
lookahead
[],
const
USHORT
lookahead
[],
match_func_t
match_func
,
match_func_t
match_func
,
...
@@ -158,7 +158,7 @@ struct LookupRecord {
...
@@ -158,7 +158,7 @@ struct LookupRecord {
};
};
ASSERT_SIZE
(
LookupRecord
,
4
);
ASSERT_SIZE
(
LookupRecord
,
4
);
static
inline
bool
apply_lookup
(
LOOKUP_ARGS
_DEF
,
static
inline
bool
apply_lookup
(
APPLY_ARG
_DEF
,
unsigned
int
count
,
/* Including the first glyph */
unsigned
int
count
,
/* Including the first glyph */
unsigned
int
lookupCount
,
unsigned
int
lookupCount
,
const
LookupRecord
lookupRecord
[],
/* Array of LookupRecords--in design order */
const
LookupRecord
lookupRecord
[],
/* Array of LookupRecords--in design order */
...
@@ -183,7 +183,7 @@ static inline bool apply_lookup (LOOKUP_ARGS_DEF,
...
@@ -183,7 +183,7 @@ static inline bool apply_lookup (LOOKUP_ARGS_DEF,
unsigned
int
old_pos
=
buffer
->
in_pos
;
unsigned
int
old_pos
=
buffer
->
in_pos
;
/* Apply a lookup */
/* Apply a lookup */
bool
done
=
apply_func
(
LOOKUP_ARGS
,
lookupRecord
->
lookupListIndex
);
bool
done
=
apply_func
(
APPLY_ARG
,
lookupRecord
->
lookupListIndex
);
lookupRecord
++
;
lookupRecord
++
;
lookupCount
--
;
lookupCount
--
;
...
@@ -214,18 +214,18 @@ struct ContextLookupContext {
...
@@ -214,18 +214,18 @@ struct ContextLookupContext {
char
*
match_data
;
char
*
match_data
;
};
};
static
inline
bool
context_lookup
(
LOOKUP_ARGS
_DEF
,
static
inline
bool
context_lookup
(
APPLY_ARG
_DEF
,
unsigned
int
inputCount
,
/* Including the first glyph (not matched) */
unsigned
int
inputCount
,
/* Including the first glyph (not matched) */
const
USHORT
input
[],
/* Array of input values--start with second glyph */
const
USHORT
input
[],
/* Array of input values--start with second glyph */
unsigned
int
lookupCount
,
unsigned
int
lookupCount
,
const
LookupRecord
lookupRecord
[],
const
LookupRecord
lookupRecord
[],
ContextLookupContext
&
context
)
ContextLookupContext
&
context
)
{
{
return
match_input
(
LOOKUP_ARGS
,
return
match_input
(
APPLY_ARG
,
inputCount
,
input
,
inputCount
,
input
,
context
.
funcs
.
match
,
context
.
match_data
,
context
.
funcs
.
match
,
context
.
match_data
,
&
context_length
)
&&
&
context_length
)
&&
apply_lookup
(
LOOKUP_ARGS
,
apply_lookup
(
APPLY_ARG
,
inputCount
,
inputCount
,
lookupCount
,
lookupRecord
,
lookupCount
,
lookupRecord
,
context
.
funcs
.
apply
);
context
.
funcs
.
apply
);
...
@@ -236,11 +236,11 @@ struct Rule {
...
@@ -236,11 +236,11 @@ struct Rule {
friend
struct
RuleSet
;
friend
struct
RuleSet
;
private:
private:
inline
bool
apply
(
LOOKUP_ARGS
_DEF
,
ContextLookupContext
&
context
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
,
ContextLookupContext
&
context
)
const
{
const
LookupRecord
*
lookupRecord
=
(
const
LookupRecord
*
)
const
LookupRecord
*
lookupRecord
=
(
const
LookupRecord
*
)
((
const
char
*
)
input
+
((
const
char
*
)
input
+
sizeof
(
input
[
0
])
*
(
inputCount
?
inputCount
-
1
:
0
));
sizeof
(
input
[
0
])
*
(
inputCount
?
inputCount
-
1
:
0
));
return
context_lookup
(
LOOKUP_ARGS
,
return
context_lookup
(
APPLY_ARG
,
inputCount
,
input
,
inputCount
,
input
,
lookupCount
,
lookupRecord
,
lookupCount
,
lookupRecord
,
context
);
context
);
...
@@ -260,11 +260,11 @@ ASSERT_SIZE (Rule, 4);
...
@@ -260,11 +260,11 @@ ASSERT_SIZE (Rule, 4);
struct
RuleSet
{
struct
RuleSet
{
inline
bool
apply
(
LOOKUP_ARGS
_DEF
,
ContextLookupContext
&
context
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
,
ContextLookupContext
&
context
)
const
{
unsigned
int
num_rules
=
rule
.
len
;
unsigned
int
num_rules
=
rule
.
len
;
for
(
unsigned
int
i
=
0
;
i
<
num_rules
;
i
++
)
{
for
(
unsigned
int
i
=
0
;
i
<
num_rules
;
i
++
)
{
if
((
this
+
rule
[
i
]).
apply
(
LOOKUP_ARGS
,
context
))
if
((
this
+
rule
[
i
]).
apply
(
APPLY_ARG
,
context
))
return
true
;
return
true
;
}
}
...
@@ -283,7 +283,7 @@ struct ContextFormat1 {
...
@@ -283,7 +283,7 @@ struct ContextFormat1 {
friend
struct
Context
;
friend
struct
Context
;
private:
private:
inline
bool
apply
(
LOOKUP_ARGS
_DEF
,
apply_lookup_func_t
apply_func
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
,
apply_lookup_func_t
apply_func
)
const
{
unsigned
int
index
=
(
this
+
coverage
)
(
IN_CURGLYPH
());
unsigned
int
index
=
(
this
+
coverage
)
(
IN_CURGLYPH
());
if
(
HB_LIKELY
(
index
==
NOT_COVERED
))
if
(
HB_LIKELY
(
index
==
NOT_COVERED
))
...
@@ -294,7 +294,7 @@ struct ContextFormat1 {
...
@@ -294,7 +294,7 @@ struct ContextFormat1 {
{
match_glyph
,
apply_func
},
{
match_glyph
,
apply_func
},
NULL
NULL
};
};
return
rule_set
.
apply
(
LOOKUP_ARGS
,
context
);
return
rule_set
.
apply
(
APPLY_ARG
,
context
);
}
}
private:
private:
...
@@ -314,7 +314,7 @@ struct ContextFormat2 {
...
@@ -314,7 +314,7 @@ struct ContextFormat2 {
friend
struct
Context
;
friend
struct
Context
;
private:
private:
inline
bool
apply
(
LOOKUP_ARGS
_DEF
,
apply_lookup_func_t
apply_func
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
,
apply_lookup_func_t
apply_func
)
const
{
unsigned
int
index
=
(
this
+
coverage
)
(
IN_CURGLYPH
());
unsigned
int
index
=
(
this
+
coverage
)
(
IN_CURGLYPH
());
if
(
HB_LIKELY
(
index
==
NOT_COVERED
))
if
(
HB_LIKELY
(
index
==
NOT_COVERED
))
...
@@ -330,7 +330,7 @@ struct ContextFormat2 {
...
@@ -330,7 +330,7 @@ struct ContextFormat2 {
{
match_class
,
apply_func
},
{
match_class
,
apply_func
},
(
char
*
)
&
class_def
(
char
*
)
&
class_def
};
};
return
rule_set
.
apply
(
LOOKUP_ARGS
,
context
);
return
rule_set
.
apply
(
APPLY_ARG
,
context
);
}
}
private:
private:
...
@@ -353,7 +353,7 @@ struct ContextFormat3 {
...
@@ -353,7 +353,7 @@ struct ContextFormat3 {
friend
struct
Context
;
friend
struct
Context
;
private:
private:
inline
bool
apply
(
LOOKUP_ARGS
_DEF
,
apply_lookup_func_t
apply_func
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
,
apply_lookup_func_t
apply_func
)
const
{
unsigned
int
index
=
(
this
+
coverage
[
0
])
(
IN_CURGLYPH
());
unsigned
int
index
=
(
this
+
coverage
[
0
])
(
IN_CURGLYPH
());
if
(
HB_LIKELY
(
index
==
NOT_COVERED
))
if
(
HB_LIKELY
(
index
==
NOT_COVERED
))
...
@@ -366,7 +366,7 @@ struct ContextFormat3 {
...
@@ -366,7 +366,7 @@ struct ContextFormat3 {
{
match_coverage
,
apply_func
},
{
match_coverage
,
apply_func
},
(
char
*
)
this
(
char
*
)
this
};
};
return
context_lookup
(
LOOKUP_ARGS
,
return
context_lookup
(
APPLY_ARG
,
glyphCount
,
(
const
USHORT
*
)
(
coverage
+
1
),
glyphCount
,
(
const
USHORT
*
)
(
coverage
+
1
),
lookupCount
,
lookupRecord
,
lookupCount
,
lookupRecord
,
context
);
context
);
...
@@ -388,11 +388,11 @@ ASSERT_SIZE (ContextFormat3, 6);
...
@@ -388,11 +388,11 @@ ASSERT_SIZE (ContextFormat3, 6);
struct
Context
{
struct
Context
{
protected:
protected:
bool
apply
(
LOOKUP_ARGS
_DEF
,
apply_lookup_func_t
apply_func
)
const
{
bool
apply
(
APPLY_ARG
_DEF
,
apply_lookup_func_t
apply_func
)
const
{
switch
(
u
.
format
)
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
->
apply
(
LOOKUP_ARGS
,
apply_func
);
case
1
:
return
u
.
format1
->
apply
(
APPLY_ARG
,
apply_func
);
case
2
:
return
u
.
format2
->
apply
(
LOOKUP_ARGS
,
apply_func
);
case
2
:
return
u
.
format2
->
apply
(
APPLY_ARG
,
apply_func
);
case
3
:
return
u
.
format3
->
apply
(
LOOKUP_ARGS
,
apply_func
);
case
3
:
return
u
.
format3
->
apply
(
APPLY_ARG
,
apply_func
);
default:
return
false
;
default:
return
false
;
}
}
}
}
...
@@ -415,7 +415,7 @@ struct ChainContextLookupContext {
...
@@ -415,7 +415,7 @@ struct ChainContextLookupContext {
char
*
match_data
[
3
];
char
*
match_data
[
3
];
};
};
static
inline
bool
chain_context_lookup
(
LOOKUP_ARGS
_DEF
,
static
inline
bool
chain_context_lookup
(
APPLY_ARG
_DEF
,
unsigned
int
backtrackCount
,
unsigned
int
backtrackCount
,
const
USHORT
backtrack
[],
const
USHORT
backtrack
[],
unsigned
int
inputCount
,
/* Including the first glyph (not matched) */
unsigned
int
inputCount
,
/* Including the first glyph (not matched) */
...
@@ -433,19 +433,19 @@ static inline bool chain_context_lookup (LOOKUP_ARGS_DEF,
...
@@ -433,19 +433,19 @@ static inline bool chain_context_lookup (LOOKUP_ARGS_DEF,
return
false
;
return
false
;
unsigned
int
offset
;
unsigned
int
offset
;
return
match_backtrack
(
LOOKUP_ARGS
,
return
match_backtrack
(
APPLY_ARG
,
backtrackCount
,
backtrack
,
backtrackCount
,
backtrack
,
context
.
funcs
.
match
,
context
.
match_data
[
0
])
&&
context
.
funcs
.
match
,
context
.
match_data
[
0
])
&&
match_input
(
LOOKUP_ARGS
,
match_input
(
APPLY_ARG
,
inputCount
,
input
,
inputCount
,
input
,
context
.
funcs
.
match
,
context
.
match_data
[
1
],
context
.
funcs
.
match
,
context
.
match_data
[
1
],
&
offset
)
&&
&
offset
)
&&
match_lookahead
(
LOOKUP_ARGS
,
match_lookahead
(
APPLY_ARG
,
lookaheadCount
,
lookahead
,
lookaheadCount
,
lookahead
,
context
.
funcs
.
match
,
context
.
match_data
[
2
],
context
.
funcs
.
match
,
context
.
match_data
[
2
],
offset
)
&&
offset
)
&&
(
context_length
=
offset
,
true
)
&&
(
context_length
=
offset
,
true
)
&&
apply_lookup
(
LOOKUP_ARGS
,
apply_lookup
(
APPLY_ARG
,
inputCount
,
inputCount
,
lookupCount
,
lookupRecord
,
lookupCount
,
lookupRecord
,
context
.
funcs
.
apply
);
context
.
funcs
.
apply
);
...
@@ -456,14 +456,14 @@ struct ChainRule {
...
@@ -456,14 +456,14 @@ struct ChainRule {
friend
struct
ChainRuleSet
;
friend
struct
ChainRuleSet
;
private:
private:
inline
bool
apply
(
LOOKUP_ARGS
_DEF
,
ChainContextLookupContext
&
context
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
,
ChainContextLookupContext
&
context
)
const
{
const
HeadlessArrayOf
<
USHORT
>
&
input
=
*
(
const
HeadlessArrayOf
<
USHORT
>
*
)
const
HeadlessArrayOf
<
USHORT
>
&
input
=
*
(
const
HeadlessArrayOf
<
USHORT
>
*
)
((
const
char
*
)
&
backtrack
+
backtrack
.
get_size
());
((
const
char
*
)
&
backtrack
+
backtrack
.
get_size
());
const
ArrayOf
<
USHORT
>
&
lookahead
=
*
(
const
ArrayOf
<
USHORT
>
*
)
const
ArrayOf
<
USHORT
>
&
lookahead
=
*
(
const
ArrayOf
<
USHORT
>
*
)
((
const
char
*
)
&
input
+
input
.
get_size
());
((
const
char
*
)
&
input
+
input
.
get_size
());
const
ArrayOf
<
LookupRecord
>
&
lookup
=
*
(
const
ArrayOf
<
LookupRecord
>
*
)
const
ArrayOf
<
LookupRecord
>
&
lookup
=
*
(
const
ArrayOf
<
LookupRecord
>
*
)
((
const
char
*
)
&
lookahead
+
lookahead
.
get_size
());
((
const
char
*
)
&
lookahead
+
lookahead
.
get_size
());
return
chain_context_lookup
(
LOOKUP_ARGS
,
return
chain_context_lookup
(
APPLY_ARG
,
backtrack
.
len
,
backtrack
.
array
,
backtrack
.
len
,
backtrack
.
array
,
input
.
len
,
input
.
array
+
1
,
input
.
len
,
input
.
array
+
1
,
lookahead
.
len
,
lookahead
.
array
,
lookahead
.
len
,
lookahead
.
array
,
...
@@ -492,11 +492,11 @@ ASSERT_SIZE (ChainRule, 8);
...
@@ -492,11 +492,11 @@ ASSERT_SIZE (ChainRule, 8);
struct
ChainRuleSet
{
struct
ChainRuleSet
{
inline
bool
apply
(
LOOKUP_ARGS
_DEF
,
ChainContextLookupContext
&
context
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
,
ChainContextLookupContext
&
context
)
const
{
unsigned
int
num_rules
=
rule
.
len
;
unsigned
int
num_rules
=
rule
.
len
;
for
(
unsigned
int
i
=
0
;
i
<
num_rules
;
i
++
)
{
for
(
unsigned
int
i
=
0
;
i
<
num_rules
;
i
++
)
{
if
((
this
+
rule
[
i
]).
apply
(
LOOKUP_ARGS
,
context
))
if
((
this
+
rule
[
i
]).
apply
(
APPLY_ARG
,
context
))
return
true
;
return
true
;
}
}
...
@@ -515,7 +515,7 @@ struct ChainContextFormat1 {
...
@@ -515,7 +515,7 @@ struct ChainContextFormat1 {
friend
struct
ChainContext
;
friend
struct
ChainContext
;
private:
private:
inline
bool
apply
(
LOOKUP_ARGS
_DEF
,
apply_lookup_func_t
apply_func
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
,
apply_lookup_func_t
apply_func
)
const
{
unsigned
int
index
=
(
this
+
coverage
)
(
IN_CURGLYPH
());
unsigned
int
index
=
(
this
+
coverage
)
(
IN_CURGLYPH
());
if
(
HB_LIKELY
(
index
==
NOT_COVERED
))
if
(
HB_LIKELY
(
index
==
NOT_COVERED
))
...
@@ -526,7 +526,7 @@ struct ChainContextFormat1 {
...
@@ -526,7 +526,7 @@ struct ChainContextFormat1 {
{
match_glyph
,
apply_func
},
{
match_glyph
,
apply_func
},
{
NULL
,
NULL
,
NULL
}
{
NULL
,
NULL
,
NULL
}
};
};
return
rule_set
.
apply
(
LOOKUP_ARGS
,
context
);
return
rule_set
.
apply
(
APPLY_ARG
,
context
);
}
}
private:
private:
USHORT
format
;
/* Format identifier--format = 1 */
USHORT
format
;
/* Format identifier--format = 1 */
...
@@ -544,7 +544,7 @@ struct ChainContextFormat2 {
...
@@ -544,7 +544,7 @@ struct ChainContextFormat2 {
friend
struct
ChainContext
;
friend
struct
ChainContext
;
private:
private:
inline
bool
apply
(
LOOKUP_ARGS
_DEF
,
apply_lookup_func_t
apply_func
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
,
apply_lookup_func_t
apply_func
)
const
{
unsigned
int
index
=
(
this
+
coverage
)
(
IN_CURGLYPH
());
unsigned
int
index
=
(
this
+
coverage
)
(
IN_CURGLYPH
());
if
(
HB_LIKELY
(
index
==
NOT_COVERED
))
if
(
HB_LIKELY
(
index
==
NOT_COVERED
))
...
@@ -565,7 +565,7 @@ struct ChainContextFormat2 {
...
@@ -565,7 +565,7 @@ struct ChainContextFormat2 {
(
char
*
)
&
input_class_def
,
(
char
*
)
&
input_class_def
,
(
char
*
)
&
lookahead_class_def
}
(
char
*
)
&
lookahead_class_def
}
};
};
return
rule_set
.
apply
(
LOOKUP_ARGS
,
context
);
return
rule_set
.
apply
(
APPLY_ARG
,
context
);
}
}
private:
private:
...
@@ -597,10 +597,10 @@ struct ChainContextFormat3 {
...
@@ -597,10 +597,10 @@ struct ChainContextFormat3 {
private:
private:
inline
bool
apply_coverage
(
LOOKUP_ARGS
_DEF
,
apply_lookup_func_t
apply_func
)
const
{
inline
bool
apply_coverage
(
APPLY_ARG
_DEF
,
apply_lookup_func_t
apply_func
)
const
{
}
}
inline
bool
apply
(
LOOKUP_ARGS
_DEF
,
apply_lookup_func_t
apply_func
)
const
{
inline
bool
apply
(
APPLY_ARG
_DEF
,
apply_lookup_func_t
apply_func
)
const
{
const
OffsetArrayOf
<
Coverage
>
&
input
=
*
(
const
OffsetArrayOf
<
Coverage
>
*
)
const
OffsetArrayOf
<
Coverage
>
&
input
=
*
(
const
OffsetArrayOf
<
Coverage
>
*
)
((
const
char
*
)
&
backtrack
+
backtrack
.
get_size
());
((
const
char
*
)
&
backtrack
+
backtrack
.
get_size
());
...
@@ -617,7 +617,7 @@ struct ChainContextFormat3 {
...
@@ -617,7 +617,7 @@ struct ChainContextFormat3 {
{
match_coverage
,
apply_func
},
{
match_coverage
,
apply_func
},
{(
char
*
)
this
,
(
char
*
)
this
,
(
char
*
)
this
}
{(
char
*
)
this
,
(
char
*
)
this
,
(
char
*
)
this
}
};
};
return
chain_context_lookup
(
LOOKUP_ARGS
,
return
chain_context_lookup
(
APPLY_ARG
,
backtrack
.
len
,
(
USHORT
*
)
backtrack
.
array
,
backtrack
.
len
,
(
USHORT
*
)
backtrack
.
array
,
input
.
len
,
(
USHORT
*
)
input
.
array
,
input
.
len
,
(
USHORT
*
)
input
.
array
,
lookahead
.
len
,
(
USHORT
*
)
lookahead
.
array
,
lookahead
.
len
,
(
USHORT
*
)
lookahead
.
array
,
...
@@ -649,11 +649,11 @@ ASSERT_SIZE (ChainContextFormat3, 10);
...
@@ -649,11 +649,11 @@ ASSERT_SIZE (ChainContextFormat3, 10);
struct
ChainContext
{
struct
ChainContext
{
protected:
protected:
bool
apply
(
LOOKUP_ARGS
_DEF
,
apply_lookup_func_t
apply_func
)
const
{
bool
apply
(
APPLY_ARG
_DEF
,
apply_lookup_func_t
apply_func
)
const
{
switch
(
u
.
format
)
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
->
apply
(
LOOKUP_ARGS
,
apply_func
);
case
1
:
return
u
.
format1
->
apply
(
APPLY_ARG
,
apply_func
);
case
2
:
return
u
.
format2
->
apply
(
LOOKUP_ARGS
,
apply_func
);
case
2
:
return
u
.
format2
->
apply
(
APPLY_ARG
,
apply_func
);
case
3
:
return
u
.
format3
->
apply
(
LOOKUP_ARGS
,
apply_func
);
case
3
:
return
u
.
format3
->
apply
(
APPLY_ARG
,
apply_func
);
default:
return
false
;
default:
return
false
;
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录