Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
2a8e6acc
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2a8e6acc
编写于
5月 18, 2009
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[HB] Internally rename position() and substitute() to apply()
上级
f6c8a6ea
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
107 addition
and
107 deletion
+107
-107
src/hb-ot-layout-gpos-private.h
src/hb-ot-layout-gpos-private.h
+55
-55
src/hb-ot-layout-gsub-private.h
src/hb-ot-layout-gsub-private.h
+52
-52
未找到文件。
src/hb-ot-layout-gpos-private.h
浏览文件 @
2a8e6acc
...
...
@@ -211,7 +211,7 @@ struct SinglePosFormat1 {
friend
struct
SinglePos
;
private:
inline
bool
position
(
LOOKUP_ARGS_DEF
)
const
{
inline
bool
apply
(
LOOKUP_ARGS_DEF
)
const
{
/* TODO */
return
false
;
}
...
...
@@ -234,7 +234,7 @@ struct SinglePosFormat2 {
friend
struct
SinglePos
;
private:
inline
bool
position
(
LOOKUP_ARGS_DEF
)
const
{
inline
bool
apply
(
LOOKUP_ARGS_DEF
)
const
{
/* TODO */
return
false
;
}
...
...
@@ -258,10 +258,10 @@ struct SinglePos {
private:
inline
bool
position
(
LOOKUP_ARGS_DEF
)
const
{
inline
bool
apply
(
LOOKUP_ARGS_DEF
)
const
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
->
position
(
LOOKUP_ARGS
);
case
2
:
return
u
.
format2
->
position
(
LOOKUP_ARGS
);
case
1
:
return
u
.
format1
->
apply
(
LOOKUP_ARGS
);
case
2
:
return
u
.
format2
->
apply
(
LOOKUP_ARGS
);
default:
return
false
;
}
}
...
...
@@ -297,7 +297,7 @@ struct PairPosFormat1 {
friend
struct
PairPos
;
private:
inline
bool
position
(
LOOKUP_ARGS_DEF
)
const
{
inline
bool
apply
(
LOOKUP_ARGS_DEF
)
const
{
/* TODO */
return
false
;
}
...
...
@@ -324,7 +324,7 @@ struct PairPosFormat2 {
friend
struct
PairPos
;
private:
inline
bool
position
(
LOOKUP_ARGS_DEF
)
const
{
inline
bool
apply
(
LOOKUP_ARGS_DEF
)
const
{
/* TODO */
return
false
;
}
...
...
@@ -364,10 +364,10 @@ struct PairPos {
private:
inline
bool
position
(
LOOKUP_ARGS_DEF
)
const
{
inline
bool
apply
(
LOOKUP_ARGS_DEF
)
const
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
->
position
(
LOOKUP_ARGS
);
case
2
:
return
u
.
format2
->
position
(
LOOKUP_ARGS
);
case
1
:
return
u
.
format1
->
apply
(
LOOKUP_ARGS
);
case
2
:
return
u
.
format2
->
apply
(
LOOKUP_ARGS
);
default:
return
false
;
}
}
...
...
@@ -402,7 +402,7 @@ struct CursivePosFormat1 {
friend
struct
CursivePos
;
private:
inline
bool
position
(
LOOKUP_ARGS_DEF
)
const
{
inline
bool
apply
(
LOOKUP_ARGS_DEF
)
const
{
/* TODO */
return
false
;
}
...
...
@@ -424,9 +424,9 @@ struct CursivePos {
private:
inline
bool
position
(
LOOKUP_ARGS_DEF
)
const
{
inline
bool
apply
(
LOOKUP_ARGS_DEF
)
const
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
->
position
(
LOOKUP_ARGS
);
case
1
:
return
u
.
format1
->
apply
(
LOOKUP_ARGS
);
default:
return
false
;
}
}
...
...
@@ -466,7 +466,7 @@ struct MarkBasePosFormat1 {
friend
struct
MarkBasePos
;
private:
inline
bool
position
(
LOOKUP_ARGS_DEF
)
const
{
inline
bool
apply
(
LOOKUP_ARGS_DEF
)
const
{
/* TODO */
return
false
;
}
...
...
@@ -492,9 +492,9 @@ struct MarkBasePos {
private:
inline
bool
position
(
LOOKUP_ARGS_DEF
)
const
{
inline
bool
apply
(
LOOKUP_ARGS_DEF
)
const
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
->
position
(
LOOKUP_ARGS
);
case
1
:
return
u
.
format1
->
apply
(
LOOKUP_ARGS
);
default:
return
false
;
}
}
...
...
@@ -551,7 +551,7 @@ struct MarkLigPosFormat1 {
friend
struct
MarkLigPos
;
private:
inline
bool
position
(
LOOKUP_ARGS_DEF
)
const
{
inline
bool
apply
(
LOOKUP_ARGS_DEF
)
const
{
/* TODO */
return
false
;
}
...
...
@@ -577,9 +577,9 @@ struct MarkLigPos {
private:
inline
bool
position
(
LOOKUP_ARGS_DEF
)
const
{
inline
bool
apply
(
LOOKUP_ARGS_DEF
)
const
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
->
position
(
LOOKUP_ARGS
);
case
1
:
return
u
.
format1
->
apply
(
LOOKUP_ARGS
);
default:
return
false
;
}
}
...
...
@@ -618,7 +618,7 @@ struct MarkMarkPosFormat1 {
friend
struct
MarkMarkPos
;
private:
inline
bool
position
(
LOOKUP_ARGS_DEF
)
const
{
inline
bool
apply
(
LOOKUP_ARGS_DEF
)
const
{
/* TODO */
return
false
;
}
...
...
@@ -644,9 +644,9 @@ struct MarkMarkPos {
private:
inline
bool
position
(
LOOKUP_ARGS_DEF
)
const
{
inline
bool
apply
(
LOOKUP_ARGS_DEF
)
const
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
->
position
(
LOOKUP_ARGS
);
case
1
:
return
u
.
format1
->
apply
(
LOOKUP_ARGS
);
default:
return
false
;
}
}
...
...
@@ -664,16 +664,16 @@ static inline bool position_lookup (LOOKUP_ARGS_DEF, unsigned int lookup_index);
struct
ContextPos
:
Context
{
inline
bool
position
(
LOOKUP_ARGS_DEF
)
const
{
return
this
->
apply
(
LOOKUP_ARGS
,
position_lookup
);
inline
bool
apply
(
LOOKUP_ARGS_DEF
)
const
{
return
Context
::
apply
(
LOOKUP_ARGS
,
position_lookup
);
}
};
ASSERT_SIZE
(
ContextPos
,
2
);
struct
ChainContextPos
:
ChainContext
{
inline
bool
position
(
LOOKUP_ARGS_DEF
)
const
{
return
this
->
apply
(
LOOKUP_ARGS
,
position_lookup
);
inline
bool
apply
(
LOOKUP_ARGS_DEF
)
const
{
return
ChainContext
::
apply
(
LOOKUP_ARGS
,
position_lookup
);
}
};
ASSERT_SIZE
(
ChainContextPos
,
2
);
...
...
@@ -686,7 +686,7 @@ struct ExtensionPosFormat1 {
private:
inline
unsigned
int
get_type
(
void
)
const
{
return
extensionLookupType
;
}
inline
unsigned
int
get_offset
(
void
)
const
{
return
(
extensionOffset
[
0
]
<<
16
)
+
extensionOffset
[
1
];
}
inline
bool
position
(
LOOKUP_ARGS_DEF
)
const
;
inline
bool
apply
(
LOOKUP_ARGS_DEF
)
const
;
private:
USHORT
format
;
/* Format identifier. Set to 1. */
...
...
@@ -714,9 +714,9 @@ struct ExtensionPos {
}
}
inline
bool
position
(
LOOKUP_ARGS_DEF
)
const
{
inline
bool
apply
(
LOOKUP_ARGS_DEF
)
const
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
->
position
(
LOOKUP_ARGS
);
case
1
:
return
u
.
format1
->
apply
(
LOOKUP_ARGS
);
default:
return
false
;
}
}
...
...
@@ -751,18 +751,18 @@ struct PosLookupSubTable {
friend
struct
PosLookup
;
inline
bool
position
(
LOOKUP_ARGS_DEF
,
unsigned
int
lookup_type
)
const
{
inline
bool
apply
(
LOOKUP_ARGS_DEF
,
unsigned
int
lookup_type
)
const
{
switch
(
lookup_type
)
{
case
GPOS_Single
:
return
u
.
single
->
position
(
LOOKUP_ARGS
);
case
GPOS_Pair
:
return
u
.
pair
->
position
(
LOOKUP_ARGS
);
case
GPOS_Cursive
:
return
u
.
cursive
->
position
(
LOOKUP_ARGS
);
case
GPOS_MarkBase
:
return
u
.
markBase
->
position
(
LOOKUP_ARGS
);
case
GPOS_MarkLig
:
return
u
.
markLig
->
position
(
LOOKUP_ARGS
);
case
GPOS_MarkMark
:
return
u
.
markMark
->
position
(
LOOKUP_ARGS
);
case
GPOS_Context
:
return
u
.
context
->
position
(
LOOKUP_ARGS
);
case
GPOS_ChainContext
:
return
u
.
chainContext
->
position
(
LOOKUP_ARGS
);
case
GPOS_Extension
:
return
u
.
extension
->
position
(
LOOKUP_ARGS
);
case
GPOS_Single
:
return
u
.
single
->
apply
(
LOOKUP_ARGS
);
case
GPOS_Pair
:
return
u
.
pair
->
apply
(
LOOKUP_ARGS
);
case
GPOS_Cursive
:
return
u
.
cursive
->
apply
(
LOOKUP_ARGS
);
case
GPOS_MarkBase
:
return
u
.
markBase
->
apply
(
LOOKUP_ARGS
);
case
GPOS_MarkLig
:
return
u
.
markLig
->
apply
(
LOOKUP_ARGS
);
case
GPOS_MarkMark
:
return
u
.
markMark
->
apply
(
LOOKUP_ARGS
);
case
GPOS_Context
:
return
u
.
context
->
apply
(
LOOKUP_ARGS
);
case
GPOS_ChainContext
:
return
u
.
chainContext
->
apply
(
LOOKUP_ARGS
);
case
GPOS_Extension
:
return
u
.
extension
->
apply
(
LOOKUP_ARGS
);
default:
return
false
;
}
}
...
...
@@ -808,22 +808,22 @@ struct PosLookup : Lookup {
return
type
;
}
inline
bool
position
_subtables
(
hb_ot_layout_t
*
layout
,
hb_buffer_t
*
buffer
,
unsigned
int
context_length
,
unsigned
int
nesting_level_left
,
unsigned
int
property
)
const
{
inline
bool
apply
_subtables
(
hb_ot_layout_t
*
layout
,
hb_buffer_t
*
buffer
,
unsigned
int
context_length
,
unsigned
int
nesting_level_left
,
unsigned
int
property
)
const
{
unsigned
int
lookup_type
=
get_type
();
unsigned
int
lookup_flag
=
get_flag
();
for
(
unsigned
int
i
=
0
;
i
<
get_subtable_count
();
i
++
)
if
(
get_subtable
(
i
).
position
(
LOOKUP_ARGS
,
lookup_type
))
if
(
get_subtable
(
i
).
apply
(
LOOKUP_ARGS
,
lookup_type
))
return
true
;
return
false
;
}
inline
bool
position
_once
(
hb_ot_layout_t
*
layout
,
hb_buffer_t
*
buffer
)
const
{
inline
bool
apply
_once
(
hb_ot_layout_t
*
layout
,
hb_buffer_t
*
buffer
)
const
{
unsigned
int
lookup_flag
=
get_flag
();
...
...
@@ -831,12 +831,12 @@ struct PosLookup : Lookup {
if
(
!
_hb_ot_layout_check_glyph_property
(
layout
,
IN_CURITEM
(),
lookup_flag
,
&
property
))
return
false
;
return
position
_subtables
(
layout
,
buffer
,
NO_CONTEXT
,
MAX_NESTING_LEVEL
,
property
);
return
apply
_subtables
(
layout
,
buffer
,
NO_CONTEXT
,
MAX_NESTING_LEVEL
,
property
);
}
bool
position
_string
(
hb_ot_layout_t
*
layout
,
hb_buffer_t
*
buffer
,
hb_ot_layout_feature_mask_t
mask
)
const
{
bool
apply
_string
(
hb_ot_layout_t
*
layout
,
hb_buffer_t
*
buffer
,
hb_ot_layout_feature_mask_t
mask
)
const
{
bool
ret
=
false
;
...
...
@@ -850,7 +850,7 @@ struct PosLookup : Lookup {
bool
done
;
if
(
~
IN_PROPERTIES
(
buffer
->
in_pos
)
&
mask
)
{
done
=
position
_once
(
layout
,
buffer
);
done
=
apply
_once
(
layout
,
buffer
);
ret
|=
done
;
}
else
{
done
=
false
;
...
...
@@ -887,7 +887,7 @@ struct GPOS : GSUBGPOS {
hb_buffer_t
*
buffer
,
unsigned
int
lookup_index
,
hb_ot_layout_feature_mask_t
mask
)
const
{
return
get_lookup
(
lookup_index
).
position
_string
(
layout
,
buffer
,
mask
);
return
get_lookup
(
lookup_index
).
apply
_string
(
layout
,
buffer
,
mask
);
}
};
...
...
@@ -896,13 +896,13 @@ ASSERT_SIZE (GPOS, 10);
/* Out-of-class implementation for methods recursing */
inline
bool
ExtensionPosFormat1
::
position
(
LOOKUP_ARGS_DEF
)
const
{
inline
bool
ExtensionPosFormat1
::
apply
(
LOOKUP_ARGS_DEF
)
const
{
unsigned
int
lookup_type
=
get_type
();
if
(
HB_UNLIKELY
(
lookup_type
==
GPOS_Extension
))
return
false
;
return
((
PosLookupSubTable
&
)
*
(((
char
*
)
this
)
+
get_offset
())).
position
(
LOOKUP_ARGS
,
lookup_type
);
return
((
PosLookupSubTable
&
)
*
(((
char
*
)
this
)
+
get_offset
())).
apply
(
LOOKUP_ARGS
,
lookup_type
);
}
static
inline
bool
position_lookup
(
LOOKUP_ARGS_DEF
,
unsigned
int
lookup_index
)
{
...
...
@@ -916,7 +916,7 @@ static inline bool position_lookup (LOOKUP_ARGS_DEF, unsigned int lookup_index)
if
(
HB_UNLIKELY
(
context_length
<
1
))
return
false
;
return
l
.
position
_subtables
(
layout
,
buffer
,
context_length
,
nesting_level_left
,
property
);
return
l
.
apply
_subtables
(
layout
,
buffer
,
context_length
,
nesting_level_left
,
property
);
}
...
...
src/hb-ot-layout-gsub-private.h
浏览文件 @
2a8e6acc
...
...
@@ -111,7 +111,7 @@ struct SingleSubst {
}
}
inline
bool
substitute
(
LOOKUP_ARGS_DEF
)
const
{
inline
bool
apply
(
LOOKUP_ARGS_DEF
)
const
{
hb_codepoint_t
glyph_id
=
IN_CURGLYPH
();
...
...
@@ -152,7 +152,7 @@ struct Sequence {
_hb_ot_layout_set_glyph_property
(
layout
,
substitute
[
n
],
property
);
}
inline
bool
substitute_sequence
(
LOOKUP_ARGS_DEF
)
const
{
inline
bool
apply
(
LOOKUP_ARGS_DEF
)
const
{
if
(
HB_UNLIKELY
(
!
substitute
.
len
))
return
false
;
...
...
@@ -186,13 +186,13 @@ struct MultipleSubstFormat1 {
private:
inline
bool
substitute
(
LOOKUP_ARGS_DEF
)
const
{
inline
bool
apply
(
LOOKUP_ARGS_DEF
)
const
{
unsigned
int
index
=
(
this
+
coverage
)
(
IN_CURGLYPH
());
if
(
HB_LIKELY
(
index
==
NOT_COVERED
))
return
false
;
return
(
this
+
sequence
[
index
]).
substitute_sequence
(
LOOKUP_ARGS
);
return
(
this
+
sequence
[
index
]).
apply
(
LOOKUP_ARGS
);
}
private:
...
...
@@ -212,9 +212,9 @@ struct MultipleSubst {
private:
inline
bool
substitute
(
LOOKUP_ARGS_DEF
)
const
{
inline
bool
apply
(
LOOKUP_ARGS_DEF
)
const
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
->
substitute
(
LOOKUP_ARGS
);
case
1
:
return
u
.
format1
->
apply
(
LOOKUP_ARGS
);
default:
return
false
;
}
}
...
...
@@ -238,7 +238,7 @@ struct AlternateSubstFormat1 {
private:
inline
bool
substitute
(
LOOKUP_ARGS_DEF
)
const
{
inline
bool
apply
(
LOOKUP_ARGS_DEF
)
const
{
hb_codepoint_t
glyph_id
=
IN_CURGLYPH
();
...
...
@@ -293,9 +293,9 @@ struct AlternateSubst {
private:
inline
bool
substitute
(
LOOKUP_ARGS_DEF
)
const
{
inline
bool
apply
(
LOOKUP_ARGS_DEF
)
const
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
->
substitute
(
LOOKUP_ARGS
);
case
1
:
return
u
.
format1
->
apply
(
LOOKUP_ARGS
);
default:
return
false
;
}
}
...
...
@@ -314,7 +314,7 @@ struct Ligature {
friend
struct
LigatureSet
;
private:
inline
bool
substitute
(
LOOKUP_ARGS_DEF
,
bool
is_mark
)
const
{
inline
bool
apply
(
LOOKUP_ARGS_DEF
,
bool
is_mark
)
const
{
unsigned
int
i
,
j
;
unsigned
int
count
=
component
.
len
;
...
...
@@ -393,12 +393,12 @@ struct LigatureSet {
private:
inline
bool
substitute
(
LOOKUP_ARGS_DEF
,
bool
is_mark
)
const
{
inline
bool
apply
(
LOOKUP_ARGS_DEF
,
bool
is_mark
)
const
{
unsigned
int
num_ligs
=
ligature
.
len
;
for
(
unsigned
int
i
=
0
;
i
<
num_ligs
;
i
++
)
{
const
Ligature
&
lig
=
this
+
ligature
[
i
];
if
(
lig
.
substitute
(
LOOKUP_ARGS
,
is_mark
))
if
(
lig
.
apply
(
LOOKUP_ARGS
,
is_mark
))
return
true
;
}
...
...
@@ -418,7 +418,7 @@ struct LigatureSubstFormat1 {
private:
inline
bool
substitute
(
LOOKUP_ARGS_DEF
)
const
{
inline
bool
apply
(
LOOKUP_ARGS_DEF
)
const
{
hb_codepoint_t
glyph_id
=
IN_CURGLYPH
();
...
...
@@ -430,7 +430,7 @@ struct LigatureSubstFormat1 {
return
false
;
const
LigatureSet
&
lig_set
=
this
+
ligatureSet
[
index
];
return
lig_set
.
substitute
(
LOOKUP_ARGS
,
first_is_mark
);
return
lig_set
.
apply
(
LOOKUP_ARGS
,
first_is_mark
);
}
private:
...
...
@@ -450,9 +450,9 @@ struct LigatureSubst {
private:
inline
bool
substitute
(
LOOKUP_ARGS_DEF
)
const
{
inline
bool
apply
(
LOOKUP_ARGS_DEF
)
const
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
->
substitute
(
LOOKUP_ARGS
);
case
1
:
return
u
.
format1
->
apply
(
LOOKUP_ARGS
);
default:
return
false
;
}
}
...
...
@@ -471,16 +471,16 @@ static inline bool substitute_lookup (LOOKUP_ARGS_DEF, unsigned int lookup_index
struct
ContextSubst
:
Context
{
inline
bool
substitute
(
LOOKUP_ARGS_DEF
)
const
{
return
this
->
apply
(
LOOKUP_ARGS
,
substitute_lookup
);
inline
bool
apply
(
LOOKUP_ARGS_DEF
)
const
{
return
Context
::
apply
(
LOOKUP_ARGS
,
substitute_lookup
);
}
};
ASSERT_SIZE
(
ContextSubst
,
2
);
struct
ChainContextSubst
:
ChainContext
{
inline
bool
substitute
(
LOOKUP_ARGS_DEF
)
const
{
return
this
->
apply
(
LOOKUP_ARGS
,
substitute_lookup
);
inline
bool
apply
(
LOOKUP_ARGS_DEF
)
const
{
return
ChainContext
::
apply
(
LOOKUP_ARGS
,
substitute_lookup
);
}
};
ASSERT_SIZE
(
ChainContextSubst
,
2
);
...
...
@@ -493,7 +493,7 @@ struct ExtensionSubstFormat1 {
private:
inline
unsigned
int
get_type
(
void
)
const
{
return
extensionLookupType
;
}
inline
unsigned
int
get_offset
(
void
)
const
{
return
(
extensionOffset
[
0
]
<<
16
)
+
extensionOffset
[
1
];
}
inline
bool
substitute
(
LOOKUP_ARGS_DEF
)
const
;
inline
bool
apply
(
LOOKUP_ARGS_DEF
)
const
;
private:
USHORT
format
;
/* Format identifier. Set to 1. */
...
...
@@ -521,9 +521,9 @@ struct ExtensionSubst {
}
}
inline
bool
substitute
(
LOOKUP_ARGS_DEF
)
const
{
inline
bool
apply
(
LOOKUP_ARGS_DEF
)
const
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
->
substitute
(
LOOKUP_ARGS
);
case
1
:
return
u
.
format1
->
apply
(
LOOKUP_ARGS
);
default:
return
false
;
}
}
...
...
@@ -542,7 +542,7 @@ struct ReverseChainSingleSubstFormat1 {
friend
struct
ReverseChainSingleSubst
;
private:
inline
bool
substitute
(
LOOKUP_ARGS_DEF
)
const
{
inline
bool
apply
(
LOOKUP_ARGS_DEF
)
const
{
if
(
HB_UNLIKELY
(
context_length
!=
NO_CONTEXT
))
return
false
;
/* No chaining to this type */
...
...
@@ -597,9 +597,9 @@ struct ReverseChainSingleSubst {
private:
inline
bool
substitute
(
LOOKUP_ARGS_DEF
)
const
{
inline
bool
apply
(
LOOKUP_ARGS_DEF
)
const
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
->
substitute
(
LOOKUP_ARGS
);
case
1
:
return
u
.
format1
->
apply
(
LOOKUP_ARGS
);
default:
return
false
;
}
}
...
...
@@ -633,17 +633,17 @@ struct SubstLookupSubTable {
friend
struct
SubstLookup
;
inline
bool
substitute
(
LOOKUP_ARGS_DEF
,
unsigned
int
lookup_type
)
const
{
inline
bool
apply
(
LOOKUP_ARGS_DEF
,
unsigned
int
lookup_type
)
const
{
switch
(
lookup_type
)
{
case
GSUB_Single
:
return
u
.
single
->
substitute
(
LOOKUP_ARGS
);
case
GSUB_Multiple
:
return
u
.
multiple
->
substitute
(
LOOKUP_ARGS
);
case
GSUB_Alternate
:
return
u
.
alternate
->
substitute
(
LOOKUP_ARGS
);
case
GSUB_Ligature
:
return
u
.
ligature
->
substitute
(
LOOKUP_ARGS
);
case
GSUB_Context
:
return
u
.
context
->
substitute
(
LOOKUP_ARGS
);
case
GSUB_ChainContext
:
return
u
.
chainContext
->
substitute
(
LOOKUP_ARGS
);
case
GSUB_Extension
:
return
u
.
extension
->
substitute
(
LOOKUP_ARGS
);
case
GSUB_ReverseChainSingle
:
return
u
.
reverseChainContextSingle
->
substitute
(
LOOKUP_ARGS
);
case
GSUB_Single
:
return
u
.
single
->
apply
(
LOOKUP_ARGS
);
case
GSUB_Multiple
:
return
u
.
multiple
->
apply
(
LOOKUP_ARGS
);
case
GSUB_Alternate
:
return
u
.
alternate
->
apply
(
LOOKUP_ARGS
);
case
GSUB_Ligature
:
return
u
.
ligature
->
apply
(
LOOKUP_ARGS
);
case
GSUB_Context
:
return
u
.
context
->
apply
(
LOOKUP_ARGS
);
case
GSUB_ChainContext
:
return
u
.
chainContext
->
apply
(
LOOKUP_ARGS
);
case
GSUB_Extension
:
return
u
.
extension
->
apply
(
LOOKUP_ARGS
);
case
GSUB_ReverseChainSingle
:
return
u
.
reverseChainContextSingle
->
apply
(
LOOKUP_ARGS
);
default:
return
false
;
}
}
...
...
@@ -695,22 +695,22 @@ struct SubstLookup : Lookup {
}
}
inline
bool
substitute
_subtables
(
hb_ot_layout_t
*
layout
,
hb_buffer_t
*
buffer
,
unsigned
int
context_length
,
unsigned
int
nesting_level_left
,
unsigned
int
property
)
const
{
inline
bool
apply
_subtables
(
hb_ot_layout_t
*
layout
,
hb_buffer_t
*
buffer
,
unsigned
int
context_length
,
unsigned
int
nesting_level_left
,
unsigned
int
property
)
const
{
unsigned
int
lookup_type
=
get_type
();
unsigned
int
lookup_flag
=
get_flag
();
for
(
unsigned
int
i
=
0
;
i
<
get_subtable_count
();
i
++
)
if
(
get_subtable
(
i
).
substitute
(
LOOKUP_ARGS
,
lookup_type
))
if
(
get_subtable
(
i
).
apply
(
LOOKUP_ARGS
,
lookup_type
))
return
true
;
return
false
;
}
inline
bool
substitute
_once
(
hb_ot_layout_t
*
layout
,
hb_buffer_t
*
buffer
)
const
{
inline
bool
apply
_once
(
hb_ot_layout_t
*
layout
,
hb_buffer_t
*
buffer
)
const
{
unsigned
int
lookup_flag
=
get_flag
();
...
...
@@ -718,12 +718,12 @@ struct SubstLookup : Lookup {
if
(
!
_hb_ot_layout_check_glyph_property
(
layout
,
IN_CURITEM
(),
lookup_flag
,
&
property
))
return
false
;
return
substitute
_subtables
(
layout
,
buffer
,
NO_CONTEXT
,
MAX_NESTING_LEVEL
,
property
);
return
apply
_subtables
(
layout
,
buffer
,
NO_CONTEXT
,
MAX_NESTING_LEVEL
,
property
);
}
bool
substitute
_string
(
hb_ot_layout_t
*
layout
,
hb_buffer_t
*
buffer
,
hb_ot_layout_feature_mask_t
mask
)
const
{
bool
apply
_string
(
hb_ot_layout_t
*
layout
,
hb_buffer_t
*
buffer
,
hb_ot_layout_feature_mask_t
mask
)
const
{
bool
ret
=
false
;
...
...
@@ -738,7 +738,7 @@ struct SubstLookup : Lookup {
while
(
buffer
->
in_pos
<
buffer
->
in_length
)
{
if
((
~
IN_PROPERTIES
(
buffer
->
in_pos
)
&
mask
)
&&
substitute
_once
(
layout
,
buffer
))
apply
_once
(
layout
,
buffer
))
ret
=
true
;
else
_hb_buffer_next_glyph
(
buffer
);
...
...
@@ -754,7 +754,7 @@ struct SubstLookup : Lookup {
do
{
if
((
~
IN_PROPERTIES
(
buffer
->
in_pos
)
&
mask
)
&&
substitute
_once
(
layout
,
buffer
))
apply
_once
(
layout
,
buffer
))
ret
=
true
;
else
buffer
->
in_pos
--
;
...
...
@@ -786,7 +786,7 @@ struct GSUB : GSUBGPOS {
hb_buffer_t
*
buffer
,
unsigned
int
lookup_index
,
hb_ot_layout_feature_mask_t
mask
)
const
{
return
get_lookup
(
lookup_index
).
substitute
_string
(
layout
,
buffer
,
mask
);
return
get_lookup
(
lookup_index
).
apply
_string
(
layout
,
buffer
,
mask
);
}
};
...
...
@@ -795,13 +795,13 @@ ASSERT_SIZE (GSUB, 10);
/* Out-of-class implementation for methods recursing */
inline
bool
ExtensionSubstFormat1
::
substitute
(
LOOKUP_ARGS_DEF
)
const
{
inline
bool
ExtensionSubstFormat1
::
apply
(
LOOKUP_ARGS_DEF
)
const
{
unsigned
int
lookup_type
=
get_type
();
if
(
HB_UNLIKELY
(
lookup_type
==
GSUB_Extension
))
return
false
;
return
((
SubstLookupSubTable
&
)
*
(((
char
*
)
this
)
+
get_offset
())).
substitute
(
LOOKUP_ARGS
,
lookup_type
);
return
((
SubstLookupSubTable
&
)
*
(((
char
*
)
this
)
+
get_offset
())).
apply
(
LOOKUP_ARGS
,
lookup_type
);
}
static
inline
bool
substitute_lookup
(
LOOKUP_ARGS_DEF
,
unsigned
int
lookup_index
)
{
...
...
@@ -815,7 +815,7 @@ static inline bool substitute_lookup (LOOKUP_ARGS_DEF, unsigned int lookup_index
if
(
HB_UNLIKELY
(
context_length
<
1
))
return
false
;
return
l
.
substitute
_subtables
(
layout
,
buffer
,
context_length
,
nesting_level_left
,
property
);
return
l
.
apply
_subtables
(
layout
,
buffer
,
context_length
,
nesting_level_left
,
property
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录