Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
d440c8d3
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看板
未验证
提交
d440c8d3
编写于
10月 22, 2018
作者:
E
Ebrahim Byagowi
提交者:
GitHub
10月 22, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add chromacheck Emoji test fonts and minor preparations (#1294)
上级
b92b9d7e
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
55 addition
and
4 deletion
+55
-4
src/hb-ot-color.cc
src/hb-ot-color.cc
+26
-0
src/hb-ot-face.hh
src/hb-ot-face.hh
+5
-3
test/api/fonts/README
test/api/fonts/README
+2
-0
test/api/fonts/chromacheck-cbdt.ttf
test/api/fonts/chromacheck-cbdt.ttf
+0
-0
test/api/fonts/chromacheck-colr.ttf
test/api/fonts/chromacheck-colr.ttf
+0
-0
test/api/fonts/chromacheck-sbix.ttf
test/api/fonts/chromacheck-sbix.ttf
+0
-0
test/api/fonts/chromacheck-svg.ttf
test/api/fonts/chromacheck-svg.ttf
+0
-0
test/api/hb-test.h
test/api/hb-test.h
+1
-1
test/api/test-ot-color.c
test/api/test-ot-color.c
+21
-0
未找到文件。
src/hb-ot-color.cc
浏览文件 @
d440c8d3
...
@@ -26,8 +26,11 @@
...
@@ -26,8 +26,11 @@
*/
*/
#include "hb-open-type.hh"
#include "hb-open-type.hh"
#include "hb-ot-color-cbdt-table.hh"
#include "hb-ot-color-colr-table.hh"
#include "hb-ot-color-colr-table.hh"
#include "hb-ot-color-cpal-table.hh"
#include "hb-ot-color-cpal-table.hh"
#include "hb-ot-color-sbix-table.hh"
#include "hb-ot-color-svg-table.hh"
#include "hb-ot-face.hh"
#include "hb-ot-face.hh"
#include "hb-ot.h"
#include "hb-ot.h"
...
@@ -51,6 +54,29 @@ _get_cpal (hb_face_t *face)
...
@@ -51,6 +54,29 @@ _get_cpal (hb_face_t *face)
return
*
(
hb_ot_face_data
(
face
)
->
CPAL
.
get
());
return
*
(
hb_ot_face_data
(
face
)
->
CPAL
.
get
());
}
}
#if 0
static inline const OT::CBDT_accelerator_t&
_get_cbdt (hb_face_t *face)
{
if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::CBDT_accelerator_t);
return *(hb_ot_face_data (face)->CBDT.get ());
}
static inline const OT::sbix&
_get_sbix (hb_face_t *face)
{
if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::sbix);
return *(hb_ot_face_data (face)->sbix.get ());
}
static inline const OT::SVG&
_get_svg (hb_face_t *face)
{
if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::SVG);
return *(hb_ot_face_data (face)->SVG.get ());
}
#endif
/**
/**
* hb_ot_color_has_cpal_data:
* hb_ot_color_has_cpal_data:
* @face: a font face.
* @face: a font face.
...
...
src/hb-ot-face.hh
浏览文件 @
d440c8d3
...
@@ -47,9 +47,6 @@
...
@@ -47,9 +47,6 @@
/* OpenType shaping. */
\
/* OpenType shaping. */
\
HB_OT_TABLE(OT, JSTF) \
HB_OT_TABLE(OT, JSTF) \
HB_OT_TABLE(OT, BASE) \
HB_OT_TABLE(OT, BASE) \
/* OpenType color */
\
HB_OT_TABLE(OT, COLR) \
HB_OT_TABLE(OT, CPAL) \
/* AAT shaping. */
\
/* AAT shaping. */
\
HB_OT_TABLE(AAT, morx) \
HB_OT_TABLE(AAT, morx) \
HB_OT_TABLE(AAT, kerx) \
HB_OT_TABLE(AAT, kerx) \
...
@@ -71,7 +68,12 @@
...
@@ -71,7 +68,12 @@
HB_OT_ACCELERATOR(OT, post) \
HB_OT_ACCELERATOR(OT, post) \
HB_OT_ACCELERATOR(OT, kern) \
HB_OT_ACCELERATOR(OT, kern) \
HB_OT_ACCELERATOR(OT, glyf) \
HB_OT_ACCELERATOR(OT, glyf) \
/* OpenType color fonts. */
\
HB_OT_TABLE(OT, COLR) \
HB_OT_TABLE(OT, CPAL) \
HB_OT_ACCELERATOR(OT, CBDT) \
HB_OT_ACCELERATOR(OT, CBDT) \
HB_OT_TABLE(OT, sbix) \
HB_OT_TABLE(OT, SVG) \
/* */
/* */
/* Declare tables. */
/* Declare tables. */
...
...
test/api/fonts/README
浏览文件 @
d440c8d3
cmap-format12-only files created by ttx & remove all other cmap entries
cmap-format12-only files created by ttx & remove all other cmap entries
Inconsolata-Regular.abc.widerc.ttf has the hmtx width of "c" set to 600; everything else is 500. Subsetting out c should reduce numberOfHMetrics to 1.
Inconsolata-Regular.abc.widerc.ttf has the hmtx width of "c" set to 600; everything else is 500. Subsetting out c should reduce numberOfHMetrics to 1.
chromacheck-* fonts are from https://github.com/RoelN/ChromaCheck/tree/master/fonts and licensed under MIT by Roel Nieskens and Google.
test/api/fonts/chromacheck-cbdt.ttf
0 → 100644
浏览文件 @
d440c8d3
文件已添加
test/api/fonts/chromacheck-colr.ttf
0 → 100644
浏览文件 @
d440c8d3
文件已添加
test/api/fonts/chromacheck-sbix.ttf
0 → 100644
浏览文件 @
d440c8d3
文件已添加
test/api/fonts/chromacheck-svg.ttf
0 → 100644
浏览文件 @
d440c8d3
文件已添加
test/api/hb-test.h
浏览文件 @
d440c8d3
...
@@ -288,7 +288,7 @@ hb_test_open_font_file (const char *font_path)
...
@@ -288,7 +288,7 @@ hb_test_open_font_file (const char *font_path)
hb_blob_t
*
blob
=
hb_blob_create_from_file
(
path
);
hb_blob_t
*
blob
=
hb_blob_create_from_file
(
path
);
if
(
hb_blob_get_length
(
blob
)
==
0
)
if
(
hb_blob_get_length
(
blob
)
==
0
)
g_error
(
"Font
not found."
);
g_error
(
"Font
%s not found."
,
path
);
hb_face_t
*
face
=
hb_face_create
(
blob
,
0
);
hb_face_t
*
face
=
hb_face_create
(
blob
,
0
);
hb_blob_destroy
(
blob
);
hb_blob_destroy
(
blob
);
...
...
test/api/test-ot-color.c
浏览文件 @
d440c8d3
...
@@ -99,6 +99,11 @@ static hb_face_t *cpal_v0 = NULL;
...
@@ -99,6 +99,11 @@ static hb_face_t *cpal_v0 = NULL;
*/
*/
static
hb_face_t
*
cpal_v1
=
NULL
;
static
hb_face_t
*
cpal_v1
=
NULL
;
static
hb_face_t
*
cpal
=
NULL
;
static
hb_face_t
*
cbdt
=
NULL
;
static
hb_face_t
*
sbix
=
NULL
;
static
hb_face_t
*
svg
=
NULL
;
#define assert_color_rgba(colors, i, r, g, b, a) G_STMT_START { \
#define assert_color_rgba(colors, i, r, g, b, a) G_STMT_START { \
const hb_color_t *_colors = (colors); \
const hb_color_t *_colors = (colors); \
const size_t _i = (i); \
const size_t _i = (i); \
...
@@ -352,10 +357,18 @@ test_hb_ot_color_has_data (void)
...
@@ -352,10 +357,18 @@ test_hb_ot_color_has_data (void)
g_assert
(
hb_ot_color_has_colr_data
(
empty
)
==
FALSE
);
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_v0
)
==
TRUE
);
g_assert
(
hb_ot_color_has_colr_data
(
cpal_v1
)
==
TRUE
);
g_assert
(
hb_ot_color_has_colr_data
(
cpal_v1
)
==
TRUE
);
g_assert
(
hb_ot_color_has_colr_data
(
cpal
)
==
TRUE
);
g_assert
(
hb_ot_color_has_colr_data
(
cbdt
)
==
FALSE
);
g_assert
(
hb_ot_color_has_colr_data
(
sbix
)
==
FALSE
);
g_assert
(
hb_ot_color_has_colr_data
(
svg
)
==
FALSE
);
g_assert
(
hb_ot_color_has_cpal_data
(
empty
)
==
FALSE
);
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_v0
)
==
TRUE
);
g_assert
(
hb_ot_color_has_cpal_data
(
cpal_v1
)
==
TRUE
);
g_assert
(
hb_ot_color_has_cpal_data
(
cpal_v1
)
==
TRUE
);
g_assert
(
hb_ot_color_has_cpal_data
(
cpal
)
==
TRUE
);
g_assert
(
hb_ot_color_has_cpal_data
(
cbdt
)
==
FALSE
);
g_assert
(
hb_ot_color_has_cpal_data
(
sbix
)
==
FALSE
);
g_assert
(
hb_ot_color_has_cpal_data
(
svg
)
==
FALSE
);
}
}
int
int
...
@@ -366,6 +379,10 @@ main (int argc, char **argv)
...
@@ -366,6 +379,10 @@ main (int argc, char **argv)
hb_test_init
(
&
argc
,
&
argv
);
hb_test_init
(
&
argc
,
&
argv
);
cpal_v0
=
hb_test_open_font_file
(
"fonts/cpal-v0.ttf"
);
cpal_v0
=
hb_test_open_font_file
(
"fonts/cpal-v0.ttf"
);
cpal_v1
=
hb_test_open_font_file
(
"fonts/cpal-v1.ttf"
);
cpal_v1
=
hb_test_open_font_file
(
"fonts/cpal-v1.ttf"
);
cpal
=
hb_test_open_font_file
(
"fonts/chromacheck-colr.ttf"
);
cbdt
=
hb_test_open_font_file
(
"fonts/chromacheck-cbdt.ttf"
);
sbix
=
hb_test_open_font_file
(
"fonts/chromacheck-sbix.ttf"
);
svg
=
hb_test_open_font_file
(
"fonts/chromacheck-svg.ttf"
);
hb_test_add
(
test_hb_ot_color_get_palette_count
);
hb_test_add
(
test_hb_ot_color_get_palette_count
);
hb_test_add
(
test_hb_ot_color_get_palette_name_id_empty
);
hb_test_add
(
test_hb_ot_color_get_palette_name_id_empty
);
hb_test_add
(
test_hb_ot_color_get_palette_name_id_v0
);
hb_test_add
(
test_hb_ot_color_get_palette_name_id_v0
);
...
@@ -382,5 +399,9 @@ main (int argc, char **argv)
...
@@ -382,5 +399,9 @@ main (int argc, char **argv)
status
=
hb_test_run
();
status
=
hb_test_run
();
hb_face_destroy
(
cpal_v0
);
hb_face_destroy
(
cpal_v0
);
hb_face_destroy
(
cpal_v1
);
hb_face_destroy
(
cpal_v1
);
hb_face_destroy
(
cpal
);
hb_face_destroy
(
cbdt
);
hb_face_destroy
(
sbix
);
hb_face_destroy
(
svg
);
return
status
;
return
status
;
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录