Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
5dadbb0f
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5dadbb0f
编写于
4月 17, 2018
作者:
G
Garret Rieger
提交者:
Behdad Esfahbod
4月 17, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[subset] Add implementation of cmap format 12 codepoint listing. (#988)
上级
6771e79b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
64 addition
and
1 deletion
+64
-1
src/hb-ot-cmap-table.hh
src/hb-ot-cmap-table.hh
+20
-1
test/api/fonts/Roboto-Regular.abc.format12.ttf
test/api/fonts/Roboto-Regular.abc.format12.ttf
+0
-0
test/api/test-subset-codepoints.c
test/api/test-subset-codepoints.c
+44
-0
未找到文件。
src/hb-ot-cmap-table.hh
浏览文件 @
5dadbb0f
...
...
@@ -204,6 +204,8 @@ struct CmapSubtableLongGroup
{
friend
struct
CmapSubtableFormat12
;
friend
struct
CmapSubtableFormat13
;
template
<
typename
U
>
friend
struct
CmapSubtableLongSegmented
;
friend
struct
cmap
;
int
cmp
(
hb_codepoint_t
codepoint
)
const
...
...
@@ -276,6 +278,15 @@ struct CmapSubtableLongSegmented
return
true
;
}
inline
void
get_all_codepoints
(
hb_set_t
*
out
)
const
{
for
(
unsigned
int
i
=
0
;
i
<
this
->
groups
.
len
;
i
++
)
{
hb_set_add_range
(
out
,
this
->
groups
[
i
].
startCharCode
,
this
->
groups
[
i
].
endCharCode
);
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
...
...
@@ -690,7 +701,7 @@ struct cmap
break
;
case
12
:
this
->
get_glyph_func
=
get_glyph_from
<
OT
::
CmapSubtableFormat12
>
;
this
->
get_all_codepoints_func
=
null_get_all_codepoints_func
;
this
->
get_all_codepoints_func
=
get_all_codepoints_from
<
OT
::
CmapSubtableFormat12
>
;
break
;
case
4
:
{
...
...
@@ -757,6 +768,14 @@ struct cmap
return
typed_obj
->
get_glyph
(
codepoint
,
glyph
);
}
template
<
typename
Type
>
static
inline
void
get_all_codepoints_from
(
const
void
*
obj
,
hb_set_t
*
out
)
{
const
Type
*
typed_obj
=
(
const
Type
*
)
obj
;
typed_obj
->
get_all_codepoints
(
out
);
}
template
<
typename
Type
>
static
inline
bool
get_glyph_from_symbol
(
const
void
*
obj
,
hb_codepoint_t
codepoint
,
...
...
test/api/fonts/Roboto-Regular.abc.format12.ttf
0 → 100644
浏览文件 @
5dadbb0f
文件已添加
test/api/test-subset-codepoints.c
浏览文件 @
5dadbb0f
...
...
@@ -48,12 +48,56 @@ test_get_all_codepoints_format4 (void)
hb_face_destroy
(
face
);
}
static
void
test_get_all_codepoints_format12
(
void
)
{
hb_face_t
*
face
=
hb_subset_test_open_font
(
"fonts/Roboto-Regular.abc.format12.ttf"
);
hb_set_t
*
codepoints
=
hb_set_create
();
hb_subset_get_all_codepoints
(
face
,
codepoints
);
hb_codepoint_t
cp
=
HB_SET_VALUE_INVALID
;
g_assert
(
hb_set_next
(
codepoints
,
&
cp
));
g_assert_cmpuint
(
0x61
,
==
,
cp
);
g_assert
(
hb_set_next
(
codepoints
,
&
cp
));
g_assert_cmpuint
(
0x62
,
==
,
cp
);
g_assert
(
hb_set_next
(
codepoints
,
&
cp
));
g_assert_cmpuint
(
0x63
,
==
,
cp
);
g_assert
(
!
hb_set_next
(
codepoints
,
&
cp
));
hb_set_destroy
(
codepoints
);
hb_face_destroy
(
face
);
}
static
void
test_get_all_codepoints
(
void
)
{
hb_face_t
*
face
=
hb_subset_test_open_font
(
"fonts/Roboto-Regular.abc.ttf"
);
hb_set_t
*
codepoints
=
hb_set_create
();
hb_subset_get_all_codepoints
(
face
,
codepoints
);
hb_codepoint_t
cp
=
HB_SET_VALUE_INVALID
;
g_assert
(
hb_set_next
(
codepoints
,
&
cp
));
g_assert_cmpuint
(
0x61
,
==
,
cp
);
g_assert
(
hb_set_next
(
codepoints
,
&
cp
));
g_assert_cmpuint
(
0x62
,
==
,
cp
);
g_assert
(
hb_set_next
(
codepoints
,
&
cp
));
g_assert_cmpuint
(
0x63
,
==
,
cp
);
g_assert
(
!
hb_set_next
(
codepoints
,
&
cp
));
hb_set_destroy
(
codepoints
);
hb_face_destroy
(
face
);
}
int
main
(
int
argc
,
char
**
argv
)
{
hb_test_init
(
&
argc
,
&
argv
);
hb_test_add
(
test_get_all_codepoints
);
hb_test_add
(
test_get_all_codepoints_format4
);
hb_test_add
(
test_get_all_codepoints_format12
);
return
hb_test_run
();
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录