Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
63f57f4d
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看板
提交
63f57f4d
编写于
5月 08, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Mark more unsized array's as arrayZ
上级
091c17df
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
131 addition
and
131 deletion
+131
-131
src/hb-aat-layout-common-private.hh
src/hb-aat-layout-common-private.hh
+7
-7
src/hb-aat-layout-kerx-table.hh
src/hb-aat-layout-kerx-table.hh
+1
-1
src/hb-aat-layout-morx-table.hh
src/hb-aat-layout-morx-table.hh
+3
-3
src/hb-open-file-private.hh
src/hb-open-file-private.hh
+3
-3
src/hb-open-type-private.hh
src/hb-open-type-private.hh
+20
-20
src/hb-ot-cmap-table.hh
src/hb-ot-cmap-table.hh
+1
-1
src/hb-ot-color-cbdt-table.hh
src/hb-ot-color-cbdt-table.hh
+5
-5
src/hb-ot-layout-common-private.hh
src/hb-ot-layout-common-private.hh
+6
-6
src/hb-ot-layout-gsub-table.hh
src/hb-ot-layout-gsub-table.hh
+8
-8
src/hb-ot-layout-gsubgpos-private.hh
src/hb-ot-layout-gsubgpos-private.hh
+32
-32
src/hb-ot-post-table.hh
src/hb-ot-post-table.hh
+2
-2
src/hb-ot-var-avar-table.hh
src/hb-ot-var-avar-table.hh
+13
-13
src/hb-private.hh
src/hb-private.hh
+27
-27
src/hb-set-private.hh
src/hb-set-private.hh
+2
-2
src/hb-subset.cc
src/hb-subset.cc
+1
-1
未找到文件。
src/hb-aat-layout-common-private.hh
浏览文件 @
63f57f4d
...
@@ -67,11 +67,11 @@ struct BinSearchArrayOf
...
@@ -67,11 +67,11 @@ struct BinSearchArrayOf
inline
const
Type
&
operator
[]
(
unsigned
int
i
)
const
inline
const
Type
&
operator
[]
(
unsigned
int
i
)
const
{
{
if
(
unlikely
(
i
>=
header
.
nUnits
))
return
Null
(
Type
);
if
(
unlikely
(
i
>=
header
.
nUnits
))
return
Null
(
Type
);
return
StructAtOffset
<
Type
>
(
bytes
,
i
*
header
.
unitSize
);
return
StructAtOffset
<
Type
>
(
bytes
Z
,
i
*
header
.
unitSize
);
}
}
inline
Type
&
operator
[]
(
unsigned
int
i
)
inline
Type
&
operator
[]
(
unsigned
int
i
)
{
{
return
StructAtOffset
<
Type
>
(
bytes
,
i
*
header
.
unitSize
);
return
StructAtOffset
<
Type
>
(
bytes
Z
,
i
*
header
.
unitSize
);
}
}
inline
unsigned
int
get_size
(
void
)
const
inline
unsigned
int
get_size
(
void
)
const
{
return
header
.
static_size
+
header
.
nUnits
*
header
.
unitSize
;
}
{
return
header
.
static_size
+
header
.
nUnits
*
header
.
unitSize
;
}
...
@@ -88,7 +88,7 @@ struct BinSearchArrayOf
...
@@ -88,7 +88,7 @@ struct BinSearchArrayOf
* pointed to do have a simple sanitize(), ie. they do not
* pointed to do have a simple sanitize(), ie. they do not
* reference other structs via offsets.
* reference other structs via offsets.
*/
*/
(
void
)
(
false
&&
StructAtOffset
<
Type
>
(
bytes
,
0
).
sanitize
(
c
));
(
void
)
(
false
&&
StructAtOffset
<
Type
>
(
bytes
Z
,
0
).
sanitize
(
c
));
return_trace
(
true
);
return_trace
(
true
);
}
}
...
@@ -111,7 +111,7 @@ struct BinSearchArrayOf
...
@@ -111,7 +111,7 @@ struct BinSearchArrayOf
while
(
min
<=
max
)
while
(
min
<=
max
)
{
{
int
mid
=
(
min
+
max
)
/
2
;
int
mid
=
(
min
+
max
)
/
2
;
const
Type
*
p
=
(
const
Type
*
)
(((
const
char
*
)
bytes
)
+
(
mid
*
size
));
const
Type
*
p
=
(
const
Type
*
)
(((
const
char
*
)
bytes
Z
)
+
(
mid
*
size
));
int
c
=
p
->
cmp
(
key
);
int
c
=
p
->
cmp
(
key
);
if
(
c
<
0
)
if
(
c
<
0
)
max
=
mid
-
1
;
max
=
mid
-
1
;
...
@@ -129,14 +129,14 @@ struct BinSearchArrayOf
...
@@ -129,14 +129,14 @@ struct BinSearchArrayOf
TRACE_SANITIZE
(
this
);
TRACE_SANITIZE
(
this
);
return_trace
(
header
.
sanitize
(
c
)
&&
return_trace
(
header
.
sanitize
(
c
)
&&
Type
::
static_size
>=
header
.
unitSize
&&
Type
::
static_size
>=
header
.
unitSize
&&
c
->
check_array
(
bytes
,
header
.
unitSize
,
header
.
nUnits
));
c
->
check_array
(
bytes
Z
,
header
.
unitSize
,
header
.
nUnits
));
}
}
protected:
protected:
BinSearchHeader
header
;
BinSearchHeader
header
;
HBUINT8
bytes
[
VAR
];
HBUINT8
bytes
Z
[
VAR
];
public:
public:
DEFINE_SIZE_ARRAY
(
10
,
bytes
);
DEFINE_SIZE_ARRAY
(
10
,
bytes
Z
);
};
};
...
...
src/hb-aat-layout-kerx-table.hh
浏览文件 @
63f57f4d
...
@@ -334,7 +334,7 @@ struct kerx
...
@@ -334,7 +334,7 @@ struct kerx
HBUINT16
version
;
HBUINT16
version
;
HBUINT16
padding
;
HBUINT16
padding
;
HBUINT32
nTables
;
HBUINT32
nTables
;
/*KerxTable tables
[VAR];
*/
/*KerxTable tables
Z[VAR]; XXX ArrayOf???
*/
/*SubtableGlyphCoverageArray coverage_array;*/
/*SubtableGlyphCoverageArray coverage_array;*/
public:
public:
DEFINE_SIZE_STATIC
(
8
);
DEFINE_SIZE_STATIC
(
8
);
...
...
src/hb-aat-layout-morx-table.hh
浏览文件 @
63f57f4d
...
@@ -689,7 +689,7 @@ struct morx
...
@@ -689,7 +689,7 @@ struct morx
inline
void
apply
(
hb_aat_apply_context_t
*
c
)
const
inline
void
apply
(
hb_aat_apply_context_t
*
c
)
const
{
{
c
->
set_lookup_index
(
0
);
c
->
set_lookup_index
(
0
);
const
Chain
*
chain
=
chains
;
const
Chain
*
chain
=
chains
Z
;
unsigned
int
count
=
chainCount
;
unsigned
int
count
=
chainCount
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
{
{
...
@@ -706,7 +706,7 @@ struct morx
...
@@ -706,7 +706,7 @@ struct morx
!
chainCount
.
sanitize
(
c
))
!
chainCount
.
sanitize
(
c
))
return_trace
(
false
);
return_trace
(
false
);
const
Chain
*
chain
=
chains
;
const
Chain
*
chain
=
chains
Z
;
unsigned
int
count
=
chainCount
;
unsigned
int
count
=
chainCount
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
{
{
...
@@ -723,7 +723,7 @@ struct morx
...
@@ -723,7 +723,7 @@ struct morx
* 1 for mort, 2 or 3 for morx. */
* 1 for mort, 2 or 3 for morx. */
HBUINT32
chainCount
;
/* Number of metamorphosis chains contained in this
HBUINT32
chainCount
;
/* Number of metamorphosis chains contained in this
* table. */
* table. */
Chain
chains
[
VAR
];
/* Chains. */
Chain
chains
Z
[
VAR
];
/* Chains. */
public:
public:
DEFINE_SIZE_MIN
(
8
);
DEFINE_SIZE_MIN
(
8
);
...
...
src/hb-open-file-private.hh
浏览文件 @
63f57f4d
...
@@ -100,7 +100,7 @@ typedef struct OffsetTable
...
@@ -100,7 +100,7 @@ typedef struct OffsetTable
else
else
*
table_count
=
MIN
<
unsigned
int
>
(
*
table_count
,
tables
.
len
-
start_offset
);
*
table_count
=
MIN
<
unsigned
int
>
(
*
table_count
,
tables
.
len
-
start_offset
);
const
TableRecord
*
sub_tables
=
tables
.
array
+
start_offset
;
const
TableRecord
*
sub_tables
=
tables
.
array
Z
+
start_offset
;
unsigned
int
count
=
*
table_count
;
unsigned
int
count
=
*
table_count
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
table_tags
[
i
]
=
sub_tables
[
i
].
tag
;
table_tags
[
i
]
=
sub_tables
[
i
].
tag
;
...
@@ -148,7 +148,7 @@ typedef struct OffsetTable
...
@@ -148,7 +148,7 @@ typedef struct OffsetTable
/* Write OffsetTables, alloc for and write actual table blobs. */
/* Write OffsetTables, alloc for and write actual table blobs. */
for
(
unsigned
int
i
=
0
;
i
<
table_count
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
table_count
;
i
++
)
{
{
TableRecord
&
rec
=
tables
.
array
[
i
];
TableRecord
&
rec
=
tables
.
array
Z
[
i
];
hb_blob_t
*
blob
=
blobs
[
i
];
hb_blob_t
*
blob
=
blobs
[
i
];
rec
.
tag
.
set
(
tags
[
i
]);
rec
.
tag
.
set
(
tags
[
i
]);
rec
.
length
.
set
(
hb_blob_get_length
(
blob
));
rec
.
length
.
set
(
hb_blob_get_length
(
blob
));
...
@@ -188,7 +188,7 @@ typedef struct OffsetTable
...
@@ -188,7 +188,7 @@ typedef struct OffsetTable
checksum
.
set_for_data
(
this
,
dir_end
-
(
const
char
*
)
this
);
checksum
.
set_for_data
(
this
,
dir_end
-
(
const
char
*
)
this
);
for
(
unsigned
int
i
=
0
;
i
<
table_count
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
table_count
;
i
++
)
{
{
TableRecord
&
rec
=
tables
.
array
[
i
];
TableRecord
&
rec
=
tables
.
array
Z
[
i
];
checksum
.
set
(
checksum
+
rec
.
checkSum
);
checksum
.
set
(
checksum
+
rec
.
checkSum
);
}
}
...
...
src/hb-open-type-private.hh
浏览文件 @
63f57f4d
...
@@ -920,17 +920,17 @@ struct ArrayOf
...
@@ -920,17 +920,17 @@ struct ArrayOf
count
-=
start_offset
;
count
-=
start_offset
;
count
=
MIN
(
count
,
*
pcount
);
count
=
MIN
(
count
,
*
pcount
);
*
pcount
=
count
;
*
pcount
=
count
;
return
array
+
start_offset
;
return
array
Z
+
start_offset
;
}
}
inline
const
Type
&
operator
[]
(
unsigned
int
i
)
const
inline
const
Type
&
operator
[]
(
unsigned
int
i
)
const
{
{
if
(
unlikely
(
i
>=
len
))
return
Null
(
Type
);
if
(
unlikely
(
i
>=
len
))
return
Null
(
Type
);
return
array
[
i
];
return
array
Z
[
i
];
}
}
inline
Type
&
operator
[]
(
unsigned
int
i
)
inline
Type
&
operator
[]
(
unsigned
int
i
)
{
{
return
array
[
i
];
return
array
Z
[
i
];
}
}
inline
unsigned
int
get_size
(
void
)
const
inline
unsigned
int
get_size
(
void
)
const
{
return
len
.
static_size
+
len
*
Type
::
static_size
;
}
{
return
len
.
static_size
+
len
*
Type
::
static_size
;
}
...
@@ -952,7 +952,7 @@ struct ArrayOf
...
@@ -952,7 +952,7 @@ struct ArrayOf
TRACE_SERIALIZE
(
this
);
TRACE_SERIALIZE
(
this
);
if
(
unlikely
(
!
serialize
(
c
,
items_len
)))
return_trace
(
false
);
if
(
unlikely
(
!
serialize
(
c
,
items_len
)))
return_trace
(
false
);
for
(
unsigned
int
i
=
0
;
i
<
items_len
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
items_len
;
i
++
)
array
[
i
]
=
items
[
i
];
array
Z
[
i
]
=
items
[
i
];
items
+=
items_len
;
items
+=
items_len
;
return_trace
(
true
);
return_trace
(
true
);
}
}
...
@@ -969,7 +969,7 @@ struct ArrayOf
...
@@ -969,7 +969,7 @@ struct ArrayOf
* pointed to do have a simple sanitize(), ie. they do not
* pointed to do have a simple sanitize(), ie. they do not
* reference other structs via offsets.
* reference other structs via offsets.
*/
*/
(
void
)
(
false
&&
array
[
0
].
sanitize
(
c
));
(
void
)
(
false
&&
array
Z
[
0
].
sanitize
(
c
));
return_trace
(
true
);
return_trace
(
true
);
}
}
...
@@ -979,7 +979,7 @@ struct ArrayOf
...
@@ -979,7 +979,7 @@ struct ArrayOf
if
(
unlikely
(
!
sanitize_shallow
(
c
)))
return_trace
(
false
);
if
(
unlikely
(
!
sanitize_shallow
(
c
)))
return_trace
(
false
);
unsigned
int
count
=
len
;
unsigned
int
count
=
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
if
(
unlikely
(
!
array
[
i
].
sanitize
(
c
,
base
)))
if
(
unlikely
(
!
array
Z
[
i
].
sanitize
(
c
,
base
)))
return_trace
(
false
);
return_trace
(
false
);
return_trace
(
true
);
return_trace
(
true
);
}
}
...
@@ -990,7 +990,7 @@ struct ArrayOf
...
@@ -990,7 +990,7 @@ struct ArrayOf
if
(
unlikely
(
!
sanitize_shallow
(
c
)))
return_trace
(
false
);
if
(
unlikely
(
!
sanitize_shallow
(
c
)))
return_trace
(
false
);
unsigned
int
count
=
len
;
unsigned
int
count
=
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
if
(
unlikely
(
!
array
[
i
].
sanitize
(
c
,
base
,
user_data
)))
if
(
unlikely
(
!
array
Z
[
i
].
sanitize
(
c
,
base
,
user_data
)))
return_trace
(
false
);
return_trace
(
false
);
return_trace
(
true
);
return_trace
(
true
);
}
}
...
@@ -1000,28 +1000,28 @@ struct ArrayOf
...
@@ -1000,28 +1000,28 @@ struct ArrayOf
{
{
unsigned
int
count
=
len
;
unsigned
int
count
=
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
if
(
!
this
->
array
[
i
].
cmp
(
x
))
if
(
!
this
->
array
Z
[
i
].
cmp
(
x
))
return
i
;
return
i
;
return
-
1
;
return
-
1
;
}
}
inline
void
qsort
(
void
)
inline
void
qsort
(
void
)
{
{
::
qsort
(
array
,
len
,
sizeof
(
Type
),
Type
::
cmp
);
::
qsort
(
array
Z
,
len
,
sizeof
(
Type
),
Type
::
cmp
);
}
}
private:
private:
inline
bool
sanitize_shallow
(
hb_sanitize_context_t
*
c
)
const
inline
bool
sanitize_shallow
(
hb_sanitize_context_t
*
c
)
const
{
{
TRACE_SANITIZE
(
this
);
TRACE_SANITIZE
(
this
);
return_trace
(
len
.
sanitize
(
c
)
&&
c
->
check_array
(
array
,
Type
::
static_size
,
len
));
return_trace
(
len
.
sanitize
(
c
)
&&
c
->
check_array
(
array
Z
,
Type
::
static_size
,
len
));
}
}
public:
public:
LenType
len
;
LenType
len
;
Type
array
[
VAR
];
Type
array
Z
[
VAR
];
public:
public:
DEFINE_SIZE_ARRAY
(
sizeof
(
LenType
),
array
);
DEFINE_SIZE_ARRAY
(
sizeof
(
LenType
),
array
Z
);
};
};
template
<
typename
Type
>
struct
LArrayOf
:
ArrayOf
<
Type
,
HBUINT32
>
{};
template
<
typename
Type
>
struct
LArrayOf
:
ArrayOf
<
Type
,
HBUINT32
>
{};
...
@@ -1036,7 +1036,7 @@ struct OffsetListOf : OffsetArrayOf<Type>
...
@@ -1036,7 +1036,7 @@ struct OffsetListOf : OffsetArrayOf<Type>
inline
const
Type
&
operator
[]
(
unsigned
int
i
)
const
inline
const
Type
&
operator
[]
(
unsigned
int
i
)
const
{
{
if
(
unlikely
(
i
>=
this
->
len
))
return
Null
(
Type
);
if
(
unlikely
(
i
>=
this
->
len
))
return
Null
(
Type
);
return
this
+
this
->
array
[
i
];
return
this
+
this
->
array
Z
[
i
];
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
...
@@ -1060,7 +1060,7 @@ struct HeadlessArrayOf
...
@@ -1060,7 +1060,7 @@ struct HeadlessArrayOf
inline
const
Type
&
operator
[]
(
unsigned
int
i
)
const
inline
const
Type
&
operator
[]
(
unsigned
int
i
)
const
{
{
if
(
unlikely
(
i
>=
len
||
!
i
))
return
Null
(
Type
);
if
(
unlikely
(
i
>=
len
||
!
i
))
return
Null
(
Type
);
return
array
[
i
-
1
];
return
array
Z
[
i
-
1
];
}
}
inline
unsigned
int
get_size
(
void
)
const
inline
unsigned
int
get_size
(
void
)
const
{
return
len
.
static_size
+
(
len
?
len
-
1
:
0
)
*
Type
::
static_size
;
}
{
return
len
.
static_size
+
(
len
?
len
-
1
:
0
)
*
Type
::
static_size
;
}
...
@@ -1075,7 +1075,7 @@ struct HeadlessArrayOf
...
@@ -1075,7 +1075,7 @@ struct HeadlessArrayOf
if
(
unlikely
(
!
items_len
))
return_trace
(
true
);
if
(
unlikely
(
!
items_len
))
return_trace
(
true
);
if
(
unlikely
(
!
c
->
extend
(
*
this
)))
return_trace
(
false
);
if
(
unlikely
(
!
c
->
extend
(
*
this
)))
return_trace
(
false
);
for
(
unsigned
int
i
=
0
;
i
<
items_len
-
1
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
items_len
-
1
;
i
++
)
array
[
i
]
=
items
[
i
];
array
Z
[
i
]
=
items
[
i
];
items
+=
items_len
-
1
;
items
+=
items_len
-
1
;
return_trace
(
true
);
return_trace
(
true
);
}
}
...
@@ -1092,7 +1092,7 @@ struct HeadlessArrayOf
...
@@ -1092,7 +1092,7 @@ struct HeadlessArrayOf
* pointed to do have a simple sanitize(), ie. they do not
* pointed to do have a simple sanitize(), ie. they do not
* reference other structs via offsets.
* reference other structs via offsets.
*/
*/
(
void
)
(
false
&&
array
[
0
].
sanitize
(
c
));
(
void
)
(
false
&&
array
Z
[
0
].
sanitize
(
c
));
return_trace
(
true
);
return_trace
(
true
);
}
}
...
@@ -1102,14 +1102,14 @@ struct HeadlessArrayOf
...
@@ -1102,14 +1102,14 @@ struct HeadlessArrayOf
{
{
TRACE_SANITIZE
(
this
);
TRACE_SANITIZE
(
this
);
return_trace
(
len
.
sanitize
(
c
)
&&
return_trace
(
len
.
sanitize
(
c
)
&&
(
!
len
||
c
->
check_array
(
array
,
Type
::
static_size
,
len
-
1
)));
(
!
len
||
c
->
check_array
(
array
Z
,
Type
::
static_size
,
len
-
1
)));
}
}
public:
public:
LenType
len
;
LenType
len
;
Type
array
[
VAR
];
Type
array
Z
[
VAR
];
public:
public:
DEFINE_SIZE_ARRAY
(
sizeof
(
LenType
),
array
);
DEFINE_SIZE_ARRAY
(
sizeof
(
LenType
),
array
Z
);
};
};
...
@@ -1123,7 +1123,7 @@ struct SortedArrayOf : ArrayOf<Type, LenType>
...
@@ -1123,7 +1123,7 @@ struct SortedArrayOf : ArrayOf<Type, LenType>
inline
int
bsearch
(
const
SearchType
&
x
)
const
inline
int
bsearch
(
const
SearchType
&
x
)
const
{
{
/* Hand-coded bsearch here since this is in the hot inner loop. */
/* Hand-coded bsearch here since this is in the hot inner loop. */
const
Type
*
arr
=
this
->
array
;
const
Type
*
arr
=
this
->
array
Z
;
int
min
=
0
,
max
=
(
int
)
this
->
len
-
1
;
int
min
=
0
,
max
=
(
int
)
this
->
len
-
1
;
while
(
min
<=
max
)
while
(
min
<=
max
)
{
{
...
...
src/hb-ot-cmap-table.hh
浏览文件 @
63f57f4d
...
@@ -450,7 +450,7 @@ struct CmapSubtableLongSegmented
...
@@ -450,7 +450,7 @@ struct CmapSubtableLongSegmented
{
{
TRACE_SERIALIZE
(
this
);
TRACE_SERIALIZE
(
this
);
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return_trace
(
false
);
if
(
unlikely
(
!
c
->
extend_min
(
*
this
)))
return_trace
(
false
);
Supplier
<
CmapSubtableLongGroup
>
supplier
(
group_data
.
array
,
group_data
.
len
);
Supplier
<
CmapSubtableLongGroup
>
supplier
(
group_data
.
array
Z
,
group_data
.
len
);
if
(
unlikely
(
!
groups
.
serialize
(
c
,
supplier
,
group_data
.
len
)))
return_trace
(
false
);
if
(
unlikely
(
!
groups
.
serialize
(
c
,
supplier
,
group_data
.
len
)))
return_trace
(
false
);
return
true
;
return
true
;
}
}
...
...
src/hb-ot-color-cbdt-table.hh
浏览文件 @
63f57f4d
...
@@ -357,8 +357,8 @@ struct CBLC
...
@@ -357,8 +357,8 @@ struct CBLC
unsigned
int
count
=
sizeTables
.
len
;
unsigned
int
count
=
sizeTables
.
len
;
for
(
uint32_t
i
=
0
;
i
<
count
;
++
i
)
for
(
uint32_t
i
=
0
;
i
<
count
;
++
i
)
{
{
unsigned
int
startGlyphIndex
=
sizeTables
.
array
[
i
].
startGlyphIndex
;
unsigned
int
startGlyphIndex
=
sizeTables
.
array
Z
[
i
].
startGlyphIndex
;
unsigned
int
endGlyphIndex
=
sizeTables
.
array
[
i
].
endGlyphIndex
;
unsigned
int
endGlyphIndex
=
sizeTables
.
array
Z
[
i
].
endGlyphIndex
;
if
(
startGlyphIndex
<=
glyph
&&
glyph
<=
endGlyphIndex
)
if
(
startGlyphIndex
<=
glyph
&&
glyph
<=
endGlyphIndex
)
{
{
*
x_ppem
=
sizeTables
[
i
].
ppemX
;
*
x_ppem
=
sizeTables
[
i
].
ppemX
;
...
@@ -489,21 +489,21 @@ struct CBDT
...
@@ -489,21 +489,21 @@ struct CBDT
case
17
:
{
case
17
:
{
const
GlyphBitmapDataFormat17
&
glyphFormat17
=
const
GlyphBitmapDataFormat17
&
glyphFormat17
=
StructAtOffset
<
GlyphBitmapDataFormat17
>
(
this
->
cbdt
,
image_offset
);
StructAtOffset
<
GlyphBitmapDataFormat17
>
(
this
->
cbdt
,
image_offset
);
callback
((
const
uint8_t
*
)
&
glyphFormat17
.
data
.
array
,
callback
((
const
uint8_t
*
)
&
glyphFormat17
.
data
.
array
Z
,
glyphFormat17
.
data
.
len
,
i
,
gid
);
glyphFormat17
.
data
.
len
,
i
,
gid
);
}
}
break
;
break
;
case
18
:
{
case
18
:
{
const
GlyphBitmapDataFormat18
&
glyphFormat18
=
const
GlyphBitmapDataFormat18
&
glyphFormat18
=
StructAtOffset
<
GlyphBitmapDataFormat18
>
(
this
->
cbdt
,
image_offset
);
StructAtOffset
<
GlyphBitmapDataFormat18
>
(
this
->
cbdt
,
image_offset
);
callback
((
const
uint8_t
*
)
&
glyphFormat18
.
data
.
array
,
callback
((
const
uint8_t
*
)
&
glyphFormat18
.
data
.
array
Z
,
glyphFormat18
.
data
.
len
,
i
,
gid
);
glyphFormat18
.
data
.
len
,
i
,
gid
);
}
}
break
;
break
;
case
19
:
{
case
19
:
{
const
GlyphBitmapDataFormat19
&
glyphFormat19
=
const
GlyphBitmapDataFormat19
&
glyphFormat19
=
StructAtOffset
<
GlyphBitmapDataFormat19
>
(
this
->
cbdt
,
image_offset
);
StructAtOffset
<
GlyphBitmapDataFormat19
>
(
this
->
cbdt
,
image_offset
);
callback
((
const
uint8_t
*
)
&
glyphFormat19
.
data
.
array
,
callback
((
const
uint8_t
*
)
&
glyphFormat19
.
data
.
array
Z
,
glyphFormat19
.
data
.
len
,
i
,
gid
);
glyphFormat19
.
data
.
len
,
i
,
gid
);
}
}
break
;
break
;
...
...
src/hb-ot-layout-common-private.hh
浏览文件 @
63f57f4d
...
@@ -723,7 +723,7 @@ struct CoverageFormat1
...
@@ -723,7 +723,7 @@ struct CoverageFormat1
template
<
typename
set_t
>
template
<
typename
set_t
>
inline
bool
add_coverage
(
set_t
*
glyphs
)
const
{
inline
bool
add_coverage
(
set_t
*
glyphs
)
const
{
return
glyphs
->
add_sorted_array
(
glyphArray
.
array
,
glyphArray
.
len
);
return
glyphs
->
add_sorted_array
(
glyphArray
.
array
Z
,
glyphArray
.
len
);
}
}
public:
public:
...
@@ -1337,13 +1337,13 @@ struct VarData
...
@@ -1337,13 +1337,13 @@ struct VarData
const
HBINT16
*
scursor
=
reinterpret_cast
<
const
HBINT16
*>
(
row
);
const
HBINT16
*
scursor
=
reinterpret_cast
<
const
HBINT16
*>
(
row
);
for
(;
i
<
scount
;
i
++
)
for
(;
i
<
scount
;
i
++
)
{
{
float
scalar
=
regions
.
evaluate
(
regionIndices
.
array
[
i
],
coords
,
coord_count
);
float
scalar
=
regions
.
evaluate
(
regionIndices
.
array
Z
[
i
],
coords
,
coord_count
);
delta
+=
scalar
*
*
scursor
++
;
delta
+=
scalar
*
*
scursor
++
;
}
}
const
HBINT8
*
bcursor
=
reinterpret_cast
<
const
HBINT8
*>
(
scursor
);
const
HBINT8
*
bcursor
=
reinterpret_cast
<
const
HBINT8
*>
(
scursor
);
for
(;
i
<
count
;
i
++
)
for
(;
i
<
count
;
i
++
)
{
{
float
scalar
=
regions
.
evaluate
(
regionIndices
.
array
[
i
],
coords
,
coord_count
);
float
scalar
=
regions
.
evaluate
(
regionIndices
.
array
Z
[
i
],
coords
,
coord_count
);
delta
+=
scalar
*
*
bcursor
++
;
delta
+=
scalar
*
*
bcursor
++
;
}
}
...
@@ -1472,7 +1472,7 @@ struct ConditionSet
...
@@ -1472,7 +1472,7 @@ struct ConditionSet
{
{
unsigned
int
count
=
conditions
.
len
;
unsigned
int
count
=
conditions
.
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
if
(
!
(
this
+
conditions
.
array
[
i
]).
evaluate
(
coords
,
coord_len
))
if
(
!
(
this
+
conditions
.
array
Z
[
i
]).
evaluate
(
coords
,
coord_len
))
return
false
;
return
false
;
return
true
;
return
true
;
}
}
...
@@ -1513,7 +1513,7 @@ struct FeatureTableSubstitution
...
@@ -1513,7 +1513,7 @@ struct FeatureTableSubstitution
unsigned
int
count
=
substitutions
.
len
;
unsigned
int
count
=
substitutions
.
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
{
{
const
FeatureTableSubstitutionRecord
&
record
=
substitutions
.
array
[
i
];
const
FeatureTableSubstitutionRecord
&
record
=
substitutions
.
array
Z
[
i
];
if
(
record
.
featureIndex
==
feature_index
)
if
(
record
.
featureIndex
==
feature_index
)
return
&
(
this
+
record
.
feature
);
return
&
(
this
+
record
.
feature
);
}
}
...
@@ -1566,7 +1566,7 @@ struct FeatureVariations
...
@@ -1566,7 +1566,7 @@ struct FeatureVariations
unsigned
int
count
=
varRecords
.
len
;
unsigned
int
count
=
varRecords
.
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
{
{
const
FeatureVariationRecord
&
record
=
varRecords
.
array
[
i
];
const
FeatureVariationRecord
&
record
=
varRecords
.
array
Z
[
i
];
if
((
this
+
record
.
conditions
).
evaluate
(
coords
,
coord_len
))
if
((
this
+
record
.
conditions
).
evaluate
(
coords
,
coord_len
))
{
{
*
index
=
i
;
*
index
=
i
;
...
...
src/hb-ot-layout-gsub-table.hh
浏览文件 @
63f57f4d
...
@@ -269,7 +269,7 @@ struct Sequence
...
@@ -269,7 +269,7 @@ struct Sequence
inline
void
collect_glyphs
(
hb_collect_glyphs_context_t
*
c
)
const
inline
void
collect_glyphs
(
hb_collect_glyphs_context_t
*
c
)
const
{
{
TRACE_COLLECT_GLYPHS
(
this
);
TRACE_COLLECT_GLYPHS
(
this
);
c
->
output
->
add_array
(
substitute
.
array
,
substitute
.
len
);
c
->
output
->
add_array
(
substitute
.
array
Z
,
substitute
.
len
);
}
}
inline
bool
apply
(
hb_ot_apply_context_t
*
c
)
const
inline
bool
apply
(
hb_ot_apply_context_t
*
c
)
const
...
@@ -281,7 +281,7 @@ struct Sequence
...
@@ -281,7 +281,7 @@ struct Sequence
* as a "multiplied" substitution. */
* as a "multiplied" substitution. */
if
(
unlikely
(
count
==
1
))
if
(
unlikely
(
count
==
1
))
{
{
c
->
replace_glyph
(
substitute
.
array
[
0
]);
c
->
replace_glyph
(
substitute
.
array
Z
[
0
]);
return_trace
(
true
);
return_trace
(
true
);
}
}
/* Spec disallows this, but Uniscribe allows it.
/* Spec disallows this, but Uniscribe allows it.
...
@@ -297,7 +297,7 @@ struct Sequence
...
@@ -297,7 +297,7 @@ struct Sequence
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
{
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
{
_hb_glyph_info_set_lig_props_for_component
(
&
c
->
buffer
->
cur
(),
i
);
_hb_glyph_info_set_lig_props_for_component
(
&
c
->
buffer
->
cur
(),
i
);
c
->
output_glyph_for_component
(
substitute
.
array
[
i
],
klass
);
c
->
output_glyph_for_component
(
substitute
.
array
Z
[
i
],
klass
);
}
}
c
->
buffer
->
skip_glyph
();
c
->
buffer
->
skip_glyph
();
...
@@ -480,7 +480,7 @@ struct AlternateSubstFormat1
...
@@ -480,7 +480,7 @@ struct AlternateSubstFormat1
if
(
unlikely
(
iter
.
get_coverage
()
>=
count
))
if
(
unlikely
(
iter
.
get_coverage
()
>=
count
))
break
;
/* Work around malicious fonts. https://github.com/harfbuzz/harfbuzz/issues/363 */
break
;
/* Work around malicious fonts. https://github.com/harfbuzz/harfbuzz/issues/363 */
const
AlternateSet
&
alt_set
=
this
+
alternateSet
[
iter
.
get_coverage
()];
const
AlternateSet
&
alt_set
=
this
+
alternateSet
[
iter
.
get_coverage
()];
c
->
output
->
add_array
(
alt_set
.
array
,
alt_set
.
len
);
c
->
output
->
add_array
(
alt_set
.
array
Z
,
alt_set
.
len
);
}
}
}
}
...
@@ -611,7 +611,7 @@ struct Ligature
...
@@ -611,7 +611,7 @@ struct Ligature
inline
void
collect_glyphs
(
hb_collect_glyphs_context_t
*
c
)
const
inline
void
collect_glyphs
(
hb_collect_glyphs_context_t
*
c
)
const
{
{
TRACE_COLLECT_GLYPHS
(
this
);
TRACE_COLLECT_GLYPHS
(
this
);
c
->
input
->
add_array
(
component
.
array
,
component
.
len
?
component
.
len
-
1
:
0
);
c
->
input
->
add_array
(
component
.
array
Z
,
component
.
len
?
component
.
len
-
1
:
0
);
c
->
output
->
add
(
ligGlyph
);
c
->
output
->
add
(
ligGlyph
);
}
}
...
@@ -979,7 +979,7 @@ struct ReverseChainSingleSubstFormat1
...
@@ -979,7 +979,7 @@ struct ReverseChainSingleSubstFormat1
const
ArrayOf
<
GlyphID
>
&
substitute
=
StructAfter
<
ArrayOf
<
GlyphID
>
>
(
lookahead
);
const
ArrayOf
<
GlyphID
>
&
substitute
=
StructAfter
<
ArrayOf
<
GlyphID
>
>
(
lookahead
);
count
=
substitute
.
len
;
count
=
substitute
.
len
;
c
->
output
->
add_array
(
substitute
.
array
,
substitute
.
len
);
c
->
output
->
add_array
(
substitute
.
array
Z
,
substitute
.
len
);
}
}
inline
const
Coverage
&
get_coverage
(
void
)
const
inline
const
Coverage
&
get_coverage
(
void
)
const
...
@@ -1007,11 +1007,11 @@ struct ReverseChainSingleSubstFormat1
...
@@ -1007,11 +1007,11 @@ struct ReverseChainSingleSubstFormat1
unsigned
int
start_index
=
0
,
end_index
=
0
;
unsigned
int
start_index
=
0
,
end_index
=
0
;
if
(
match_backtrack
(
c
,
if
(
match_backtrack
(
c
,
backtrack
.
len
,
(
HBUINT16
*
)
backtrack
.
array
,
backtrack
.
len
,
(
HBUINT16
*
)
backtrack
.
array
Z
,
match_coverage
,
this
,
match_coverage
,
this
,
&
start_index
)
&&
&
start_index
)
&&
match_lookahead
(
c
,
match_lookahead
(
c
,
lookahead
.
len
,
(
HBUINT16
*
)
lookahead
.
array
,
lookahead
.
len
,
(
HBUINT16
*
)
lookahead
.
array
Z
,
match_coverage
,
this
,
match_coverage
,
this
,
1
,
&
end_index
))
1
,
&
end_index
))
{
{
...
...
src/hb-ot-layout-gsubgpos-private.hh
浏览文件 @
63f57f4d
...
@@ -1713,10 +1713,10 @@ struct ChainRule
...
@@ -1713,10 +1713,10 @@ struct ChainRule
const
ArrayOf
<
HBUINT16
>
&
lookahead
=
StructAfter
<
ArrayOf
<
HBUINT16
>
>
(
input
);
const
ArrayOf
<
HBUINT16
>
&
lookahead
=
StructAfter
<
ArrayOf
<
HBUINT16
>
>
(
input
);
const
ArrayOf
<
LookupRecord
>
&
lookup
=
StructAfter
<
ArrayOf
<
LookupRecord
>
>
(
lookahead
);
const
ArrayOf
<
LookupRecord
>
&
lookup
=
StructAfter
<
ArrayOf
<
LookupRecord
>
>
(
lookahead
);
chain_context_closure_lookup
(
c
,
chain_context_closure_lookup
(
c
,
backtrack
.
len
,
backtrack
.
array
,
backtrack
.
len
,
backtrack
.
array
Z
,
input
.
len
,
input
.
array
,
input
.
len
,
input
.
array
Z
,
lookahead
.
len
,
lookahead
.
array
,
lookahead
.
len
,
lookahead
.
array
Z
,
lookup
.
len
,
lookup
.
array
,
lookup
.
len
,
lookup
.
array
Z
,
lookup_context
);
lookup_context
);
}
}
...
@@ -1727,10 +1727,10 @@ struct ChainRule
...
@@ -1727,10 +1727,10 @@ struct ChainRule
const
ArrayOf
<
HBUINT16
>
&
lookahead
=
StructAfter
<
ArrayOf
<
HBUINT16
>
>
(
input
);
const
ArrayOf
<
HBUINT16
>
&
lookahead
=
StructAfter
<
ArrayOf
<
HBUINT16
>
>
(
input
);
const
ArrayOf
<
LookupRecord
>
&
lookup
=
StructAfter
<
ArrayOf
<
LookupRecord
>
>
(
lookahead
);
const
ArrayOf
<
LookupRecord
>
&
lookup
=
StructAfter
<
ArrayOf
<
LookupRecord
>
>
(
lookahead
);
chain_context_collect_glyphs_lookup
(
c
,
chain_context_collect_glyphs_lookup
(
c
,
backtrack
.
len
,
backtrack
.
array
,
backtrack
.
len
,
backtrack
.
array
Z
,
input
.
len
,
input
.
array
,
input
.
len
,
input
.
array
Z
,
lookahead
.
len
,
lookahead
.
array
,
lookahead
.
len
,
lookahead
.
array
Z
,
lookup
.
len
,
lookup
.
array
,
lookup
.
len
,
lookup
.
array
Z
,
lookup_context
);
lookup_context
);
}
}
...
@@ -1741,10 +1741,10 @@ struct ChainRule
...
@@ -1741,10 +1741,10 @@ struct ChainRule
const
ArrayOf
<
HBUINT16
>
&
lookahead
=
StructAfter
<
ArrayOf
<
HBUINT16
>
>
(
input
);
const
ArrayOf
<
HBUINT16
>
&
lookahead
=
StructAfter
<
ArrayOf
<
HBUINT16
>
>
(
input
);
const
ArrayOf
<
LookupRecord
>
&
lookup
=
StructAfter
<
ArrayOf
<
LookupRecord
>
>
(
lookahead
);
const
ArrayOf
<
LookupRecord
>
&
lookup
=
StructAfter
<
ArrayOf
<
LookupRecord
>
>
(
lookahead
);
return_trace
(
chain_context_would_apply_lookup
(
c
,
return_trace
(
chain_context_would_apply_lookup
(
c
,
backtrack
.
len
,
backtrack
.
array
,
backtrack
.
len
,
backtrack
.
array
Z
,
input
.
len
,
input
.
array
,
input
.
len
,
input
.
array
Z
,
lookahead
.
len
,
lookahead
.
array
,
lookup
.
len
,
lookahead
.
len
,
lookahead
.
array
Z
,
lookup
.
len
,
lookup
.
array
,
lookup_context
));
lookup
.
array
Z
,
lookup_context
));
}
}
inline
bool
apply
(
hb_ot_apply_context_t
*
c
,
ChainContextApplyLookupContext
&
lookup_context
)
const
inline
bool
apply
(
hb_ot_apply_context_t
*
c
,
ChainContextApplyLookupContext
&
lookup_context
)
const
...
@@ -1754,10 +1754,10 @@ struct ChainRule
...
@@ -1754,10 +1754,10 @@ struct ChainRule
const
ArrayOf
<
HBUINT16
>
&
lookahead
=
StructAfter
<
ArrayOf
<
HBUINT16
>
>
(
input
);
const
ArrayOf
<
HBUINT16
>
&
lookahead
=
StructAfter
<
ArrayOf
<
HBUINT16
>
>
(
input
);
const
ArrayOf
<
LookupRecord
>
&
lookup
=
StructAfter
<
ArrayOf
<
LookupRecord
>
>
(
lookahead
);
const
ArrayOf
<
LookupRecord
>
&
lookup
=
StructAfter
<
ArrayOf
<
LookupRecord
>
>
(
lookahead
);
return_trace
(
chain_context_apply_lookup
(
c
,
return_trace
(
chain_context_apply_lookup
(
c
,
backtrack
.
len
,
backtrack
.
array
,
backtrack
.
len
,
backtrack
.
array
Z
,
input
.
len
,
input
.
array
,
input
.
len
,
input
.
array
Z
,
lookahead
.
len
,
lookahead
.
array
,
lookup
.
len
,
lookahead
.
len
,
lookahead
.
array
Z
,
lookup
.
len
,
lookup
.
array
,
lookup_context
));
lookup
.
array
Z
,
lookup_context
));
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
...
@@ -2072,10 +2072,10 @@ struct ChainContextFormat3
...
@@ -2072,10 +2072,10 @@ struct ChainContextFormat3
{
this
,
this
,
this
}
{
this
,
this
,
this
}
};
};
chain_context_closure_lookup
(
c
,
chain_context_closure_lookup
(
c
,
backtrack
.
len
,
(
const
HBUINT16
*
)
backtrack
.
array
,
backtrack
.
len
,
(
const
HBUINT16
*
)
backtrack
.
array
Z
,
input
.
len
,
(
const
HBUINT16
*
)
input
.
array
+
1
,
input
.
len
,
(
const
HBUINT16
*
)
input
.
array
Z
+
1
,
lookahead
.
len
,
(
const
HBUINT16
*
)
lookahead
.
array
,
lookahead
.
len
,
(
const
HBUINT16
*
)
lookahead
.
array
Z
,
lookup
.
len
,
lookup
.
array
,
lookup
.
len
,
lookup
.
array
Z
,
lookup_context
);
lookup_context
);
}
}
...
@@ -2093,10 +2093,10 @@ struct ChainContextFormat3
...
@@ -2093,10 +2093,10 @@ struct ChainContextFormat3
{
this
,
this
,
this
}
{
this
,
this
,
this
}
};
};
chain_context_collect_glyphs_lookup
(
c
,
chain_context_collect_glyphs_lookup
(
c
,
backtrack
.
len
,
(
const
HBUINT16
*
)
backtrack
.
array
,
backtrack
.
len
,
(
const
HBUINT16
*
)
backtrack
.
array
Z
,
input
.
len
,
(
const
HBUINT16
*
)
input
.
array
+
1
,
input
.
len
,
(
const
HBUINT16
*
)
input
.
array
Z
+
1
,
lookahead
.
len
,
(
const
HBUINT16
*
)
lookahead
.
array
,
lookahead
.
len
,
(
const
HBUINT16
*
)
lookahead
.
array
Z
,
lookup
.
len
,
lookup
.
array
,
lookup
.
len
,
lookup
.
array
Z
,
lookup_context
);
lookup_context
);
}
}
...
@@ -2112,10 +2112,10 @@ struct ChainContextFormat3
...
@@ -2112,10 +2112,10 @@ struct ChainContextFormat3
{
this
,
this
,
this
}
{
this
,
this
,
this
}
};
};
return_trace
(
chain_context_would_apply_lookup
(
c
,
return_trace
(
chain_context_would_apply_lookup
(
c
,
backtrack
.
len
,
(
const
HBUINT16
*
)
backtrack
.
array
,
backtrack
.
len
,
(
const
HBUINT16
*
)
backtrack
.
array
Z
,
input
.
len
,
(
const
HBUINT16
*
)
input
.
array
+
1
,
input
.
len
,
(
const
HBUINT16
*
)
input
.
array
Z
+
1
,
lookahead
.
len
,
(
const
HBUINT16
*
)
lookahead
.
array
,
lookahead
.
len
,
(
const
HBUINT16
*
)
lookahead
.
array
Z
,
lookup
.
len
,
lookup
.
array
,
lookup_context
));
lookup
.
len
,
lookup
.
array
Z
,
lookup_context
));
}
}
inline
const
Coverage
&
get_coverage
(
void
)
const
inline
const
Coverage
&
get_coverage
(
void
)
const
...
@@ -2139,10 +2139,10 @@ struct ChainContextFormat3
...
@@ -2139,10 +2139,10 @@ struct ChainContextFormat3
{
this
,
this
,
this
}
{
this
,
this
,
this
}
};
};
return_trace
(
chain_context_apply_lookup
(
c
,
return_trace
(
chain_context_apply_lookup
(
c
,
backtrack
.
len
,
(
const
HBUINT16
*
)
backtrack
.
array
,
backtrack
.
len
,
(
const
HBUINT16
*
)
backtrack
.
array
Z
,
input
.
len
,
(
const
HBUINT16
*
)
input
.
array
+
1
,
input
.
len
,
(
const
HBUINT16
*
)
input
.
array
Z
+
1
,
lookahead
.
len
,
(
const
HBUINT16
*
)
lookahead
.
array
,
lookahead
.
len
,
(
const
HBUINT16
*
)
lookahead
.
array
Z
,
lookup
.
len
,
lookup
.
array
,
lookup_context
));
lookup
.
len
,
lookup
.
array
Z
,
lookup_context
));
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
...
...
src/hb-ot-post-table.hh
浏览文件 @
63f57f4d
...
@@ -238,14 +238,14 @@ struct post
...
@@ -238,14 +238,14 @@ struct post
if
(
version
!=
0x00020000
||
glyph
>=
glyphNameIndex
->
len
)
if
(
version
!=
0x00020000
||
glyph
>=
glyphNameIndex
->
len
)
return
hb_bytes_t
();
return
hb_bytes_t
();
unsigned
int
index
=
glyphNameIndex
->
array
[
glyph
];
unsigned
int
index
=
glyphNameIndex
->
array
Z
[
glyph
];
if
(
index
<
NUM_FORMAT1_NAMES
)
if
(
index
<
NUM_FORMAT1_NAMES
)
return
format1_names
(
index
);
return
format1_names
(
index
);
index
-=
NUM_FORMAT1_NAMES
;
index
-=
NUM_FORMAT1_NAMES
;
if
(
index
>=
index_to_offset
.
len
)
if
(
index
>=
index_to_offset
.
len
)
return
hb_bytes_t
();
return
hb_bytes_t
();
unsigned
int
offset
=
index_to_offset
.
array
[
index
];
unsigned
int
offset
=
index_to_offset
.
array
Z
[
index
];
const
uint8_t
*
data
=
pool
+
offset
;
const
uint8_t
*
data
=
pool
+
offset
;
unsigned
int
name_length
=
*
data
;
unsigned
int
name_length
=
*
data
;
...
...
src/hb-ot-var-avar-table.hh
浏览文件 @
63f57f4d
...
@@ -70,30 +70,30 @@ struct SegmentMaps : ArrayOf<AxisValueMap>
...
@@ -70,30 +70,30 @@ struct SegmentMaps : ArrayOf<AxisValueMap>
if
(
!
len
)
if
(
!
len
)
return
value
;
return
value
;
else
/* len == 1*/
else
/* len == 1*/
return
value
-
array
[
0
].
fromCoord
+
array
[
0
].
toCoord
;
return
value
-
array
Z
[
0
].
fromCoord
+
arrayZ
[
0
].
toCoord
;
}
}
if
(
value
<=
array
[
0
].
fromCoord
)
if
(
value
<=
array
Z
[
0
].
fromCoord
)
return
value
-
array
[
0
].
fromCoord
+
array
[
0
].
toCoord
;
return
value
-
array
Z
[
0
].
fromCoord
+
arrayZ
[
0
].
toCoord
;
unsigned
int
i
;
unsigned
int
i
;
unsigned
int
count
=
len
;
unsigned
int
count
=
len
;
for
(
i
=
1
;
i
<
count
&&
value
>
array
[
i
].
fromCoord
;
i
++
)
for
(
i
=
1
;
i
<
count
&&
value
>
array
Z
[
i
].
fromCoord
;
i
++
)
;
;
if
(
value
>=
array
[
i
].
fromCoord
)
if
(
value
>=
array
Z
[
i
].
fromCoord
)
return
value
-
array
[
i
].
fromCoord
+
array
[
i
].
toCoord
;
return
value
-
array
Z
[
i
].
fromCoord
+
arrayZ
[
i
].
toCoord
;
if
(
unlikely
(
array
[
i
-
1
].
fromCoord
==
array
[
i
].
fromCoord
))
if
(
unlikely
(
array
Z
[
i
-
1
].
fromCoord
==
arrayZ
[
i
].
fromCoord
))
return
array
[
i
-
1
].
toCoord
;
return
array
Z
[
i
-
1
].
toCoord
;
int
denom
=
array
[
i
].
fromCoord
-
array
[
i
-
1
].
fromCoord
;
int
denom
=
array
Z
[
i
].
fromCoord
-
arrayZ
[
i
-
1
].
fromCoord
;
return
array
[
i
-
1
].
toCoord
+
return
array
Z
[
i
-
1
].
toCoord
+
((
array
[
i
].
toCoord
-
array
[
i
-
1
].
toCoord
)
*
((
array
Z
[
i
].
toCoord
-
arrayZ
[
i
-
1
].
toCoord
)
*
(
value
-
array
[
i
-
1
].
fromCoord
)
+
denom
/
2
)
/
denom
;
(
value
-
array
Z
[
i
-
1
].
fromCoord
)
+
denom
/
2
)
/
denom
;
}
}
DEFINE_SIZE_ARRAY
(
2
,
array
);
DEFINE_SIZE_ARRAY
(
2
,
array
Z
);
};
};
struct
avar
struct
avar
...
...
src/hb-private.hh
浏览文件 @
63f57f4d
...
@@ -531,25 +531,25 @@ struct hb_vector_t
...
@@ -531,25 +531,25 @@ struct hb_vector_t
{
{
unsigned
int
len
;
unsigned
int
len
;
unsigned
int
allocated
;
unsigned
int
allocated
;
Type
*
array
;
Type
*
array
Z
;
Type
static_array
[
StaticSize
];
Type
static_array
[
StaticSize
];
void
init
(
void
)
void
init
(
void
)
{
{
len
=
0
;
len
=
0
;
allocated
=
ARRAY_LENGTH
(
static_array
);
allocated
=
ARRAY_LENGTH
(
static_array
);
array
=
static_array
;
array
Z
=
static_array
;
}
}
inline
Type
&
operator
[]
(
unsigned
int
i
)
{
return
array
[
i
];
}
inline
Type
&
operator
[]
(
unsigned
int
i
)
{
return
array
Z
[
i
];
}
inline
const
Type
&
operator
[]
(
unsigned
int
i
)
const
{
return
array
[
i
];
}
inline
const
Type
&
operator
[]
(
unsigned
int
i
)
const
{
return
array
Z
[
i
];
}
inline
Type
*
push
(
void
)
inline
Type
*
push
(
void
)
{
{
if
(
unlikely
(
!
resize
(
len
+
1
)))
if
(
unlikely
(
!
resize
(
len
+
1
)))
return
nullptr
;
return
nullptr
;
return
&
array
[
len
-
1
];
return
&
array
Z
[
len
-
1
];
}
}
/* Allocate for size but don't adjust len. */
/* Allocate for size but don't adjust len. */
...
@@ -566,21 +566,21 @@ struct hb_vector_t
...
@@ -566,21 +566,21 @@ struct hb_vector_t
Type
*
new_array
=
nullptr
;
Type
*
new_array
=
nullptr
;
if
(
array
==
static_array
)
{
if
(
array
Z
==
static_array
)
{
new_array
=
(
Type
*
)
calloc
(
new_allocated
,
sizeof
(
Type
));
new_array
=
(
Type
*
)
calloc
(
new_allocated
,
sizeof
(
Type
));
if
(
new_array
)
if
(
new_array
)
memcpy
(
new_array
,
array
,
len
*
sizeof
(
Type
));
memcpy
(
new_array
,
array
Z
,
len
*
sizeof
(
Type
));
}
else
{
}
else
{
bool
overflows
=
(
new_allocated
<
allocated
)
||
_hb_unsigned_int_mul_overflows
(
new_allocated
,
sizeof
(
Type
));
bool
overflows
=
(
new_allocated
<
allocated
)
||
_hb_unsigned_int_mul_overflows
(
new_allocated
,
sizeof
(
Type
));
if
(
likely
(
!
overflows
))
{
if
(
likely
(
!
overflows
))
{
new_array
=
(
Type
*
)
realloc
(
array
,
new_allocated
*
sizeof
(
Type
));
new_array
=
(
Type
*
)
realloc
(
array
Z
,
new_allocated
*
sizeof
(
Type
));
}
}
}
}
if
(
unlikely
(
!
new_array
))
if
(
unlikely
(
!
new_array
))
return
false
;
return
false
;
array
=
new_array
;
array
Z
=
new_array
;
allocated
=
new_allocated
;
allocated
=
new_allocated
;
return
true
;
return
true
;
...
@@ -604,8 +604,8 @@ struct hb_vector_t
...
@@ -604,8 +604,8 @@ struct hb_vector_t
{
{
if
(
unlikely
(
i
>=
len
))
if
(
unlikely
(
i
>=
len
))
return
;
return
;
memmove
(
static_cast
<
void
*>
(
&
array
[
i
]),
memmove
(
static_cast
<
void
*>
(
&
array
Z
[
i
]),
static_cast
<
void
*>
(
&
array
[
i
+
1
]),
static_cast
<
void
*>
(
&
array
Z
[
i
+
1
]),
(
len
-
i
-
1
)
*
sizeof
(
Type
));
(
len
-
i
-
1
)
*
sizeof
(
Type
));
len
--
;
len
--
;
}
}
...
@@ -619,39 +619,39 @@ struct hb_vector_t
...
@@ -619,39 +619,39 @@ struct hb_vector_t
template
<
typename
T
>
template
<
typename
T
>
inline
Type
*
find
(
T
v
)
{
inline
Type
*
find
(
T
v
)
{
for
(
unsigned
int
i
=
0
;
i
<
len
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
len
;
i
++
)
if
(
array
[
i
]
==
v
)
if
(
array
Z
[
i
]
==
v
)
return
&
array
[
i
];
return
&
array
Z
[
i
];
return
nullptr
;
return
nullptr
;
}
}
template
<
typename
T
>
template
<
typename
T
>
inline
const
Type
*
find
(
T
v
)
const
{
inline
const
Type
*
find
(
T
v
)
const
{
for
(
unsigned
int
i
=
0
;
i
<
len
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
len
;
i
++
)
if
(
array
[
i
]
==
v
)
if
(
array
Z
[
i
]
==
v
)
return
&
array
[
i
];
return
&
array
Z
[
i
];
return
nullptr
;
return
nullptr
;
}
}
inline
void
qsort
(
int
(
*
cmp
)(
const
void
*
,
const
void
*
))
inline
void
qsort
(
int
(
*
cmp
)(
const
void
*
,
const
void
*
))
{
{
::
qsort
(
array
,
len
,
sizeof
(
Type
),
cmp
);
::
qsort
(
array
Z
,
len
,
sizeof
(
Type
),
cmp
);
}
}
inline
void
qsort
(
void
)
inline
void
qsort
(
void
)
{
{
::
qsort
(
array
,
len
,
sizeof
(
Type
),
Type
::
cmp
);
::
qsort
(
array
Z
,
len
,
sizeof
(
Type
),
Type
::
cmp
);
}
}
inline
void
qsort
(
unsigned
int
start
,
unsigned
int
end
)
inline
void
qsort
(
unsigned
int
start
,
unsigned
int
end
)
{
{
::
qsort
(
array
+
start
,
end
-
start
,
sizeof
(
Type
),
Type
::
cmp
);
::
qsort
(
array
Z
+
start
,
end
-
start
,
sizeof
(
Type
),
Type
::
cmp
);
}
}
template
<
typename
T
>
template
<
typename
T
>
inline
Type
*
lsearch
(
const
T
&
x
)
inline
Type
*
lsearch
(
const
T
&
x
)
{
{
for
(
unsigned
int
i
=
0
;
i
<
len
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
len
;
i
++
)
if
(
0
==
this
->
array
[
i
].
cmp
(
&
x
))
if
(
0
==
this
->
array
Z
[
i
].
cmp
(
&
x
))
return
&
array
[
i
];
return
&
array
Z
[
i
];
return
nullptr
;
return
nullptr
;
}
}
...
@@ -659,13 +659,13 @@ struct hb_vector_t
...
@@ -659,13 +659,13 @@ struct hb_vector_t
inline
Type
*
bsearch
(
const
T
&
x
)
inline
Type
*
bsearch
(
const
T
&
x
)
{
{
unsigned
int
i
;
unsigned
int
i
;
return
bfind
(
x
,
&
i
)
?
&
array
[
i
]
:
nullptr
;
return
bfind
(
x
,
&
i
)
?
&
array
Z
[
i
]
:
nullptr
;
}
}
template
<
typename
T
>
template
<
typename
T
>
inline
const
Type
*
bsearch
(
const
T
&
x
)
const
inline
const
Type
*
bsearch
(
const
T
&
x
)
const
{
{
unsigned
int
i
;
unsigned
int
i
;
return
bfind
(
x
,
&
i
)
?
&
array
[
i
]
:
nullptr
;
return
bfind
(
x
,
&
i
)
?
&
array
Z
[
i
]
:
nullptr
;
}
}
template
<
typename
T
>
template
<
typename
T
>
inline
bool
bfind
(
const
T
&
x
,
unsigned
int
*
i
)
const
inline
bool
bfind
(
const
T
&
x
,
unsigned
int
*
i
)
const
...
@@ -674,7 +674,7 @@ struct hb_vector_t
...
@@ -674,7 +674,7 @@ struct hb_vector_t
while
(
min
<=
max
)
while
(
min
<=
max
)
{
{
int
mid
=
(
min
+
max
)
/
2
;
int
mid
=
(
min
+
max
)
/
2
;
int
c
=
this
->
array
[
mid
].
cmp
(
&
x
);
int
c
=
this
->
array
Z
[
mid
].
cmp
(
&
x
);
if
(
c
<
0
)
if
(
c
<
0
)
max
=
mid
-
1
;
max
=
mid
-
1
;
else
if
(
c
>
0
)
else
if
(
c
>
0
)
...
@@ -685,7 +685,7 @@ struct hb_vector_t
...
@@ -685,7 +685,7 @@ struct hb_vector_t
return
true
;
return
true
;
}
}
}
}
if
(
max
<
0
||
(
max
<
(
int
)
this
->
len
&&
this
->
array
[
max
].
cmp
(
&
x
)
>
0
))
if
(
max
<
0
||
(
max
<
(
int
)
this
->
len
&&
this
->
array
Z
[
max
].
cmp
(
&
x
)
>
0
))
max
++
;
max
++
;
*
i
=
max
;
*
i
=
max
;
return
false
;
return
false
;
...
@@ -693,9 +693,9 @@ struct hb_vector_t
...
@@ -693,9 +693,9 @@ struct hb_vector_t
inline
void
fini
(
void
)
inline
void
fini
(
void
)
{
{
if
(
array
!=
static_array
)
if
(
array
Z
!=
static_array
)
free
(
array
);
free
(
array
Z
);
array
=
nullptr
;
array
Z
=
nullptr
;
allocated
=
len
=
0
;
allocated
=
len
=
0
;
}
}
};
};
...
...
src/hb-set-private.hh
浏览文件 @
63f57f4d
...
@@ -374,8 +374,8 @@ struct hb_set_t
...
@@ -374,8 +374,8 @@ struct hb_set_t
if
(
!
resize
(
count
))
if
(
!
resize
(
count
))
return
;
return
;
population
=
other
->
population
;
population
=
other
->
population
;
memcpy
(
pages
.
array
,
other
->
pages
.
array
,
count
*
sizeof
(
pages
.
array
[
0
]));
memcpy
(
pages
.
array
Z
,
other
->
pages
.
arrayZ
,
count
*
sizeof
(
pages
.
arrayZ
[
0
]));
memcpy
(
page_map
.
array
,
other
->
page_map
.
array
,
count
*
sizeof
(
page_map
.
array
[
0
]));
memcpy
(
page_map
.
array
Z
,
other
->
page_map
.
arrayZ
,
count
*
sizeof
(
page_map
.
arrayZ
[
0
]));
}
}
inline
bool
is_equal
(
const
hb_set_t
*
other
)
const
inline
bool
is_equal
(
const
hb_set_t
*
other
)
const
...
...
src/hb-subset.cc
浏览文件 @
63f57f4d
...
@@ -157,7 +157,7 @@ _hb_subset_face_data_reference_blob (hb_subset_face_data_t *data)
...
@@ -157,7 +157,7 @@ _hb_subset_face_data_reference_blob (hb_subset_face_data_t *data)
unsigned
int
face_length
=
table_count
*
16
+
12
;
unsigned
int
face_length
=
table_count
*
16
+
12
;
for
(
unsigned
int
i
=
0
;
i
<
table_count
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
table_count
;
i
++
)
face_length
+=
_hb_ceil_to_4
(
hb_blob_get_length
(
data
->
tables
.
array
[
i
].
blob
));
face_length
+=
_hb_ceil_to_4
(
hb_blob_get_length
(
data
->
tables
.
array
Z
[
i
].
blob
));
char
*
buf
=
(
char
*
)
malloc
(
face_length
);
char
*
buf
=
(
char
*
)
malloc
(
face_length
);
if
(
unlikely
(
!
buf
))
if
(
unlikely
(
!
buf
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录