Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
26514d51
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看板
提交
26514d51
编写于
11月 23, 2012
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[OTLayout] More collect_glyphs()
上级
c6fb843f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
71 addition
and
18 deletion
+71
-18
src/hb-ot-layout-gpos-table.hh
src/hb-ot-layout-gpos-table.hh
+3
-3
src/hb-ot-layout-gsub-table.hh
src/hb-ot-layout-gsub-table.hh
+22
-10
src/hb-ot-layout-gsubgpos-private.hh
src/hb-ot-layout-gsubgpos-private.hh
+46
-5
未找到文件。
src/hb-ot-layout-gpos-table.hh
浏览文件 @
26514d51
...
...
@@ -1374,10 +1374,10 @@ struct PosLookup : Lookup
inline
bool
apply_once
(
hb_apply_context_t
*
c
)
const
{
TRACE_APPLY
(
this
);
if
(
!
c
->
check_glyph_property
(
&
c
->
buffer
->
cur
(),
c
->
lookup_props
,
&
c
->
property
))
return
false
;
return
process
(
c
);
return
TRACE_RETURN
(
false
);
return
TRACE_RETURN
(
process
(
c
));
}
static
bool
apply_recurse_func
(
hb_apply_context_t
*
c
,
unsigned
int
lookup_index
);
...
...
src/hb-ot-layout-gsub-table.hh
浏览文件 @
26514d51
...
...
@@ -50,6 +50,7 @@ struct SingleSubstFormat1
inline
void
collect_glyphs
(
hb_collect_glyphs_context_t
*
c
)
const
{
TRACE_COLLECT_GLYPHS
(
this
);
Coverage
::
Iter
iter
;
for
(
iter
.
init
(
this
+
coverage
);
iter
.
more
();
iter
.
next
())
{
hb_codepoint_t
glyph_id
=
iter
.
get_glyph
();
...
...
@@ -126,6 +127,7 @@ struct SingleSubstFormat2
inline
void
collect_glyphs
(
hb_collect_glyphs_context_t
*
c
)
const
{
TRACE_COLLECT_GLYPHS
(
this
);
Coverage
::
Iter
iter
;
for
(
iter
.
init
(
this
+
coverage
);
iter
.
more
();
iter
.
next
())
{
c
->
input
.
add
(
iter
.
get_glyph
());
...
...
@@ -259,6 +261,7 @@ struct Sequence
inline
void
collect_glyphs
(
hb_collect_glyphs_context_t
*
c
)
const
{
TRACE_COLLECT_GLYPHS
(
this
);
unsigned
int
count
=
substitute
.
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
c
->
output
.
add
(
substitute
[
i
]);
...
...
@@ -316,6 +319,7 @@ struct MultipleSubstFormat1
inline
void
collect_glyphs
(
hb_collect_glyphs_context_t
*
c
)
const
{
TRACE_COLLECT_GLYPHS
(
this
);
(
this
+
coverage
).
add_coverage
(
&
c
->
input
);
unsigned
int
count
=
sequence
.
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
...
...
@@ -444,6 +448,7 @@ struct AlternateSubstFormat1
inline
void
collect_glyphs
(
hb_collect_glyphs_context_t
*
c
)
const
{
TRACE_COLLECT_GLYPHS
(
this
);
Coverage
::
Iter
iter
;
for
(
iter
.
init
(
this
+
coverage
);
iter
.
more
();
iter
.
next
())
{
c
->
input
.
add
(
iter
.
get_glyph
());
...
...
@@ -587,6 +592,7 @@ struct Ligature
inline
void
collect_glyphs
(
hb_collect_glyphs_context_t
*
c
)
const
{
TRACE_COLLECT_GLYPHS
(
this
);
unsigned
int
count
=
component
.
len
;
for
(
unsigned
int
i
=
1
;
i
<
count
;
i
++
)
c
->
input
.
add
(
component
[
i
]);
...
...
@@ -680,6 +686,7 @@ struct LigatureSet
inline
void
collect_glyphs
(
hb_collect_glyphs_context_t
*
c
)
const
{
TRACE_COLLECT_GLYPHS
(
this
);
unsigned
int
num_ligs
=
ligature
.
len
;
for
(
unsigned
int
i
=
0
;
i
<
num_ligs
;
i
++
)
(
this
+
ligature
[
i
]).
collect_glyphs
(
c
);
...
...
@@ -757,6 +764,7 @@ struct LigatureSubstFormat1
inline
void
collect_glyphs
(
hb_collect_glyphs_context_t
*
c
)
const
{
TRACE_COLLECT_GLYPHS
(
this
);
Coverage
::
Iter
iter
;
for
(
iter
.
init
(
this
+
coverage
);
iter
.
more
();
iter
.
next
())
{
c
->
input
.
add
(
iter
.
get_glyph
());
...
...
@@ -919,6 +927,8 @@ struct ReverseChainSingleSubstFormat1
inline
void
collect_glyphs
(
hb_collect_glyphs_context_t
*
c
)
const
{
TRACE_COLLECT_GLYPHS
(
this
);
const
OffsetArrayOf
<
Coverage
>
&
lookahead
=
StructAfter
<
OffsetArrayOf
<
Coverage
>
>
(
backtrack
);
unsigned
int
count
;
...
...
@@ -1145,8 +1155,16 @@ struct SubstLookup : Lookup
inline
hb_closure_context_t
::
return_t
closure
(
hb_closure_context_t
*
c
)
const
{
TRACE_CLOSURE
(
this
);
c
->
set_recurse_func
(
process_recurse_func
<
hb_closure_context_t
>
);
return
process
(
c
);
return
TRACE_RETURN
(
process
(
c
));
}
inline
hb_collect_glyphs_context_t
::
return_t
collect_glyphs_lookup
(
hb_collect_glyphs_context_t
*
c
)
const
{
TRACE_COLLECT_GLYPHS
(
this
);
c
->
set_recurse_func
(
process_recurse_func
<
hb_collect_glyphs_context_t
>
);
return
TRACE_RETURN
(
process
(
c
));
}
template
<
typename
set_t
>
...
...
@@ -1174,10 +1192,10 @@ struct SubstLookup : Lookup
inline
bool
apply_once
(
hb_apply_context_t
*
c
)
const
{
TRACE_APPLY
(
this
);
if
(
!
c
->
check_glyph_property
(
&
c
->
buffer
->
cur
(),
c
->
lookup_props
,
&
c
->
property
))
return
false
;
return
process
(
c
);
return
TRACE_RETURN
(
false
);
return
TRACE_RETURN
(
process
(
c
));
}
static
bool
apply_recurse_func
(
hb_apply_context_t
*
c
,
unsigned
int
lookup_index
);
...
...
@@ -1330,12 +1348,6 @@ struct GSUB : GSUBGPOS
static
inline
void
substitute_start
(
hb_font_t
*
font
,
hb_buffer_t
*
buffer
);
static
inline
void
substitute_finish
(
hb_font_t
*
font
,
hb_buffer_t
*
buffer
);
#if 0
inline hb_collect_glyphs_context_t::return_t collect_glyphs_lookup (hb_collect_glyphs_context_t *c,
unsigned int lookup_index) const
{ return get_lookup (lookup_index).process (c); }
#endif
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
(
this
);
if
(
unlikely
(
!
GSUBGPOS
::
sanitize
(
c
)))
return
TRACE_RETURN
(
false
);
...
...
src/hb-ot-layout-gsubgpos-private.hh
浏览文件 @
26514d51
...
...
@@ -147,15 +147,19 @@ struct hb_collect_glyphs_context_t
inline
const
char
*
get_name
(
void
)
{
return
"COLLECT_GLYPHS"
;
}
static
const
unsigned
int
max_debug_depth
=
HB_DEBUG_COLLECT_GLYPHS
;
typedef
void_t
return_t
;
typedef
return_t
(
*
recurse_func_t
)
(
hb_collect_glyphs_context_t
*
c
,
unsigned
int
lookup_index
);
template
<
typename
T
>
inline
return_t
process
(
const
T
&
obj
)
{
obj
.
collect_glyphs
(
this
);
return
VOID
;
}
static
return_t
default_return_value
(
void
)
{
return
VOID
;
}
bool
stop_iteration
(
const
return_t
r
)
const
{
return
false
;
}
bool
stop_
sublookup_
iteration
(
const
return_t
r
)
const
{
return
false
;
}
return_t
recurse
(
unsigned
int
lookup_index
)
{
#if 0
/* XXX */
#endif
if
(
unlikely
(
nesting_level_left
==
0
||
!
recurse_func
))
return
default_return_value
();
nesting_level_left
--
;
recurse_func
(
this
,
lookup_index
);
nesting_level_left
++
;
return
default_return_value
();
}
...
...
@@ -164,19 +168,26 @@ struct hb_collect_glyphs_context_t
hb_set_t
&
input
;
hb_set_t
&
after
;
hb_set_t
&
output
;
recurse_func_t
recurse_func
;
unsigned
int
nesting_level_left
;
unsigned
int
debug_depth
;
hb_collect_glyphs_context_t
(
hb_face_t
*
face_
,
hb_set_t
*
glyphs_before
,
/* OUT. May be NULL */
hb_set_t
*
glyphs_input
,
/* OUT. May be NULL */
hb_set_t
*
glyphs_after
,
/* OUT. May be NULL */
hb_set_t
*
glyphs_output
/* OUT. May be NULL */
)
:
hb_set_t
*
glyphs_output
,
/* OUT. May be NULL */
unsigned
int
nesting_level_left_
=
MAX_NESTING_LEVEL
)
:
face
(
face_
),
before
(
glyphs_before
?
*
glyphs_before
:
*
hb_set_get_empty
()),
input
(
glyphs_input
?
*
glyphs_input
:
*
hb_set_get_empty
()),
after
(
glyphs_after
?
*
glyphs_after
:
*
hb_set_get_empty
()),
output
(
glyphs_output
?
*
glyphs_output
:
*
hb_set_get_empty
()),
recurse_func
(
NULL
),
nesting_level_left
(
nesting_level_left_
),
debug_depth
(
0
)
{}
void
set_recurse_func
(
recurse_func_t
func
)
{
recurse_func
=
func
;
}
};
...
...
@@ -1005,6 +1016,11 @@ struct ContextFormat1
}
}
inline
void
collect_glyphs
(
hb_collect_glyphs_context_t
*
c
)
const
{
/* XXXXXXXXXX */
}
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
)
const
{
TRACE_WOULD_APPLY
(
this
);
...
...
@@ -1078,6 +1094,11 @@ struct ContextFormat2
}
}
inline
void
collect_glyphs
(
hb_collect_glyphs_context_t
*
c
)
const
{
/* XXXXXXXXXX */
}
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
)
const
{
TRACE_WOULD_APPLY
(
this
);
...
...
@@ -1153,6 +1174,11 @@ struct ContextFormat3
lookup_context
);
}
inline
void
collect_glyphs
(
hb_collect_glyphs_context_t
*
c
)
const
{
/* XXXXXXXXXX */
}
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
)
const
{
TRACE_WOULD_APPLY
(
this
);
...
...
@@ -1463,6 +1489,11 @@ struct ChainContextFormat1
}
}
inline
void
collect_glyphs
(
hb_collect_glyphs_context_t
*
c
)
const
{
/* XXXXXXXXXX */
}
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
)
const
{
TRACE_WOULD_APPLY
(
this
);
...
...
@@ -1538,6 +1569,11 @@ struct ChainContextFormat2
}
}
inline
void
collect_glyphs
(
hb_collect_glyphs_context_t
*
c
)
const
{
/* XXXXXXXXXX */
}
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
)
const
{
TRACE_WOULD_APPLY
(
this
);
...
...
@@ -1634,6 +1670,11 @@ struct ChainContextFormat3
lookup_context
);
}
inline
void
collect_glyphs
(
hb_collect_glyphs_context_t
*
c
)
const
{
/* XXXXXXXXXX */
}
inline
bool
would_apply
(
hb_would_apply_context_t
*
c
)
const
{
TRACE_WOULD_APPLY
(
this
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录