Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
14f1e81b
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看板
提交
14f1e81b
编写于
5月 12, 2011
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[test/font] Test empty funcs
上级
2ca0b5ae
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
73 addition
and
2 deletion
+73
-2
test/test-font.c
test/test-font.c
+73
-2
未找到文件。
test/test-font.c
浏览文件 @
14f1e81b
...
@@ -109,19 +109,90 @@ test_face_createfortables (void)
...
@@ -109,19 +109,90 @@ test_face_createfortables (void)
g_assert
(
freed
);
g_assert
(
freed
);
}
}
static
void
_test_font_nil_funcs
(
hb_font_t
*
font
)
{
hb_position_t
x
,
y
;
hb_glyph_extents_t
extents
;
x
=
y
=
13
;
g_assert
(
!
hb_font_get_contour_point
(
font
,
17
,
2
,
&
x
,
&
y
));
g_assert_cmpint
(
x
,
==
,
0
);
g_assert_cmpint
(
y
,
==
,
0
);
x
=
y
=
13
;
hb_font_get_glyph_advance
(
font
,
17
,
&
x
,
&
y
);
g_assert_cmpint
(
x
,
==
,
0
);
g_assert_cmpint
(
y
,
==
,
0
);
extents
.
x_bearing
=
extents
.
y_bearing
=
13
;
extents
.
width
=
extents
.
height
=
15
;
hb_font_get_glyph_extents
(
font
,
17
,
&
extents
);
g_assert_cmpint
(
extents
.
x_bearing
,
==
,
0
);
g_assert_cmpint
(
extents
.
y_bearing
,
==
,
0
);
g_assert_cmpint
(
extents
.
width
,
==
,
0
);
g_assert_cmpint
(
extents
.
height
,
==
,
0
);
g_assert
(
0
==
hb_font_get_glyph
(
font
,
17
,
2
));
x
=
y
=
13
;
hb_font_get_kerning
(
font
,
17
,
19
,
&
x
,
&
y
);
g_assert_cmpint
(
x
,
==
,
0
);
g_assert_cmpint
(
y
,
==
,
0
);
}
static
void
_test_fontfuncs_nil
(
hb_font_funcs_t
*
ffuncs
)
{
hb_blob_t
*
blob
;
hb_face_t
*
face
;
hb_font_t
*
font
;
hb_font_t
*
subfont
;
int
freed
=
0
;
blob
=
hb_blob_create
(
test_data
,
sizeof
(
test_data
),
HB_MEMORY_MODE_READONLY
,
NULL
,
NULL
);
face
=
hb_face_create
(
blob
,
0
);
hb_blob_destroy
(
blob
);
font
=
hb_font_create
(
face
);
hb_face_destroy
(
face
);
hb_font_set_funcs
(
font
,
ffuncs
,
&
freed
,
free_up
);
g_assert_cmpint
(
freed
,
==
,
0
);
_test_font_nil_funcs
(
font
);
subfont
=
hb_font_create_sub_font
(
font
);
g_assert_cmpint
(
freed
,
==
,
0
);
hb_font_destroy
(
font
);
g_assert_cmpint
(
freed
,
==
,
0
);
_test_font_nil_funcs
(
subfont
);
hb_font_destroy
(
subfont
);
g_assert_cmpint
(
freed
,
==
,
1
);
}
static
void
static
void
test_fontfuncs_empty
(
void
)
test_fontfuncs_empty
(
void
)
{
{
g_assert
(
hb_font_funcs_get_empty
());
g_assert
(
hb_font_funcs_get_empty
());
g_assert
(
hb_font_funcs_is_immutable
(
hb_font_funcs_get_empty
()));
g_assert
(
hb_font_funcs_is_immutable
(
hb_font_funcs_get_empty
()));
_test_fontfuncs_nil
(
hb_font_funcs_get_empty
());
}
}
static
void
static
void
test_fontfuncs_custom
(
void
)
test_fontfuncs_custom
(
void
)
{
{
g_assert
(
hb_font_funcs_get_empty
());
hb_font_funcs_t
*
ffuncs
;
g_assert
(
hb_font_funcs_is_immutable
(
hb_font_funcs_get_empty
()));
ffuncs
=
hb_font_funcs_create
();
g_assert
(
!
hb_font_funcs_is_immutable
(
ffuncs
));
_test_fontfuncs_nil
(
hb_font_funcs_get_empty
());
hb_font_funcs_destroy
(
ffuncs
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录