Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
6795dcfc
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看板
提交
6795dcfc
编写于
10月 21, 2018
作者:
E
Ebrahim Byagowi
提交者:
Khaled Hosny
10月 22, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[test] Test hb_ot_color_has_{colr,cpal}_data
上级
b8ee3a0e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
29 addition
and
4 deletion
+29
-4
src/dump-emoji.cc
src/dump-emoji.cc
+2
-1
src/hb-ot-color.cc
src/hb-ot-color.cc
+4
-3
test/api/test-ot-color.c
test/api/test-ot-color.c
+23
-0
未找到文件。
src/dump-emoji.cc
浏览文件 @
6795dcfc
/*
* Copyright © 2018 Ebrahim Byagowi
* Copyright © 2018 Khaled Hosny
*
* This is part of HarfBuzz, a text shaping library.
*
...
...
@@ -140,7 +141,7 @@ colr_cpal_rendering (hb_face_t *face, cairo_font_face_t *cairo_face)
hb_ot_color_get_palette_colors
(
face
,
palette
,
0
,
&
num_colors
,
colors
);
if
(
num_colors
)
{
// If we have more than one palette, use a
better namin
// If we have more than one palette, use a
simpler naming
if
(
palette_count
==
1
)
sprintf
(
output_path
,
"out/colr-%d.svg"
,
gid
);
else
...
...
src/hb-ot-color.cc
浏览文件 @
6795dcfc
...
...
@@ -117,7 +117,7 @@ hb_ot_color_get_palette_name_id (hb_face_t *face, unsigned int palette)
}
/**
* hb_ot_color_get_palette_count:
* hb_ot_color_get_palette_
entry_
count:
* @face: a font face.
*
* Returns: Number of entries on each palette
...
...
@@ -206,7 +206,8 @@ hb_ot_color_get_palette_colors (hb_face_t *face,
* @gid:
* @start_offset:
* @count: (inout) (optional):
* @color_indices: (array length=color_count) (optional):
* @gids: (array length=count) (optional):
* @color_indices: (array length=count) (optional):
*
* Returns:
*
...
...
@@ -250,7 +251,7 @@ hb_ot_color_get_color_layers (hb_face_t *face,
* or if @palette is not between 0 and hb_ot_color_get_palette_count(),
* the result is #HB_OT_COLOR_PALETTE_FLAG_DEFAULT.
*
* Since:
DONT
REPLACEME
* Since: REPLACEME
*/
hb_ot_color_palette_flags_t
hb_ot_color_get_palette_flags
(
hb_face_t
*
face
,
unsigned
int
palette
)
...
...
test/api/test-ot-color.c
浏览文件 @
6795dcfc
/*
* Copyright © 2016 Google, Inc.
* Copyright © 2018 Ebrahim Byagowi
*
* This is part of HarfBuzz, a text shaping library.
*
...
...
@@ -321,6 +322,13 @@ test_hb_ot_color_get_color_layers (void)
unsigned
int
color_indices
[
1
];
unsigned
int
count
=
1
;
g_assert_cmpuint
(
hb_ot_color_get_color_layers
(
cpal_v1
,
0
,
0
,
NULL
,
NULL
,
NULL
),
==
,
0
);
g_assert_cmpuint
(
hb_ot_color_get_color_layers
(
cpal_v1
,
1
,
0
,
NULL
,
NULL
,
NULL
),
==
,
0
);
g_assert_cmpuint
(
hb_ot_color_get_color_layers
(
cpal_v1
,
2
,
0
,
NULL
,
NULL
,
NULL
),
==
,
2
);
unsigned
int
num_layers
;
num_layers
=
hb_ot_color_get_color_layers
(
cpal_v1
,
2
,
0
,
&
count
,
layer_gids
,
color_indices
);
...
...
@@ -340,6 +348,20 @@ test_hb_ot_color_get_color_layers (void)
g_assert_cmpuint
(
color_indices
[
0
],
==
,
0
);
}
static
void
test_hb_ot_color_has_data
(
void
)
{
hb_face_t
*
empty
=
hb_face_get_empty
();
g_assert
(
hb_ot_color_has_colr_data
(
empty
)
==
FALSE
);
g_assert
(
hb_ot_color_has_colr_data
(
cpal_v0
)
==
TRUE
);
g_assert
(
hb_ot_color_has_colr_data
(
cpal_v1
)
==
TRUE
);
g_assert
(
hb_ot_color_has_cpal_data
(
empty
)
==
FALSE
);
g_assert
(
hb_ot_color_has_cpal_data
(
cpal_v0
)
==
TRUE
);
g_assert
(
hb_ot_color_has_cpal_data
(
cpal_v1
)
==
TRUE
);
}
int
main
(
int
argc
,
char
**
argv
)
{
...
...
@@ -360,6 +382,7 @@ main (int argc, char **argv)
hb_test_add
(
test_hb_ot_color_get_palette_colors_v1
);
hb_test_add
(
test_hb_ot_color_get_palette_entry
);
hb_test_add
(
test_hb_ot_color_get_color_layers
);
hb_test_add
(
test_hb_ot_color_has_data
);
status
=
hb_test_run
();
hb_face_destroy
(
cpal_v0
);
hb_face_destroy
(
cpal_v1
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录