Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
36608941
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看板
提交
36608941
编写于
4月 19, 2012
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add GSUB "would_apply" API
To be used in the Indic shaper later. Unused for now.
上级
a0d4caeb
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
138 addition
and
2 deletion
+138
-2
src/hb-ot-layout-gsub-table.hh
src/hb-ot-layout-gsub-table.hh
+138
-2
未找到文件。
src/hb-ot-layout-gsub-table.hh
浏览文件 @
36608941
...
...
@@ -39,6 +39,11 @@ struct SingleSubstFormat1
private:
inline
bool
would_apply
(
hb_codepoint_t
glyph_id
)
const
{
return
(
this
+
coverage
)
(
glyph_id
)
!=
NOT_COVERED
;
}
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
TRACE_APPLY
();
...
...
@@ -78,6 +83,11 @@ struct SingleSubstFormat2
private:
inline
bool
would_apply
(
hb_codepoint_t
glyph_id
)
const
{
return
(
this
+
coverage
)
(
glyph_id
)
!=
NOT_COVERED
;
}
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
TRACE_APPLY
();
...
...
@@ -119,6 +129,15 @@ struct SingleSubst
private:
inline
bool
would_apply
(
hb_codepoint_t
glyph_id
)
const
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
.
would_apply
(
glyph_id
);
case
2
:
return
u
.
format2
.
would_apply
(
glyph_id
);
default:
return
false
;
}
}
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
TRACE_APPLY
();
...
...
@@ -185,6 +204,11 @@ struct MultipleSubstFormat1
private:
inline
bool
would_apply
(
hb_codepoint_t
glyph_id
)
const
{
return
(
this
+
coverage
)
(
glyph_id
)
!=
NOT_COVERED
;
}
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
TRACE_APPLY
();
...
...
@@ -220,6 +244,14 @@ struct MultipleSubst
private:
inline
bool
would_apply
(
hb_codepoint_t
glyph_id
)
const
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
.
would_apply
(
glyph_id
);
default:
return
false
;
}
}
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
TRACE_APPLY
();
...
...
@@ -255,12 +287,15 @@ struct AlternateSubstFormat1
private:
inline
bool
would_apply
(
hb_codepoint_t
glyph_id
)
const
{
return
(
this
+
coverage
)
(
glyph_id
)
!=
NOT_COVERED
;
}
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
TRACE_APPLY
();
hb_codepoint_t
glyph_id
=
c
->
buffer
->
info
[
c
->
buffer
->
idx
].
codepoint
;
hb_mask_t
glyph_mask
=
c
->
buffer
->
info
[
c
->
buffer
->
idx
].
mask
;
hb_mask_t
lookup_mask
=
c
->
lookup_mask
;
unsigned
int
index
=
(
this
+
coverage
)
(
glyph_id
);
if
(
likely
(
index
==
NOT_COVERED
))
...
...
@@ -271,6 +306,9 @@ struct AlternateSubstFormat1
if
(
unlikely
(
!
alt_set
.
len
))
return
false
;
hb_mask_t
glyph_mask
=
c
->
buffer
->
info
[
c
->
buffer
->
idx
].
mask
;
hb_mask_t
lookup_mask
=
c
->
lookup_mask
;
/* Note: This breaks badly if two features enabled this lookup together. */
unsigned
int
shift
=
_hb_ctz
(
lookup_mask
);
unsigned
int
alt_index
=
((
lookup_mask
&
glyph_mask
)
>>
shift
);
...
...
@@ -309,6 +347,14 @@ struct AlternateSubst
private:
inline
bool
would_apply
(
hb_codepoint_t
glyph_id
)
const
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
.
would_apply
(
glyph_id
);
default:
return
false
;
}
}
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
TRACE_APPLY
();
...
...
@@ -340,6 +386,12 @@ struct Ligature
friend
struct
LigatureSet
;
private:
inline
bool
would_apply
(
hb_codepoint_t
second
)
const
{
return
component
.
len
==
2
&&
component
[
1
]
==
second
;
}
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
TRACE_APPLY
();
...
...
@@ -429,6 +481,19 @@ struct LigatureSet
friend
struct
LigatureSubstFormat1
;
private:
inline
bool
would_apply
(
hb_codepoint_t
second
)
const
{
unsigned
int
num_ligs
=
ligature
.
len
;
for
(
unsigned
int
i
=
0
;
i
<
num_ligs
;
i
++
)
{
const
Ligature
&
lig
=
this
+
ligature
[
i
];
if
(
lig
.
would_apply
(
second
))
return
true
;
}
return
false
;
}
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
TRACE_APPLY
();
...
...
@@ -462,6 +527,14 @@ struct LigatureSubstFormat1
friend
struct
LigatureSubst
;
private:
inline
bool
would_apply
(
hb_codepoint_t
first
,
hb_codepoint_t
second
)
const
{
unsigned
int
index
;
return
(
index
=
(
this
+
coverage
)
(
first
))
!=
NOT_COVERED
&&
(
this
+
ligatureSet
[
index
]).
would_apply
(
second
);
}
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
TRACE_APPLY
();
...
...
@@ -498,6 +571,15 @@ struct LigatureSubst
friend
struct
SubstLookupSubTable
;
private:
inline
bool
would_apply
(
hb_codepoint_t
first
,
hb_codepoint_t
second
)
const
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
.
would_apply
(
first
,
second
);
default:
return
false
;
}
}
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
TRACE_APPLY
();
...
...
@@ -564,6 +646,9 @@ struct ExtensionSubst : Extension
return
StructAtOffset
<
SubstLookupSubTable
>
(
this
,
offset
);
}
inline
bool
would_apply
(
hb_codepoint_t
glyph_id
)
const
;
inline
bool
would_apply
(
hb_codepoint_t
first
,
hb_codepoint_t
second
)
const
;
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
;
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
);
...
...
@@ -689,6 +774,28 @@ struct SubstLookupSubTable
ReverseChainSingle
=
8
};
inline
bool
would_apply
(
hb_codepoint_t
glyph_id
,
unsigned
int
lookup_type
)
const
{
switch
(
lookup_type
)
{
case
Single
:
return
u
.
single
.
would_apply
(
glyph_id
);
case
Multiple
:
return
u
.
multiple
.
would_apply
(
glyph_id
);
case
Alternate
:
return
u
.
alternate
.
would_apply
(
glyph_id
);
case
Extension
:
return
u
.
extension
.
would_apply
(
glyph_id
);
default:
return
false
;
}
}
inline
bool
would_apply
(
hb_codepoint_t
first
,
hb_codepoint_t
second
,
unsigned
int
lookup_type
)
const
{
switch
(
lookup_type
)
{
case
Ligature
:
return
u
.
ligature
.
would_apply
(
first
,
second
);
case
Extension
:
return
u
.
extension
.
would_apply
(
first
,
second
);
default:
return
false
;
}
}
inline
bool
apply
(
hb_apply_context_t
*
c
,
unsigned
int
lookup_type
)
const
{
TRACE_APPLY
();
...
...
@@ -754,6 +861,25 @@ struct SubstLookup : Lookup
}
inline
bool
would_apply
(
hb_codepoint_t
glyph_id
)
const
{
unsigned
int
lookup_type
=
get_type
();
unsigned
int
count
=
get_subtable_count
();
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
if
(
get_subtable
(
i
).
would_apply
(
glyph_id
,
lookup_type
))
return
true
;
return
false
;
}
inline
bool
would_apply
(
hb_codepoint_t
first
,
hb_codepoint_t
second
)
const
{
unsigned
int
lookup_type
=
get_type
();
unsigned
int
count
=
get_subtable_count
();
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
if
(
get_subtable
(
i
).
would_apply
(
first
,
second
,
lookup_type
))
return
true
;
return
false
;
}
inline
bool
apply_once
(
hb_apply_context_t
*
c
)
const
{
unsigned
int
lookup_type
=
get_type
();
...
...
@@ -889,6 +1015,16 @@ GSUB::substitute_finish (hb_buffer_t *buffer)
/* Out-of-class implementation for methods recursing */
inline
bool
ExtensionSubst
::
would_apply
(
hb_codepoint_t
glyph_id
)
const
{
return
get_subtable
().
would_apply
(
glyph_id
,
get_type
());
}
inline
bool
ExtensionSubst
::
would_apply
(
hb_codepoint_t
first
,
hb_codepoint_t
second
)
const
{
return
get_subtable
().
would_apply
(
first
,
second
,
get_type
());
}
inline
bool
ExtensionSubst
::
apply
(
hb_apply_context_t
*
c
)
const
{
TRACE_APPLY
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录