Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
b3790a65
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看板
提交
b3790a65
编写于
2月 27, 2018
作者:
R
Rod Sheeter
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[subset] add a (failing for now) test for composite glyf hint dropping
上级
903771b6
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
29 addition
and
6 deletion
+29
-6
src/hb-ot-glyf-table.hh
src/hb-ot-glyf-table.hh
+4
-4
test/api/test-subset-glyf.c
test/api/test-subset-glyf.c
+25
-2
未找到文件。
src/hb-ot-glyf-table.hh
浏览文件 @
b3790a65
...
...
@@ -402,14 +402,14 @@ struct glyf
int16_t
num_contours
=
(
int16_t
)
glyph_header
.
numberOfContours
;
if
(
num_contours
<
0
)
{
CompositeGlyphHeader
::
Iterator
*
composite_it
;
CompositeGlyphHeader
::
Iterator
composite_it
;
if
(
unlikely
(
!
CompositeGlyphHeader
::
get_iterator
(
(
const
char
*
)
this
->
glyf_table
+
start_offset
,
end_offset
-
start_offset
,
composite_it
)))
return
false
;
end_offset
-
start_offset
,
&
composite_it
)))
return
false
;
const
CompositeGlyphHeader
*
last
;
do
{
last
=
composite_it
->
current
;
}
while
(
composite_it
->
move_to_next
());
last
=
composite_it
.
current
;
}
while
(
composite_it
.
move_to_next
());
if
(
(
uint16_t
)
last
->
flags
&
CompositeGlyphHeader
::
WE_HAVE_INSTRUCTIONS
)
*
instruction_start
=
start_offset
+
((
char
*
)
last
-
(
char
*
)
glyf_table
->
dataX
)
+
last
->
get_size
();
...
...
test/api/test-subset-glyf.c
浏览文件 @
b3790a65
...
...
@@ -105,7 +105,7 @@ test_subset_glyf_noop (void)
}
static
void
test_subset_glyf_strip_hints
(
void
)
test_subset_glyf_strip_hints
_simple
(
void
)
{
hb_face_t
*
face_abc
=
hb_subset_test_open_font
(
"fonts/Roboto-Regular.abc.ttf"
);
hb_face_t
*
face_ac
=
hb_subset_test_open_font
(
"fonts/Roboto-Regular.ac.nohints.ttf"
);
...
...
@@ -128,6 +128,28 @@ test_subset_glyf_strip_hints (void)
}
// TODO(rsheeter): test strip hints from composite
static
void
test_subset_glyf_strip_hints_composite
(
void
)
{
hb_face_t
*
face_components
=
hb_subset_test_open_font
(
"fonts/Roboto-Regular.components.ttf"
);
hb_face_t
*
face_subset
=
hb_subset_test_open_font
(
"fonts/Roboto-Regular.components.subset.ttf"
);
hb_set_t
*
codepoints
=
hb_set_create
();
hb_set_add
(
codepoints
,
0x1fc
);
hb_subset_input_t
*
input
=
hb_subset_test_create_input
(
codepoints
);
*
hb_subset_input_drop_hints
(
input
)
=
true
;
hb_face_t
*
face_generated_subset
=
hb_subset_test_create_subset
(
face_components
,
input
);
hb_set_destroy
(
codepoints
);
hb_subset_test_check
(
face_subset
,
face_generated_subset
,
HB_TAG
(
'g'
,
'l'
,
'y'
,
'f'
));
hb_subset_test_check
(
face_subset
,
face_generated_subset
,
HB_TAG
(
'l'
,
'o'
,
'c'
,
'a'
));
check_maxp_num_glyphs
(
face_generated_subset
,
4
);
hb_face_destroy
(
face_generated_subset
);
hb_face_destroy
(
face_subset
);
hb_face_destroy
(
face_components
);
}
// TODO(grieger): test for long loca generation.
...
...
@@ -138,7 +160,8 @@ main (int argc, char **argv)
hb_test_add
(
test_subset_glyf_noop
);
hb_test_add
(
test_subset_glyf
);
hb_test_add
(
test_subset_glyf_strip_hints
);
hb_test_add
(
test_subset_glyf_strip_hints_simple
);
hb_test_add
(
test_subset_glyf_strip_hints_composite
);
hb_test_add
(
test_subset_glyf_with_components
);
return
hb_test_run
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录