Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
7fd0b61d
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看板
提交
7fd0b61d
编写于
2月 07, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[subset] Create new face and copy all tables to it
test-subset fails now because subset-face does not know how to compile itself.
上级
4e1abe2c
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
26 addition
and
11 deletion
+26
-11
src/hb-subset.cc
src/hb-subset.cc
+26
-11
未找到文件。
src/hb-subset.cc
浏览文件 @
7fd0b61d
...
...
@@ -194,10 +194,9 @@ hb_subset_face_add_table (hb_face_t *face, hb_tag_t tag, hb_blob_t *blob)
/**
* hb_subset:
* @source: font face data to be subset.
* @profile: profile to use for the subsetting.
* @input: input to use for the subsetting.
* @face: font face data to be subset.
* @result: subsetting result.
*
* Subsets a font according to provided profile and input.
**/
...
...
@@ -210,13 +209,32 @@ hb_subset (hb_face_t *source,
hb_subset_plan_t
*
plan
=
hb_subset_plan_create
(
source
,
profile
,
input
);
hb_face_t
*
face
=
hb_subset_face_create
();
/* Copy tables to new face. */
{
hb_tag_t
table_tags
[
32
];
unsigned
int
offset
=
0
,
count
;
do
{
count
==
ARRAY_LENGTH
(
table_tags
);
hb_face_get_table_tags
(
source
,
offset
,
&
count
,
table_tags
);
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
{
hb_tag_t
tag
=
table_tags
[
i
];
hb_blob_t
*
blob
=
hb_face_reference_table
(
source
,
tag
);
hb_subset_face_add_table
(
face
,
tag
,
blob
);
hb_blob_destroy
(
blob
);
}
}
while
(
count
==
ARRAY_LENGTH
(
table_tags
));
}
hb_codepoint_t
old_gid
=
-
1
;
while
(
hb_set_next
(
plan
->
glyphs_to_retain
,
&
old_gid
))
{
while
(
hb_set_next
(
plan
->
glyphs_to_retain
,
&
old_gid
))
{
hb_codepoint_t
new_gid
;
if
(
hb_subset_plan_new_gid_for_old_id
(
plan
,
old_gid
,
&
new_gid
))
{
DEBUG_MSG
(
SUBSET
,
nullptr
,
"Remap %d : %d"
,
old_gid
,
new_gid
);
if
(
hb_subset_plan_new_gid_for_old_id
(
plan
,
old_gid
,
&
new_gid
))
{
DEBUG_MSG
(
SUBSET
,
nullptr
,
"Remap %d : %d"
,
old_gid
,
new_gid
);
}
else
{
DEBUG_MSG
(
SUBSET
,
nullptr
,
"Remap %d : DOOM! No new ID"
,
old_gid
);
DEBUG_MSG
(
SUBSET
,
nullptr
,
"Remap %d : DOOM! No new ID"
,
old_gid
);
}
}
// TODO:
...
...
@@ -226,16 +244,13 @@ hb_subset (hb_face_t *source,
// - copy the table into the output.
// - Fix header + table directory.
bool
success
=
true
;
hb_blob_t
*
glyf_prime
=
nullptr
;
if
(
hb_subset_glyf
(
plan
,
source
,
&
glyf_prime
))
{
// TODO: write new glyf to new face.
}
else
{
success
=
false
;
}
hb_blob_destroy
(
glyf_prime
);
hb_subset_plan_destroy
(
plan
);
return
success
?
hb_face_reference
(
source
)
:
nullptr
;
return
face
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录