Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
feadee07
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,发现更多精彩内容 >>
提交
feadee07
编写于
10月 28, 2017
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[post] Refactor a bit, use our data types
上级
5014c60a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
10 addition
and
15 deletion
+10
-15
src/hb-ot-post-table.hh
src/hb-ot-post-table.hh
+10
-15
未找到文件。
src/hb-ot-post-table.hh
浏览文件 @
feadee07
...
@@ -52,13 +52,10 @@ struct postV2Tail
...
@@ -52,13 +52,10 @@ struct postV2Tail
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
{
TRACE_SANITIZE
(
this
);
TRACE_SANITIZE
(
this
);
return_trace
(
numberOfGlyphs
.
sanitize
(
c
)
&&
return_trace
(
glyphNameIndex
.
sanitize
(
c
));
c
->
check_array
(
glyphNameIndex
,
sizeof
(
USHORT
),
numberOfGlyphs
));
}
}
USHORT
numberOfGlyphs
;
/* Number of glyphs (this should be the
ArrayOf
<
USHORT
>
glyphNameIndex
;
/* This is not an offset, but is the
* same as numGlyphs in 'maxp' table). */
USHORT
glyphNameIndex
[
VAR
];
/* This is not an offset, but is the
* ordinal number of the glyph in 'post'
* ordinal number of the glyph in 'post'
* string tables. */
* string tables. */
BYTE
namesX
[
VAR
];
/* Glyph names with length bytes [variable]
BYTE
namesX
[
VAR
];
/* Glyph names with length bytes [variable]
...
@@ -104,7 +101,7 @@ struct post
...
@@ -104,7 +101,7 @@ struct post
{
{
const
postV2Tail
&
v2
=
StructAfter
<
postV2Tail
>
(
*
this
);
const
postV2Tail
&
v2
=
StructAfter
<
postV2Tail
>
(
*
this
);
if
(
glyph
>=
v2
.
numberOfGlyphs
)
if
(
glyph
>=
v2
.
glyphNameIndex
.
len
)
return
false
;
return
false
;
if
(
!
buffer_length
)
if
(
!
buffer_length
)
...
@@ -121,9 +118,8 @@ struct post
...
@@ -121,9 +118,8 @@ struct post
}
}
index
-=
NUM_FORMAT1_NAMES
;
index
-=
NUM_FORMAT1_NAMES
;
unsigned
int
offset
=
min_size
+
v2
.
min_size
+
2
*
v2
.
numberOfGlyphs
;
const
uint8_t
*
data
=
&
StructAfter
<
uint8_t
>
(
v2
.
glyphNameIndex
);
unsigned
char
*
data
=
(
unsigned
char
*
)
this
+
offset
;
const
uint8_t
*
end
=
(
uint8_t
*
)
this
+
blob_len
;
unsigned
char
*
end
=
(
unsigned
char
*
)
this
+
blob_len
;
for
(
unsigned
int
i
=
0
;
data
<
end
;
i
++
)
for
(
unsigned
int
i
=
0
;
data
<
end
;
i
++
)
{
{
unsigned
int
name_length
=
data
[
0
];
unsigned
int
name_length
=
data
[
0
];
...
@@ -172,13 +168,12 @@ struct post
...
@@ -172,13 +168,12 @@ struct post
if
(
version
.
to_int
()
==
0x00020000
)
if
(
version
.
to_int
()
==
0x00020000
)
{
{
const
postV2Tail
&
v2
=
StructAfter
<
postV2Tail
>
(
*
this
);
const
postV2Tail
&
v2
=
StructAfter
<
postV2Tail
>
(
*
this
);
unsigned
int
offset
=
min_size
+
v2
.
min_size
+
2
*
v2
.
numberOfGlyphs
;
const
uint8_t
*
data
=
&
StructAfter
<
uint8_t
>
(
v2
.
glyphNameIndex
);
char
*
data
=
(
char
*
)
this
+
offset
;
/* XXX The following code is wrong. */
/* XXX The following code is wrong. */
return
false
;
return
false
;
for
(
hb_codepoint_t
gid
=
0
;
gid
<
v2
.
numberOfGlyphs
;
gid
++
)
for
(
hb_codepoint_t
gid
=
0
;
gid
<
v2
.
glyphNameIndex
.
len
;
gid
++
)
{
{
unsigned
int
index
=
v2
.
glyphNameIndex
[
gid
];
unsigned
int
index
=
v2
.
glyphNameIndex
[
gid
];
if
(
index
<
NUM_FORMAT1_NAMES
)
if
(
index
<
NUM_FORMAT1_NAMES
)
...
@@ -192,12 +187,12 @@ struct post
...
@@ -192,12 +187,12 @@ struct post
}
}
index
-=
NUM_FORMAT1_NAMES
;
index
-=
NUM_FORMAT1_NAMES
;
for
(
unsigned
int
i
=
0
;
data
<
(
char
*
)
this
+
blob_len
;
i
++
)
for
(
unsigned
int
i
=
0
;
data
<
(
uint8_t
*
)
this
+
blob_len
;
i
++
)
{
{
unsigned
int
name_length
=
data
[
0
];
unsigned
int
name_length
=
data
[
0
];
unsigned
int
remaining
=
(
char
*
)
this
+
blob_len
-
data
-
1
;
unsigned
int
remaining
=
CastP
<
uint8_t
>
(
this
)
+
blob_len
-
data
-
1
;
name_length
=
MIN
(
name_length
,
remaining
);
name_length
=
MIN
(
name_length
,
remaining
);
if
(
name_length
==
(
unsigned
int
)
len
&&
strncmp
(
name
,
data
+
1
,
len
)
==
0
)
if
(
name_length
==
(
unsigned
int
)
len
&&
strncmp
(
name
,
(
const
char
*
)
data
+
1
,
len
)
==
0
)
{
{
*
glyph
=
gid
;
*
glyph
=
gid
;
return
true
;
return
true
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录