Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
05e99c86
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看板
提交
05e99c86
编写于
1月 28, 2019
作者:
G
Garret Rieger
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[subset] A few small fixes for the new subset plan api.
上级
bdbe047d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
7 addition
and
10 deletion
+7
-10
src/hb-ot-hdmx-table.hh
src/hb-ot-hdmx-table.hh
+3
-3
src/hb-ot-hmtx-table.hh
src/hb-ot-hmtx-table.hh
+3
-6
src/hb-subset.cc
src/hb-subset.cc
+1
-1
未找到文件。
src/hb-ot-hdmx-table.hh
浏览文件 @
05e99c86
...
@@ -57,7 +57,7 @@ struct DeviceRecord
...
@@ -57,7 +57,7 @@ struct DeviceRecord
}
}
unsigned
int
len
()
const
unsigned
int
len
()
const
{
return
this
->
subset_plan
->
num_
glyphs
;
}
{
return
this
->
subset_plan
->
num_
output_glyphs
()
;
}
const
HBUINT8
*
operator
[]
(
unsigned
int
new_gid
)
const
const
HBUINT8
*
operator
[]
(
unsigned
int
new_gid
)
const
{
{
...
@@ -143,7 +143,7 @@ struct hdmx
...
@@ -143,7 +143,7 @@ struct hdmx
this
->
version
.
set
(
source_hdmx
->
version
);
this
->
version
.
set
(
source_hdmx
->
version
);
this
->
numRecords
.
set
(
source_hdmx
->
numRecords
);
this
->
numRecords
.
set
(
source_hdmx
->
numRecords
);
this
->
sizeDeviceRecord
.
set
(
DeviceRecord
::
get_size
(
plan
->
num_
glyphs
));
this
->
sizeDeviceRecord
.
set
(
DeviceRecord
::
get_size
(
plan
->
num_
output_glyphs
()
));
for
(
unsigned
int
i
=
0
;
i
<
source_hdmx
->
numRecords
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
source_hdmx
->
numRecords
;
i
++
)
{
{
...
@@ -159,7 +159,7 @@ struct hdmx
...
@@ -159,7 +159,7 @@ struct hdmx
static
size_t
get_subsetted_size
(
const
hdmx
*
source_hdmx
,
hb_subset_plan_t
*
plan
)
static
size_t
get_subsetted_size
(
const
hdmx
*
source_hdmx
,
hb_subset_plan_t
*
plan
)
{
{
return
min_size
+
source_hdmx
->
numRecords
*
DeviceRecord
::
get_size
(
plan
->
num_
glyphs
);
return
min_size
+
source_hdmx
->
numRecords
*
DeviceRecord
::
get_size
(
plan
->
num_
output_glyphs
()
);
}
}
bool
subset
(
hb_subset_plan_t
*
plan
)
const
bool
subset
(
hb_subset_plan_t
*
plan
)
const
...
...
src/hb-ot-hmtx-table.hh
浏览文件 @
05e99c86
...
@@ -108,10 +108,7 @@ struct hmtxvmtx
...
@@ -108,10 +108,7 @@ struct hmtxvmtx
DEBUG_MSG
(
SUBSET
,
nullptr
,
"%c%c%c%c in dest has %d advances, %d lsbs, %u bytes"
,
DEBUG_MSG
(
SUBSET
,
nullptr
,
"%c%c%c%c in dest has %d advances, %d lsbs, %u bytes"
,
HB_UNTAG
(
T
::
tableTag
),
num_advances
,
num_output_glyphs
-
num_advances
,
(
unsigned
int
)
dest_sz
);
HB_UNTAG
(
T
::
tableTag
),
num_advances
,
num_output_glyphs
-
num_advances
,
(
unsigned
int
)
dest_sz
);
const
char
*
source_table
=
hb_blob_get_data
(
_mtx
.
table
.
get_blob
(),
nullptr
);
// Copy everything over
// Copy everything over
LongMetric
*
old_metrics
=
(
LongMetric
*
)
source_table
;
FWORD
*
lsbs
=
(
FWORD
*
)
(
old_metrics
+
_mtx
.
num_advances
);
char
*
dest_pos
=
(
char
*
)
dest
;
char
*
dest_pos
=
(
char
*
)
dest
;
bool
failed
=
false
;
bool
failed
=
false
;
...
@@ -131,12 +128,12 @@ struct hmtxvmtx
...
@@ -131,12 +128,12 @@ struct hmtxvmtx
bool
has_advance
=
i
<
num_advances
;
bool
has_advance
=
i
<
num_advances
;
if
(
has_advance
)
if
(
has_advance
)
{
{
((
LongMetric
*
)
dest_pos
)
->
advance
=
advance
;
((
LongMetric
*
)
dest_pos
)
->
advance
.
set
(
advance
)
;
((
LongMetric
*
)
dest_pos
)
->
sb
=
side_bearing
;
((
LongMetric
*
)
dest_pos
)
->
sb
.
set
(
side_bearing
)
;
}
}
else
else
{
{
*
((
FWORD
*
)
dest_pos
)
=
side_bearing
;
((
FWORD
*
)
dest_pos
)
->
set
(
side_bearing
)
;
}
}
dest_pos
+=
(
has_advance
?
4
:
2
);
dest_pos
+=
(
has_advance
?
4
:
2
);
}
}
...
...
src/hb-subset.cc
浏览文件 @
05e99c86
...
@@ -52,7 +52,7 @@ _plan_estimate_subset_table_size (hb_subset_plan_t *plan,
...
@@ -52,7 +52,7 @@ _plan_estimate_subset_table_size (hb_subset_plan_t *plan,
unsigned
int
table_len
)
unsigned
int
table_len
)
{
{
unsigned
int
src_glyphs
=
plan
->
source
->
get_num_glyphs
();
unsigned
int
src_glyphs
=
plan
->
source
->
get_num_glyphs
();
unsigned
int
dst_glyphs
=
plan
->
glyphset
->
get_population
();
unsigned
int
dst_glyphs
=
plan
->
glyphset
()
->
get_population
();
if
(
unlikely
(
!
src_glyphs
))
if
(
unlikely
(
!
src_glyphs
))
return
512
+
table_len
;
return
512
+
table_len
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录