Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
941600a9
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看板
提交
941600a9
编写于
10月 25, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[layout] Add hb_collect_features_context_t
Towards
https://github.com/harfbuzz/harfbuzz/pull/1317
上级
c237cdfc
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
36 addition
and
30 deletion
+36
-30
src/hb-ot-layout.cc
src/hb-ot-layout.cc
+36
-30
未找到文件。
src/hb-ot-layout.cc
浏览文件 @
941600a9
...
...
@@ -655,20 +655,32 @@ hb_ot_layout_table_get_lookup_count (hb_face_t *face,
return
get_gsubgpos_table
(
face
,
table_tag
).
get_lookup_count
();
}
struct
hb_collect_features_context_t
{
hb_collect_features_context_t
(
hb_face_t
*
face
,
hb_tag_t
table_tag
,
hb_set_t
*
feature_indexes_
)
:
g
(
get_gsubgpos_table
(
face
,
table_tag
)),
feature_indexes
(
feature_indexes_
)
{}
const
OT
::
GSUBGPOS
&
g
;
hb_set_t
*
feature_indexes
;
};
static
void
langsys_collect_features
(
const
OT
::
GSUBGPOS
&
g
,
langsys_collect_features
(
hb_collect_features_context_t
*
c
,
const
OT
::
LangSys
&
l
,
const
hb_tag_t
*
features
,
hb_set_t
*
feature_indexes
/* OUT */
)
const
hb_tag_t
*
features
)
{
if
(
!
features
)
{
/* All features. */
unsigned
int
index
=
l
.
get_required_feature_index
();
if
(
index
!=
HB_OT_LAYOUT_NO_FEATURE_INDEX
)
feature_indexes
->
add
(
index
);
c
->
feature_indexes
->
add
(
index
);
l
.
add_feature_indexes_to
(
feature_indexes
);
l
.
add_feature_indexes_to
(
c
->
feature_indexes
);
}
else
{
...
...
@@ -682,9 +694,9 @@ langsys_collect_features (const OT::GSUBGPOS &g,
{
unsigned
int
feature_index
=
l
.
get_feature_index
(
i
);
if
(
feature_tag
==
g
.
get_feature_tag
(
feature_index
))
if
(
feature_tag
==
c
->
g
.
get_feature_tag
(
feature_index
))
{
feature_indexes
->
add
(
feature_index
);
c
->
feature_indexes
->
add
(
feature_index
);
break
;
}
}
...
...
@@ -693,26 +705,23 @@ langsys_collect_features (const OT::GSUBGPOS &g,
}
static
void
script_collect_features
(
const
OT
::
GSUBGPOS
&
g
,
script_collect_features
(
hb_collect_features_context_t
*
c
,
const
OT
::
Script
&
s
,
const
hb_tag_t
*
languages
,
const
hb_tag_t
*
features
,
hb_set_t
*
feature_indexes
/* OUT */
)
const
hb_tag_t
*
features
)
{
if
(
!
languages
)
{
/* All languages. */
langsys_collect_features
(
g
,
langsys_collect_features
(
c
,
s
.
get_default_lang_sys
(),
features
,
feature_indexes
);
features
);
unsigned
int
count
=
s
.
get_lang_sys_count
();
for
(
unsigned
int
language_index
=
0
;
language_index
<
count
;
language_index
++
)
langsys_collect_features
(
g
,
langsys_collect_features
(
c
,
s
.
get_lang_sys
(
language_index
),
features
,
feature_indexes
);
features
);
}
else
{
...
...
@@ -720,10 +729,9 @@ script_collect_features (const OT::GSUBGPOS &g,
{
unsigned
int
language_index
;
if
(
s
.
find_lang_sys_index
(
*
languages
,
&
language_index
))
langsys_collect_features
(
g
,
langsys_collect_features
(
c
,
s
.
get_lang_sys
(
language_index
),
features
,
feature_indexes
);
features
);
}
}
}
...
...
@@ -741,29 +749,27 @@ hb_ot_layout_collect_features (hb_face_t *face,
const
hb_tag_t
*
features
,
hb_set_t
*
feature_indexes
/* OUT */
)
{
const
OT
::
GSUBGPOS
&
g
=
get_gsubgpos_table
(
face
,
table_tag
);
hb_collect_features_context_t
c
(
face
,
table_tag
,
feature_indexes
);
if
(
!
scripts
)
{
/* All scripts. */
unsigned
int
count
=
g
.
get_script_count
();
unsigned
int
count
=
c
.
g
.
get_script_count
();
for
(
unsigned
int
script_index
=
0
;
script_index
<
count
;
script_index
++
)
script_collect_features
(
g
,
g
.
get_script
(
script_index
),
script_collect_features
(
&
c
,
c
.
g
.
get_script
(
script_index
),
languages
,
features
,
feature_indexes
);
features
);
}
else
{
for
(;
*
scripts
;
scripts
++
)
{
unsigned
int
script_index
;
if
(
g
.
find_script_index
(
*
scripts
,
&
script_index
))
script_collect_features
(
g
,
g
.
get_script
(
script_index
),
if
(
c
.
g
.
find_script_index
(
*
scripts
,
&
script_index
))
script_collect_features
(
&
c
,
c
.
g
.
get_script
(
script_index
),
languages
,
features
,
feature_indexes
);
features
);
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录