Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
9583e007
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,发现更多精彩内容 >>
提交
9583e007
编写于
7月 22, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Port more off of Sanitizer<>
上级
e7737b41
变更
13
显示空白变更内容
内联
并排
Showing
13 changed file
with
24 addition
and
28 deletion
+24
-28
src/hb-face.cc
src/hb-face.cc
+2
-2
src/hb-open-type-private.hh
src/hb-open-type-private.hh
+1
-1
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
+2
-2
src/hb-ot-color-svg-table.hh
src/hb-ot-color-svg-table.hh
+1
-3
src/hb-ot-glyf-table.hh
src/hb-ot-glyf-table.hh
+4
-4
src/hb-ot-hmtx-table.hh
src/hb-ot-hmtx-table.hh
+5
-5
src/hb-ot-kern-table.hh
src/hb-ot-kern-table.hh
+1
-1
src/hb-ot-layout.cc
src/hb-ot-layout.cc
+3
-3
src/hb-ot-maxp-table.hh
src/hb-ot-maxp-table.hh
+1
-1
src/hb-ot-os2-table.hh
src/hb-ot-os2-table.hh
+1
-1
src/hb-ot-post-table.hh
src/hb-ot-post-table.hh
+1
-1
src/hb-subset.cc
src/hb-subset.cc
+1
-3
未找到文件。
src/hb-face.cc
浏览文件 @
9583e007
...
...
@@ -451,7 +451,7 @@ hb_face_get_upem (hb_face_t *face)
void
hb_face_t
::
load_upem
(
void
)
const
{
hb_blob_t
*
head_blob
=
OT
::
Sanitizer
<
OT
::
head
>
().
sanitize
(
reference_table
(
HB_OT_TAG_head
)
);
hb_blob_t
*
head_blob
=
OT
::
hb_sanitize_context_t
().
reference_table
<
OT
::
head
>
(
this
);
const
OT
::
head
*
head_table
=
head_blob
->
as
<
OT
::
head
>
();
upem
=
head_table
->
get_upem
();
hb_blob_destroy
(
head_blob
);
...
...
@@ -495,7 +495,7 @@ hb_face_get_glyph_count (hb_face_t *face)
void
hb_face_t
::
load_num_glyphs
(
void
)
const
{
hb_blob_t
*
maxp_blob
=
OT
::
Sanitizer
<
OT
::
maxp
>
().
sanitize
(
reference_table
(
HB_OT_TAG_maxp
)
);
hb_blob_t
*
maxp_blob
=
OT
::
hb_sanitize_context_t
().
reference_table
<
OT
::
maxp
>
(
this
);
const
OT
::
maxp
*
maxp_table
=
maxp_blob
->
as
<
OT
::
maxp
>
();
num_glyphs
=
maxp_table
->
get_num_glyphs
();
hb_blob_destroy
(
maxp_blob
);
...
...
src/hb-open-type-private.hh
浏览文件 @
9583e007
...
...
@@ -346,7 +346,7 @@ struct hb_sanitize_context_t :
}
template
<
typename
Type
>
inline
hb_blob_t
*
reference_table
(
hb_face_t
*
face
,
hb_tag_t
tableTag
=
Type
::
tableTag
)
inline
hb_blob_t
*
reference_table
(
const
hb_face_t
*
face
,
hb_tag_t
tableTag
=
Type
::
tableTag
)
{
return
sanitize_blob
<
Type
>
(
face
->
reference_table
(
tableTag
));
}
...
...
src/hb-ot-cmap-table.hh
浏览文件 @
9583e007
...
...
@@ -894,7 +894,7 @@ struct cmap
{
inline
void
init
(
hb_face_t
*
face
)
{
this
->
blob
=
OT
::
Sanitizer
<
OT
::
cmap
>
().
sanitize
(
face
->
reference_table
(
HB_OT_TAG_cmap
)
);
this
->
blob
=
OT
::
hb_sanitize_context_t
().
reference_table
<
OT
::
cmap
>
(
face
);
const
OT
::
cmap
*
cmap
=
this
->
blob
->
as
<
OT
::
cmap
>
();
const
OT
::
CmapSubtable
*
subtable
=
nullptr
;
const
OT
::
CmapSubtableFormat14
*
subtable_uvs
=
nullptr
;
...
...
src/hb-ot-color-cbdt-table.hh
浏览文件 @
9583e007
...
...
@@ -394,8 +394,8 @@ struct CBDT
{
upem
=
hb_face_get_upem
(
face
);
cblc_blob
=
Sanitizer
<
CBLC
>
().
sanitize
(
face
->
reference_table
(
HB_OT_TAG_CBLC
)
);
cbdt_blob
=
Sanitizer
<
CBDT
>
().
sanitize
(
face
->
reference_table
(
HB_OT_TAG_CBDT
)
);
cblc_blob
=
hb_sanitize_context_t
().
reference_table
<
CBLC
>
(
face
);
cbdt_blob
=
hb_sanitize_context_t
().
reference_table
<
CBDT
>
(
face
);
cbdt_len
=
hb_blob_get_length
(
cbdt_blob
);
if
(
hb_blob_get_length
(
cblc_blob
)
==
0
)
{
...
...
src/hb-ot-color-svg-table.hh
浏览文件 @
9583e007
...
...
@@ -96,11 +96,9 @@ struct SVG
{
inline
void
init
(
hb_face_t
*
face
)
{
OT
::
Sanitizer
<
OT
::
SVG
>
sanitizer
;
svg_blob
=
sanitizer
.
sanitize
(
face
->
reference_table
(
HB_OT_TAG_SVG
));
svg_blob
=
OT
::
hb_sanitize_context_t
().
reference_table
<
SVG
>
(
face
);
svg_len
=
hb_blob_get_length
(
svg_blob
);
svg
=
svg_blob
->
as
<
OT
::
SVG
>
();
}
inline
void
fini
(
void
)
...
...
src/hb-ot-glyf-table.hh
浏览文件 @
9583e007
...
...
@@ -103,7 +103,7 @@ struct glyf
static
bool
_add_head_and_set_loca_version
(
hb_subset_plan_t
*
plan
,
bool
use_short_loca
)
{
hb_blob_t
*
head_blob
=
OT
::
Sanitizer
<
OT
::
head
>
().
sanitize
(
hb_face_reference_table
(
plan
->
source
,
HB_OT_TAG_head
)
);
hb_blob_t
*
head_blob
=
OT
::
hb_sanitize_context_t
().
reference_table
<
OT
::
head
>
(
plan
->
source
);
hb_blob_t
*
head_prime_blob
=
hb_blob_copy_writable_or_fail
(
head_blob
);
hb_blob_destroy
(
head_blob
);
...
...
@@ -236,7 +236,7 @@ struct glyf
{
memset
(
this
,
0
,
sizeof
(
accelerator_t
));
hb_blob_t
*
head_blob
=
Sanitizer
<
head
>
().
sanitize
(
face
->
reference_table
(
HB_OT_TAG_head
)
);
hb_blob_t
*
head_blob
=
hb_sanitize_context_t
().
reference_table
<
head
>
(
face
);
const
head
*
head_table
=
head_blob
->
as
<
head
>
();
if
(
head_table
==
&
Null
(
head
)
||
(
unsigned
int
)
head_table
->
indexToLocFormat
>
1
||
head_table
->
glyphDataFormat
!=
0
)
{
...
...
@@ -247,9 +247,9 @@ struct glyf
short_offset
=
0
==
head_table
->
indexToLocFormat
;
hb_blob_destroy
(
head_blob
);
loca_blob
=
Sanitizer
<
loca
>
().
sanitize
(
face
->
reference_table
(
HB_OT_TAG_loca
)
);
loca_blob
=
hb_sanitize_context_t
().
reference_table
<
loca
>
(
face
);
loca_table
=
loca_blob
->
as
<
loca
>
();
glyf_blob
=
Sanitizer
<
glyf
>
().
sanitize
(
face
->
reference_table
(
HB_OT_TAG_glyf
)
);
glyf_blob
=
hb_sanitize_context_t
().
reference_table
<
glyf
>
(
face
);
glyf_table
=
glyf_blob
->
as
<
glyf
>
();
num_glyphs
=
MAX
(
1u
,
hb_blob_get_length
(
loca_blob
)
/
(
short_offset
?
2
:
4
))
-
1
;
...
...
src/hb-ot-hmtx-table.hh
浏览文件 @
9583e007
...
...
@@ -69,7 +69,7 @@ struct hmtxvmtx
inline
bool
subset_update_header
(
hb_subset_plan_t
*
plan
,
unsigned
int
num_hmetrics
)
const
{
hb_blob_t
*
src_blob
=
OT
::
Sanitizer
<
H
>
().
sanitize
(
plan
->
source
->
reference_table
(
H
::
tableTag
)
);
hb_blob_t
*
src_blob
=
OT
::
hb_sanitize_context_t
().
reference_table
<
H
>
(
plan
->
source
,
H
::
tableTag
);
hb_blob_t
*
dest_blob
=
hb_blob_copy_writable_or_fail
(
src_blob
);
hb_blob_destroy
(
src_blob
);
...
...
@@ -195,7 +195,7 @@ struct hmtxvmtx
bool
got_font_extents
=
false
;
if
(
T
::
os2Tag
)
{
hb_blob_t
*
os2_blob
=
Sanitizer
<
os2
>
().
sanitize
(
face
->
reference_table
(
T
::
os2Tag
)
);
hb_blob_t
*
os2_blob
=
hb_sanitize_context_t
().
reference_table
<
os2
>
(
face
);
const
os2
*
os2_table
=
os2_blob
->
as
<
os2
>
();
#define USE_TYPO_METRICS (1u<<7)
if
(
0
!=
(
os2_table
->
fsSelection
&
USE_TYPO_METRICS
))
...
...
@@ -208,7 +208,7 @@ struct hmtxvmtx
hb_blob_destroy
(
os2_blob
);
}
hb_blob_t
*
_hea_blob
=
Sanitizer
<
H
>
().
sanitize
(
face
->
reference_table
(
H
::
tableTag
)
);
hb_blob_t
*
_hea_blob
=
hb_sanitize_context_t
().
reference_table
<
H
>
(
face
);
const
H
*
_hea_table
=
_hea_blob
->
as
<
H
>
();
num_advances
=
_hea_table
->
numberOfLongMetrics
;
if
(
!
got_font_extents
)
...
...
@@ -222,7 +222,7 @@ struct hmtxvmtx
has_font_extents
=
got_font_extents
;
blob
=
Sanitizer
<
hmtxvmtx
>
().
sanitize
(
face
->
reference_table
(
T
::
tableTag
)
);
blob
=
hb_sanitize_context_t
().
reference_table
<
hmtxvmtx
>
(
face
,
T
::
tableTag
);
/* Cap num_metrics() and num_advances() based on table length. */
unsigned
int
len
=
hb_blob_get_length
(
blob
);
...
...
@@ -240,7 +240,7 @@ struct hmtxvmtx
}
table
=
blob
->
as
<
hmtxvmtx
>
();
var_blob
=
Sanitizer
<
HVARVVAR
>
().
sanitize
(
face
->
reference_table
(
T
::
variationsTag
)
);
var_blob
=
hb_sanitize_context_t
().
reference_table
<
HVARVVAR
>
(
face
,
T
::
variationsTag
);
var_table
=
var_blob
->
as
<
HVARVVAR
>
();
}
...
...
src/hb-ot-kern-table.hh
浏览文件 @
9583e007
...
...
@@ -362,7 +362,7 @@ struct kern
{
inline
void
init
(
hb_face_t
*
face
)
{
blob
=
Sanitizer
<
kern
>
().
sanitize
(
face
->
reference_table
(
HB_OT_TAG_kern
)
);
blob
=
hb_sanitize_context_t
().
reference_table
<
kern
>
(
face
);
table
=
blob
->
as
<
kern
>
();
table_length
=
blob
->
length
;
}
...
...
src/hb-ot-layout.cc
浏览文件 @
9583e007
...
...
@@ -54,13 +54,13 @@ _hb_ot_layout_create (hb_face_t *face)
if
(
unlikely
(
!
layout
))
return
nullptr
;
layout
->
gdef_blob
=
OT
::
Sanitizer
<
OT
::
GDEF
>
().
sanitize
(
face
->
reference_table
(
HB_OT_TAG_GDEF
)
);
layout
->
gdef_blob
=
OT
::
hb_sanitize_context_t
().
reference_table
<
OT
::
GDEF
>
(
face
);
layout
->
gdef
=
layout
->
gdef_blob
->
as
<
OT
::
GDEF
>
();
layout
->
gsub_blob
=
OT
::
Sanitizer
<
OT
::
GSUB
>
().
sanitize
(
face
->
reference_table
(
HB_OT_TAG_GSUB
)
);
layout
->
gsub_blob
=
OT
::
hb_sanitize_context_t
().
reference_table
<
OT
::
GSUB
>
(
face
);
layout
->
gsub
=
layout
->
gsub_blob
->
as
<
OT
::
GSUB
>
();
layout
->
gpos_blob
=
OT
::
Sanitizer
<
OT
::
GPOS
>
().
sanitize
(
face
->
reference_table
(
HB_OT_TAG_GPOS
)
);
layout
->
gpos_blob
=
OT
::
hb_sanitize_context_t
().
reference_table
<
OT
::
GPOS
>
(
face
);
layout
->
gpos
=
layout
->
gpos_blob
->
as
<
OT
::
GPOS
>
();
layout
->
math
.
init
(
face
);
...
...
src/hb-ot-maxp-table.hh
浏览文件 @
9583e007
...
...
@@ -100,7 +100,7 @@ struct maxp
inline
bool
subset
(
hb_subset_plan_t
*
plan
)
const
{
hb_blob_t
*
maxp_blob
=
OT
::
Sanitizer
<
OT
::
maxp
>
().
sanitize
(
hb_face_reference_table
(
plan
->
source
,
HB_OT_TAG_maxp
)
);
hb_blob_t
*
maxp_blob
=
OT
::
hb_sanitize_context_t
().
reference_table
<
OT
::
maxp
>
(
plan
->
source
);
hb_blob_t
*
maxp_prime_blob
=
hb_blob_copy_writable_or_fail
(
maxp_blob
);
hb_blob_destroy
(
maxp_blob
);
...
...
src/hb-ot-os2-table.hh
浏览文件 @
9583e007
...
...
@@ -51,7 +51,7 @@ struct os2
inline
bool
subset
(
hb_subset_plan_t
*
plan
)
const
{
hb_blob_t
*
os2_blob
=
OT
::
Sanitizer
<
OT
::
os2
>
().
sanitize
(
hb_face_reference_table
(
plan
->
source
,
HB_OT_TAG_os2
)
);
hb_blob_t
*
os2_blob
=
OT
::
hb_sanitize_context_t
().
reference_table
<
OT
::
os2
>
(
plan
->
source
);
hb_blob_t
*
os2_prime_blob
=
hb_blob_create_sub_blob
(
os2_blob
,
0
,
-
1
);
// TODO(grieger): move to hb_blob_copy_writable_or_fail
hb_blob_destroy
(
os2_blob
);
...
...
src/hb-ot-post-table.hh
浏览文件 @
9583e007
...
...
@@ -110,7 +110,7 @@ struct post
{
index_to_offset
.
init
();
blob
=
Sanitizer
<
post
>
().
sanitize
(
face
->
reference_table
(
HB_OT_TAG_post
)
);
blob
=
hb_sanitize_context_t
().
reference_table
<
post
>
(
face
);
const
post
*
table
=
blob
->
as
<
post
>
();
unsigned
int
table_length
=
blob
->
length
;
...
...
src/hb-subset.cc
浏览文件 @
9583e007
...
...
@@ -78,9 +78,7 @@ template<typename TableType>
static
bool
_subset
(
hb_subset_plan_t
*
plan
)
{
OT
::
Sanitizer
<
TableType
>
sanitizer
;
hb_blob_t
*
source_blob
=
sanitizer
.
sanitize
(
plan
->
source
->
reference_table
(
TableType
::
tableTag
));
hb_blob_t
*
source_blob
=
OT
::
hb_sanitize_context_t
().
reference_table
<
TableType
>
(
plan
->
source
);
const
TableType
*
table
=
source_blob
->
as
<
TableType
>
();
hb_tag_t
tag
=
TableType
::
tableTag
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录