Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
2da1654a
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看板
提交
2da1654a
编写于
1月 18, 2019
作者:
G
Garret Rieger
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[subset] Compute num_glyphs during subset plan construction.
Update maxp to use the correct num glyphs.
上级
ccc59dc6
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
16 addition
and
9 deletion
+16
-9
src/hb-ot-maxp-table.hh
src/hb-ot-maxp-table.hh
+1
-1
src/hb-subset-glyf.cc
src/hb-subset-glyf.cc
+1
-5
src/hb-subset-plan.cc
src/hb-subset-plan.cc
+13
-3
src/hb-subset-plan.hh
src/hb-subset-plan.hh
+1
-0
未找到文件。
src/hb-ot-maxp-table.hh
浏览文件 @
2da1654a
...
...
@@ -105,7 +105,7 @@ struct maxp
}
maxp
*
maxp_prime
=
(
maxp
*
)
hb_blob_get_data
(
maxp_prime_blob
,
nullptr
);
maxp_prime
->
set_num_glyphs
(
plan
->
glyphs
.
length
);
maxp_prime
->
set_num_glyphs
(
plan
->
num_glyphs
);
if
(
plan
->
drop_hints
)
drop_hint_fields
(
plan
,
maxp_prime
);
...
...
src/hb-subset-glyf.cc
浏览文件 @
2da1654a
...
...
@@ -119,13 +119,9 @@ _calculate_glyf_and_loca_prime_size (const OT::glyf::accelerator_t &glyf,
hb_vector_t
<
unsigned
int
>
*
instruction_ranges
/* OUT */
)
{
unsigned
int
total
=
0
;
hb_codepoint_t
max_new_gid
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
plan
->
glyphs
.
length
;
i
++
)
{
hb_codepoint_t
next_glyph
=
plan
->
glyphs
[
i
];
hb_codepoint_t
new_gid_for_next_glyph
;
if
(
plan
->
new_gid_for_old_gid
(
next_glyph
,
&
new_gid_for_next_glyph
))
max_new_gid
=
MAX
(
max_new_gid
,
new_gid_for_next_glyph
);
unsigned
int
start_offset
,
end_offset
;
if
(
unlikely
(
!
(
glyf
.
get_offsets
(
next_glyph
,
&
start_offset
,
&
end_offset
)
&&
...
...
@@ -156,7 +152,7 @@ _calculate_glyf_and_loca_prime_size (const OT::glyf::accelerator_t &glyf,
*
glyf_size
=
total
;
loca_data
->
is_short
=
(
total
<=
131070
);
loca_data
->
size
=
(
max_new_gid
+
2
)
loca_data
->
size
=
(
plan
->
num_glyphs
+
1
)
*
(
loca_data
->
is_short
?
sizeof
(
OT
::
HBUINT16
)
:
sizeof
(
OT
::
HBUINT32
));
DEBUG_MSG
(
SUBSET
,
nullptr
,
"preparing to subset glyf: final size %d, loca size %d, using %s loca"
,
...
...
src/hb-subset-plan.cc
浏览文件 @
2da1654a
...
...
@@ -156,9 +156,10 @@ _populate_gids_to_retain (hb_face_t *face,
}
static
void
_create_old_gid_to_new_gid_map
(
bool
retain_gids
,
_create_old_gid_to_new_gid_map
(
bool
retain_gids
,
const
hb_vector_t
<
hb_codepoint_t
>
&
glyphs
,
hb_map_t
*
glyph_map
)
hb_map_t
*
glyph_map
,
/* OUT */
unsigned
int
*
num_glyphs
/* OUT */
)
{
for
(
unsigned
int
i
=
0
;
i
<
glyphs
.
length
;
i
++
)
{
if
(
!
retain_gids
)
...
...
@@ -166,6 +167,14 @@ _create_old_gid_to_new_gid_map (bool retain_gids,
else
glyph_map
->
set
(
glyphs
[
i
],
glyphs
[
i
]);
}
if
(
!
retain_gids
||
glyphs
.
length
==
0
)
{
*
num_glyphs
=
glyphs
.
length
;
}
else
{
*
num_glyphs
=
glyphs
[
glyphs
.
length
-
1
]
+
1
;
}
}
/**
...
...
@@ -202,7 +211,8 @@ hb_subset_plan_create (hb_face_t *face,
_create_old_gid_to_new_gid_map
(
input
->
retain_gids
,
plan
->
glyphs
,
plan
->
glyph_map
);
plan
->
glyph_map
,
&
plan
->
num_glyphs
);
return
plan
;
}
...
...
src/hb-subset-plan.hh
浏览文件 @
2da1654a
...
...
@@ -50,6 +50,7 @@ struct hb_subset_plan_t
hb_map_t
*
codepoint_to_glyph
;
hb_map_t
*
glyph_map
;
unsigned
int
num_glyphs
;
// Plan is only good for a specific source/dest so keep them with it
hb_face_t
*
source
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录