Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
a76344da
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看板
提交
a76344da
编写于
2月 27, 2018
作者:
G
Garret Rieger
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[subset] Add maxpV1Tail instead of defining a struct inside maxp for v1 data.
上级
f14d1b64
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
49 addition
and
32 deletion
+49
-32
src/hb-ot-maxp-table.hh
src/hb-ot-maxp-table.hh
+49
-32
未找到文件。
src/hb-ot-maxp-table.hh
浏览文件 @
a76344da
...
...
@@ -39,6 +39,36 @@ namespace OT {
#define HB_OT_TAG_maxp HB_TAG('m','a','x','p')
struct
maxpV1Tail
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return_trace
(
c
->
check_struct
(
this
));
}
HBUINT16
maxPoints
;
/* Maximum points in a non-composite glyph. */
HBUINT16
maxContours
;
/* Maximum contours in a non-composite glyph. */
HBUINT16
maxCompositePoints
;
/* Maximum points in a composite glyph. */
HBUINT16
maxCompositeContours
;
/* Maximum contours in a composite glyph. */
HBUINT16
maxZones
;
/* 1 if instructions do not use the twilight zone (Z0),
or 2 if instructions do use Z0; should be set to 2 in
most cases. */
HBUINT16
maxTwilightPoints
;
/* Maximum points used in Z0. */
HBUINT16
maxStorage
;
/* Number of Storage Area locations. */
HBUINT16
maxFunctionDefs
;
/* Number of FDEFs, equal to the highest function number + 1. */
HBUINT16
maxInstructionDefs
;
/* Number of IDEFs. */
HBUINT16
maxStackElements
;
/* Maximum stack depth. (This includes Font and CVT
Programs, as well as the instructions for each glyph.) */
HBUINT16
maxSizeOfInstructions
;
/* Maximum byte count for glyph instructions. */
HBUINT16
maxComponentElements
;
/* Maximum number of components referenced at
"top level" for any composite glyph. */
HBUINT16
maxComponentDepth
;
/* Maximum levels of recursion; 1 for simple components. */
DEFINE_SIZE_STATIC
(
26
);
};
struct
maxp
{
static
const
hb_tag_t
tableTag
=
HB_OT_TAG_maxp
;
...
...
@@ -56,9 +86,15 @@ struct maxp
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return_trace
(
c
->
check_struct
(
this
)
&&
likely
((
version
.
major
==
1
&&
c
->
check_range
(
this
,
sizeof
(
maxp
)))
||
(
version
.
major
==
0
&&
version
.
minor
==
0x5000u
)));
if
(
unlikely
(
!
c
->
check_struct
(
this
)))
return_trace
(
false
);
if
(
version
.
major
==
1
)
{
const
maxpV1Tail
&
v1
=
StructAfter
<
maxpV1Tail
>
(
*
this
);
return
v1
.
sanitize
(
c
);
}
return_trace
(
likely
(
version
.
major
==
0
&&
version
.
minor
==
0x5000u
));
}
inline
bool
subset
(
hb_subset_plan_t
*
plan
)
const
...
...
@@ -83,15 +119,16 @@ struct maxp
static
inline
void
drop_hint_fields
(
hb_subset_plan_t
*
plan
,
OT
::
maxp
*
maxp_prime
)
{
maxpV1Tail
&
v1
=
StructAfter
<
maxpV1Tail
>
(
*
maxp_prime
);
if
(
maxp_prime
->
version
.
major
==
1
)
{
maxp_prime
->
version_1_data
.
maxZones
.
set
(
1
);
maxp_prime
->
version_1_data
.
maxTwilightPoints
.
set
(
0
);
maxp_prime
->
version_1_data
.
maxStorage
.
set
(
0
);
maxp_prime
->
version_1_data
.
maxFunctionDefs
.
set
(
0
);
maxp_prime
->
version_1_data
.
maxInstructionDefs
.
set
(
0
);
maxp_prime
->
version_1_data
.
maxStackElements
.
set
(
0
);
maxp_prime
->
version_1_data
.
maxSizeOfInstructions
.
set
(
0
);
v1
.
maxZones
.
set
(
1
);
v1
.
maxTwilightPoints
.
set
(
0
);
v1
.
maxStorage
.
set
(
0
);
v1
.
maxFunctionDefs
.
set
(
0
);
v1
.
maxInstructionDefs
.
set
(
0
);
v1
.
maxStackElements
.
set
(
0
);
v1
.
maxSizeOfInstructions
.
set
(
0
);
}
}
...
...
@@ -99,30 +136,10 @@ struct maxp
FixedVersion
<>
version
;
/* Version of the maxp table (0.5 or 1.0),
* 0x00005000u or 0x00010000u. */
HBUINT16
numGlyphs
;
/* The number of glyphs in the font. */
struct
{
HBUINT16
maxPoints
;
/* Maximum points in a non-composite glyph. */
HBUINT16
maxContours
;
/* Maximum contours in a non-composite glyph. */
HBUINT16
maxCompositePoints
;
/* Maximum points in a composite glyph. */
HBUINT16
maxCompositeContours
;
/* Maximum contours in a composite glyph. */
HBUINT16
maxZones
;
/* 1 if instructions do not use the twilight zone (Z0),
or 2 if instructions do use Z0; should be set to 2 in
most cases. */
HBUINT16
maxTwilightPoints
;
/* Maximum points used in Z0. */
HBUINT16
maxStorage
;
/* Number of Storage Area locations. */
HBUINT16
maxFunctionDefs
;
/* Number of FDEFs, equal to the highest function number + 1. */
HBUINT16
maxInstructionDefs
;
/* Number of IDEFs. */
HBUINT16
maxStackElements
;
/* Maximum stack depth. (This includes Font and CVT
Programs, as well as the instructions for each glyph.) */
HBUINT16
maxSizeOfInstructions
;
/* Maximum byte count for glyph instructions. */
HBUINT16
maxComponentElements
;
/* Maximum number of components referenced at
"top level" for any composite glyph. */
HBUINT16
maxComponentDepth
;
/* Maximum levels of recursion; 1 for simple components. */
}
version_1_data
;
/*maxpV1Tail v1Tail; */
public:
DEFINE_SIZE_
MIN
(
6
);
DEFINE_SIZE_
STATIC
(
6
);
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录