Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
f1b12781
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看板
提交
f1b12781
编写于
11月 24, 2012
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[OTLayout] Implement ChainContext collect_glyphs()
All of collect_glyphs() complete and untested now.
上级
cdd756b9
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
96 addition
and
7 deletion
+96
-7
src/hb-ot-layout-gsubgpos-private.hh
src/hb-ot-layout-gsubgpos-private.hh
+96
-7
未找到文件。
src/hb-ot-layout-gsubgpos-private.hh
浏览文件 @
f1b12781
...
...
@@ -534,13 +534,14 @@ static inline void collect_coverage (hb_set_t *glyphs, const USHORT &value, cons
(
data
+
coverage
).
add_coverage
(
glyphs
);
}
static
inline
void
collect_array
(
hb_collect_glyphs_context_t
*
c
,
hb_set_t
*
glyphs
,
unsigned
int
count
,
const
USHORT
values
[],
collect_glyphs_func_t
collect_func
,
const
void
*
collect_data
)
{
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
collect_func
(
&
c
->
input
,
values
[
i
],
collect_data
);
collect_func
(
glyphs
,
values
[
i
],
collect_data
);
}
...
...
@@ -912,7 +913,7 @@ static inline void context_collect_glyphs_lookup (hb_collect_glyphs_context_t *c
const
LookupRecord
lookupRecord
[],
ContextCollectGlyphsLookupContext
&
lookup_context
)
{
collect_array
(
c
,
collect_array
(
c
,
&
c
->
input
,
inputCount
?
inputCount
-
1
:
0
,
input
,
lookup_context
.
funcs
.
collect
,
lookup_context
.
collect_data
);
recurse_lookups
(
c
,
...
...
@@ -1093,7 +1094,7 @@ struct ContextFormat1
unsigned
int
count
=
ruleSet
.
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
(
this
+
ruleSet
[
i
]).
collect_glyphs
(
c
,
lookup_context
);
(
this
+
ruleSet
[
i
]).
collect_glyphs
(
c
,
lookup_context
);
}
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
)
const
...
...
@@ -1181,7 +1182,7 @@ struct ContextFormat2
unsigned
int
count
=
ruleSet
.
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
(
this
+
ruleSet
[
i
]).
collect_glyphs
(
c
,
lookup_context
);
(
this
+
ruleSet
[
i
]).
collect_glyphs
(
c
,
lookup_context
);
}
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
)
const
...
...
@@ -1375,6 +1376,12 @@ struct ChainContextClosureLookupContext
const
void
*
intersects_data
[
3
];
};
struct
ChainContextCollectGlyphsLookupContext
{
ContextCollectGlyphsFuncs
funcs
;
const
void
*
collect_data
[
3
];
};
struct
ChainContextApplyLookupContext
{
ContextApplyFuncs
funcs
;
...
...
@@ -1405,6 +1412,30 @@ static inline void chain_context_closure_lookup (hb_closure_context_t *c,
lookupCount
,
lookupRecord
);
}
static
inline
void
chain_context_collect_glyphs_lookup
(
hb_collect_glyphs_context_t
*
c
,
unsigned
int
backtrackCount
,
const
USHORT
backtrack
[],
unsigned
int
inputCount
,
/* Including the first glyph (not matched) */
const
USHORT
input
[],
/* Array of input values--start with second glyph */
unsigned
int
lookaheadCount
,
const
USHORT
lookahead
[],
unsigned
int
lookupCount
,
const
LookupRecord
lookupRecord
[],
ChainContextCollectGlyphsLookupContext
&
lookup_context
)
{
collect_array
(
c
,
&
c
->
before
,
backtrackCount
,
backtrack
,
lookup_context
.
funcs
.
collect
,
lookup_context
.
collect_data
[
0
]);
collect_array
(
c
,
&
c
->
input
,
inputCount
?
inputCount
-
1
:
0
,
input
,
lookup_context
.
funcs
.
collect
,
lookup_context
.
collect_data
[
1
]);
collect_array
(
c
,
&
c
->
after
,
lookaheadCount
,
lookahead
,
lookup_context
.
funcs
.
collect
,
lookup_context
.
collect_data
[
2
]);
recurse_lookups
(
c
,
lookupCount
,
lookupRecord
);
}
static
inline
bool
chain_context_would_apply_lookup
(
hb_would_apply_context_t
*
c
,
unsigned
int
backtrackCount
,
const
USHORT
backtrack
[],
...
...
@@ -1466,6 +1497,20 @@ struct ChainRule
lookup_context
);
}
inline
void
collect_glyphs
(
hb_collect_glyphs_context_t
*
c
,
ChainContextCollectGlyphsLookupContext
&
lookup_context
)
const
{
TRACE_COLLECT_GLYPHS
(
this
);
const
HeadlessArrayOf
<
USHORT
>
&
input
=
StructAfter
<
HeadlessArrayOf
<
USHORT
>
>
(
backtrack
);
const
ArrayOf
<
USHORT
>
&
lookahead
=
StructAfter
<
ArrayOf
<
USHORT
>
>
(
input
);
const
ArrayOf
<
LookupRecord
>
&
lookup
=
StructAfter
<
ArrayOf
<
LookupRecord
>
>
(
lookahead
);
chain_context_collect_glyphs_lookup
(
c
,
backtrack
.
len
,
backtrack
.
array
,
input
.
len
,
input
.
array
,
lookahead
.
len
,
lookahead
.
array
,
lookup
.
len
,
lookup
.
array
,
lookup_context
);
}
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
,
ChainContextApplyLookupContext
&
lookup_context
)
const
{
TRACE_WOULD_APPLY
(
this
);
...
...
@@ -1531,6 +1576,14 @@ struct ChainRuleSet
(
this
+
rule
[
i
]).
closure
(
c
,
lookup_context
);
}
inline
void
collect_glyphs
(
hb_collect_glyphs_context_t
*
c
,
ChainContextCollectGlyphsLookupContext
&
lookup_context
)
const
{
TRACE_COLLECT_GLYPHS
(
this
);
unsigned
int
num_rules
=
rule
.
len
;
for
(
unsigned
int
i
=
0
;
i
<
num_rules
;
i
++
)
(
this
+
rule
[
i
]).
collect_glyphs
(
c
,
lookup_context
);
}
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
,
ChainContextApplyLookupContext
&
lookup_context
)
const
{
TRACE_WOULD_APPLY
(
this
);
...
...
@@ -1588,7 +1641,17 @@ struct ChainContextFormat1
inline
void
collect_glyphs
(
hb_collect_glyphs_context_t
*
c
)
const
{
/* XXXXXXXXXX */
TRACE_COLLECT_GLYPHS
(
this
);
(
this
+
coverage
).
add_coverage
(
&
c
->
input
);
struct
ChainContextCollectGlyphsLookupContext
lookup_context
=
{
{
collect_glyph
},
{
NULL
,
NULL
,
NULL
}
};
unsigned
int
count
=
ruleSet
.
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
(
this
+
ruleSet
[
i
]).
collect_glyphs
(
c
,
lookup_context
);
}
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
)
const
...
...
@@ -1668,7 +1731,17 @@ struct ChainContextFormat2
inline
void
collect_glyphs
(
hb_collect_glyphs_context_t
*
c
)
const
{
/* XXXXXXXXXX */
TRACE_COLLECT_GLYPHS
(
this
);
(
this
+
coverage
).
add_coverage
(
&
c
->
input
);
struct
ChainContextCollectGlyphsLookupContext
lookup_context
=
{
{
collect_class
},
{
NULL
,
NULL
,
NULL
}
};
unsigned
int
count
=
ruleSet
.
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
(
this
+
ruleSet
[
i
]).
collect_glyphs
(
c
,
lookup_context
);
}
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
)
const
...
...
@@ -1769,7 +1842,23 @@ struct ChainContextFormat3
inline
void
collect_glyphs
(
hb_collect_glyphs_context_t
*
c
)
const
{
/* XXXXXXXXXX */
TRACE_COLLECT_GLYPHS
(
this
);
const
OffsetArrayOf
<
Coverage
>
&
input
=
StructAfter
<
OffsetArrayOf
<
Coverage
>
>
(
backtrack
);
(
this
+
input
[
0
]).
add_coverage
(
&
c
->
input
);
const
OffsetArrayOf
<
Coverage
>
&
lookahead
=
StructAfter
<
OffsetArrayOf
<
Coverage
>
>
(
input
);
const
ArrayOf
<
LookupRecord
>
&
lookup
=
StructAfter
<
ArrayOf
<
LookupRecord
>
>
(
lookahead
);
struct
ChainContextCollectGlyphsLookupContext
lookup_context
=
{
{
collect_coverage
},
{
this
,
this
,
this
}
};
chain_context_collect_glyphs_lookup
(
c
,
backtrack
.
len
,
(
const
USHORT
*
)
backtrack
.
array
,
input
.
len
,
(
const
USHORT
*
)
input
.
array
+
1
,
lookahead
.
len
,
(
const
USHORT
*
)
lookahead
.
array
,
lookup
.
len
,
lookup
.
array
,
lookup_context
);
}
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
)
const
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录