Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
1608481d
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看板
提交
1608481d
编写于
9月 12, 2018
作者:
M
Michiharu Ariza
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixed bugs in Charset serialization
also some code cleanup
上级
f45ac629
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
22 addition
and
26 deletion
+22
-26
src/hb-ot-cff1-table.hh
src/hb-ot-cff1-table.hh
+2
-2
src/hb-subset-cff1.cc
src/hb-subset-cff1.cc
+20
-24
未找到文件。
src/hb-ot-cff1-table.hh
浏览文件 @
1608481d
...
...
@@ -446,7 +446,7 @@ struct Charset {
dest
->
format
.
set
(
format
);
if
(
format
==
0
)
{
Charset0
*
fmt0
=
c
->
allocate_size
<
Charset0
>
(
Charset0
::
min_size
+
HBUINT
8
::
static_size
*
(
num_glyphs
-
1
));
Charset0
*
fmt0
=
c
->
allocate_size
<
Charset0
>
(
Charset0
::
min_size
+
HBUINT
16
::
static_size
*
(
num_glyphs
-
1
));
if
(
unlikely
(
fmt0
==
nullptr
))
return_trace
(
false
);
unsigned
int
glyph
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
sid_ranges
.
len
;
i
++
)
...
...
@@ -488,7 +488,7 @@ struct Charset {
{
unsigned
int
size
=
min_size
;
if
(
format
==
0
)
size
+=
Charset0
::
min_size
+
HBUINT
8
::
static_size
*
(
count
-
1
);
size
+=
Charset0
::
min_size
+
HBUINT
16
::
static_size
*
(
count
-
1
);
else
if
(
format
==
1
)
size
+=
Charset1
::
min_size
+
Charset1_Range
::
static_size
*
count
;
else
...
...
src/hb-subset-cff1.cc
浏览文件 @
1608481d
...
...
@@ -321,6 +321,21 @@ struct CFF1CSOpSet_Flatten : CFF1CSOpSet<CFF1CSOpSet_Flatten, FlattenParam>
typedef
CFF1CSOpSet
<
CFF1CSOpSet_Flatten
,
FlattenParam
>
SUPER
;
};
struct
RangeList
:
hb_vector_t
<
code_pair
>
{
/* replace the first glyph ID in the "glyph" field each range with a nLeft value */
inline
void
finalize
(
unsigned
int
last_glyph
)
{
for
(
unsigned
int
i
=
(
*
this
).
len
;
i
>
0
;
i
--
)
{
code_pair
&
pair
=
(
*
this
)[
i
-
1
];
unsigned
int
nLeft
=
last_glyph
-
pair
.
glyph
-
1
;
last_glyph
=
pair
.
glyph
;
pair
.
glyph
=
nLeft
;
}
}
};
struct
cff_subset_plan
{
inline
cff_subset_plan
(
void
)
:
final_size
(
0
),
...
...
@@ -387,11 +402,6 @@ struct cff_subset_plan {
if
(
code
!=
last_code
+
1
)
{
if
(
subset_enc_code_ranges
.
len
>
0
)
{
code_pair
&
pair
=
subset_enc_code_ranges
[
subset_enc_code_ranges
.
len
-
1
];
pair
.
glyph
=
glyph
-
pair
.
glyph
-
1
;
}
code_pair
pair
=
{
code
,
glyph
};
subset_enc_code_ranges
.
push
(
pair
);
}
...
...
@@ -410,11 +420,8 @@ struct cff_subset_plan {
}
}
supp_codes
.
fini
();
if
(
subset_enc_code_ranges
.
len
>
0
)
{
code_pair
&
pair
=
subset_enc_code_ranges
[
subset_enc_code_ranges
.
len
-
1
];
pair
.
glyph
=
glyph
-
pair
.
glyph
-
1
;
}
subset_enc_code_ranges
.
finalize
(
glyph
);
assert
(
subset_enc_num_codes
<=
0xFF
);
size0
=
Encoding0
::
min_size
+
HBUINT8
::
static_size
*
subset_enc_num_codes
;
...
...
@@ -449,24 +456,13 @@ struct cff_subset_plan {
if
(
sid
!=
last_sid
+
1
)
{
if
(
subset_charset_ranges
.
len
>
0
)
{
code_pair
&
pair
=
subset_charset_ranges
[
subset_charset_ranges
.
len
-
1
];
pair
.
glyph
=
glyph
-
pair
.
glyph
-
1
;
if
((
pair
.
glyph
&
~
0xFF
)
!=
0
)
two_byte
=
true
;
}
code_pair
pair
=
{
sid
,
glyph
};
subset_charset_ranges
.
push
(
pair
);
}
last_sid
=
sid
;
}
if
(
subset_charset_ranges
.
len
>
0
)
{
code_pair
&
pair
=
subset_charset_ranges
[
subset_charset_ranges
.
len
-
1
];
pair
.
glyph
=
glyph
-
pair
.
glyph
-
1
;
if
((
pair
.
glyph
&
~
0xFF
)
!=
0
)
two_byte
=
true
;
}
subset_charset_ranges
.
finalize
(
glyph
);
size0
=
Charset0
::
min_size
+
HBUINT16
::
static_size
*
(
plan
->
glyphs
.
len
-
1
);
if
(
!
two_byte
)
...
...
@@ -706,11 +702,11 @@ struct cff_subset_plan {
bool
subset_encoding
;
uint8_t
subset_enc_format
;
unsigned
int
subset_enc_num_codes
;
hb_vector_t
<
code_pair
>
subset_enc_code_ranges
;
RangeList
subset_enc_code_ranges
;
hb_vector_t
<
code_pair
>
subset_enc_supp_codes
;
uint8_t
subset_charset_format
;
hb_vector_t
<
code_pair
>
subset_charset_ranges
;
RangeList
subset_charset_ranges
;
bool
subset_charset
;
RemapSID
sidmap
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录