Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
4af3be6e
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看板
提交
4af3be6e
编写于
1月 25, 2019
作者:
G
Garret Rieger
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove glyph array from subset plan, make num_glyphs and glyphset private.
上级
23f36442
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
41 addition
and
10 deletion
+41
-10
src/hb-subset-plan.hh
src/hb-subset-plan.hh
+41
-10
未找到文件。
src/hb-subset-plan.hh
浏览文件 @
4af3be6e
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
#include "hb-subset-input.hh"
#include "hb-subset-input.hh"
#include "hb-map.hh"
#include "hb-map.hh"
#include "hb-set.hh"
struct
hb_subset_plan_t
struct
hb_subset_plan_t
{
{
...
@@ -46,21 +47,51 @@ struct hb_subset_plan_t
...
@@ -46,21 +47,51 @@ struct hb_subset_plan_t
hb_set_t
*
unicodes
;
hb_set_t
*
unicodes
;
// The glyph subset
// The glyph subset
hb_vector_t
<
hb_codepoint_t
>
glyphs
;
hb_set_t
*
glyphset
;
hb_map_t
*
codepoint_to_glyph
;
hb_map_t
*
codepoint_to_glyph
;
// Old -> New glyph id mapping
// Old -> New glyph id mapping
hb_map_t
*
glyph_map
;
hb_map_t
*
glyph_map
;
hb_map_t
*
reverse_glyph_map
;
hb_map_t
*
reverse_glyph_map
;
unsigned
int
num_glyphs
;
// Plan is only good for a specific source/dest so keep them with it
// Plan is only good for a specific source/dest so keep them with it
hb_face_t
*
source
;
hb_face_t
*
source
;
hb_face_t
*
dest
;
hb_face_t
*
dest
;
bool
new_gid_for_codepoint
(
hb_codepoint_t
codepoint
,
private:
hb_codepoint_t
*
new_gid
)
const
unsigned
int
_num_output_glyphs
;
hb_set_t
*
_glyphset
;
public:
/*
* The set of input glyph ids which will be retained in the subset.
*/
inline
const
hb_set_t
*
glyphset
()
const
{
return
_glyphset
;
}
/*
* The total number of output glyphs in the final subset.
*/
inline
unsigned
int
num_output_glyphs
()
{
return
_num_output_glyphs
;
}
/*
* Given an output gid , returns true if that glyph id is an empty
* glyph (ie. it's a gid that we are dropping all data for).
*/
inline
bool
is_empty_glyph
(
hb_codepoint_t
gid
)
const
{
return
!
_glyphset
->
has
(
gid
);
}
inline
bool
new_gid_for_codepoint
(
hb_codepoint_t
codepoint
,
hb_codepoint_t
*
new_gid
)
const
{
{
hb_codepoint_t
old_gid
=
codepoint_to_glyph
->
get
(
codepoint
);
hb_codepoint_t
old_gid
=
codepoint_to_glyph
->
get
(
codepoint
);
if
(
old_gid
==
HB_MAP_VALUE_INVALID
)
if
(
old_gid
==
HB_MAP_VALUE_INVALID
)
...
@@ -69,8 +100,8 @@ struct hb_subset_plan_t
...
@@ -69,8 +100,8 @@ struct hb_subset_plan_t
return
new_gid_for_old_gid
(
old_gid
,
new_gid
);
return
new_gid_for_old_gid
(
old_gid
,
new_gid
);
}
}
bool
new_gid_for_old_gid
(
hb_codepoint_t
old_gid
,
inline
bool
new_gid_for_old_gid
(
hb_codepoint_t
old_gid
,
hb_codepoint_t
*
new_gid
)
const
hb_codepoint_t
*
new_gid
)
const
{
{
hb_codepoint_t
gid
=
glyph_map
->
get
(
old_gid
);
hb_codepoint_t
gid
=
glyph_map
->
get
(
old_gid
);
if
(
gid
==
HB_MAP_VALUE_INVALID
)
if
(
gid
==
HB_MAP_VALUE_INVALID
)
...
@@ -80,8 +111,8 @@ struct hb_subset_plan_t
...
@@ -80,8 +111,8 @@ struct hb_subset_plan_t
return
true
;
return
true
;
}
}
bool
old_gid_for_new_gid
(
hb_codepoint_t
new_gid
,
inline
bool
old_gid_for_new_gid
(
hb_codepoint_t
new_gid
,
hb_codepoint_t
*
old_gid
)
const
hb_codepoint_t
*
old_gid
)
const
{
{
hb_codepoint_t
gid
=
reverse_glyph_map
->
get
(
new_gid
);
hb_codepoint_t
gid
=
reverse_glyph_map
->
get
(
new_gid
);
if
(
gid
==
HB_MAP_VALUE_INVALID
)
if
(
gid
==
HB_MAP_VALUE_INVALID
)
...
@@ -91,7 +122,7 @@ struct hb_subset_plan_t
...
@@ -91,7 +122,7 @@ struct hb_subset_plan_t
return
true
;
return
true
;
}
}
bool
inline
bool
add_table
(
hb_tag_t
tag
,
add_table
(
hb_tag_t
tag
,
hb_blob_t
*
contents
)
hb_blob_t
*
contents
)
{
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录