Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
13193a9b
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,发现更多精彩内容 >>
提交
13193a9b
编写于
2月 07, 2018
作者:
R
Rod Sheeter
提交者:
Behdad Esfahbod
2月 08, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
move to the hb_face_t dest pattern
上级
0859a006
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
19 addition
and
16 deletion
+19
-16
src/hb-ot-cmap-table.hh
src/hb-ot-cmap-table.hh
+6
-1
src/hb-subset.cc
src/hb-subset.cc
+13
-15
未找到文件。
src/hb-ot-cmap-table.hh
浏览文件 @
13193a9b
...
@@ -504,8 +504,13 @@ struct cmap
...
@@ -504,8 +504,13 @@ struct cmap
encodingRecord
.
sanitize
(
c
,
this
));
encodingRecord
.
sanitize
(
c
,
this
));
}
}
inline
bool
subset
(
hb_subset_plan_t
*
plan
,
OT
::
hb_serialize_context_t
*
ou
t
)
const
inline
bool
subset
(
hb_subset_plan_t
*
plan
,
hb_face_t
*
source
,
hb_face_t
*
des
t
)
const
{
{
// TODO something useful re: memory, write to dest
size_t
dest_sz
=
64536
;
// as much as anyone would ever need
void
*
dest_buf
=
malloc
(
dest_sz
);
OT
::
hb_serialize_context_t
context
(
dest_buf
,
dest_sz
);
// Same version
// Same version
OT
::
cmap
new_cmap
;
OT
::
cmap
new_cmap
;
new_cmap
.
version
=
version
;
new_cmap
.
version
=
version
;
...
...
src/hb-subset.cc
浏览文件 @
13193a9b
...
@@ -109,22 +109,21 @@ hb_subset_input_destroy(hb_subset_input_t *subset_input)
...
@@ -109,22 +109,21 @@ hb_subset_input_destroy(hb_subset_input_t *subset_input)
template
<
typename
TableType
>
template
<
typename
TableType
>
hb_bool_t
hb_bool_t
subset
(
hb_subset_plan_t
*
plan
,
hb_face_t
*
face
,
hb_blob_t
**
ou
t
)
subset
(
hb_subset_plan_t
*
plan
,
hb_face_t
*
source
,
hb_face_t
*
des
t
)
{
{
OT
::
Sanitizer
<
TableType
>
sanitizer
;
OT
::
Sanitizer
<
TableType
>
sanitizer
;
hb_blob_t
*
table_blob
=
sanitizer
.
sanitize
(
fa
ce
->
reference_table
(
TableType
::
tableTag
));
hb_blob_t
*
table_blob
=
sanitizer
.
sanitize
(
sour
ce
->
reference_table
(
TableType
::
tableTag
));
if
(
unlikely
(
!
table_blob
))
{
if
(
unlikely
(
!
table_blob
))
{
DEBUG_MSG
(
SUBSET
,
nullptr
,
"Failed to reference table for tag %d"
,
TableType
::
tableTag
);
return
false
;
return
false
;
}
}
const
TableType
*
table
=
OT
::
Sanitizer
<
TableType
>::
lock_instance
(
table_blob
);
const
TableType
*
table
=
OT
::
Sanitizer
<
TableType
>::
lock_instance
(
table_blob
);
hb_bool_t
result
=
table
->
subset
(
plan
,
source
,
dest
);
// TODO actually manage the context/output memory
size_t
dest_sz
=
64536
;
// as much as anyone would ever need
void
*
dest
=
malloc
(
dest_sz
);
OT
::
hb_serialize_context_t
context
(
dest
,
dest_sz
);
hb_bool_t
result
=
table
->
subset
(
plan
,
&
context
);
// TODO populate out
hb_blob_destroy
(
table_blob
);
hb_blob_destroy
(
table_blob
);
// TODO string not numeric tag
DEBUG_MSG
(
SUBSET
,
nullptr
,
"Subset %d %s"
,
TableType
::
tableTag
,
result
?
"success"
:
"FAILED!"
);
return
result
;
return
result
;
}
}
...
@@ -306,18 +305,17 @@ hb_subset (hb_face_t *source,
...
@@ -306,18 +305,17 @@ hb_subset (hb_face_t *source,
// - copy the table into the output.
// - copy the table into the output.
// - Fix header + table directory.
// - Fix header + table directory.
bool
success
=
true
;
hb_face_t
*
dest
=
nullptr
;
// TODO allocate dest
hb_blob_t
*
glyf_prime
=
nullptr
;
hb_blob_t
*
glyf_prime
=
nullptr
;
if
(
hb_subset_glyf
(
plan
,
source
,
&
glyf_prime
))
{
if
(
hb_subset_glyf
(
plan
,
source
,
&
glyf_prime
))
{
// TODO: write new glyf to new face.
// TODO: write new glyf to new face.
}
}
hb_blob_destroy
(
glyf_prime
);
hb_blob_destroy
(
glyf_prime
);
hb_blob_t
*
cmap_prime
=
nullptr
;
success
=
success
&&
subset
<
const
OT
::
cmap
>
(
plan
,
source
,
dest
);
if
(
subset
<
const
OT
::
cmap
>
(
plan
,
source
,
&
cmap_prime
))
{
DEBUG_MSG
(
SUBSET
,
nullptr
,
"subset cmap success!"
);
}
else
{
DEBUG_MSG
(
SUBSET
,
nullptr
,
"subset cmap FAILED!"
);
}
hb_subset_plan_destroy
(
plan
);
hb_subset_plan_destroy
(
plan
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录