Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
b912fbea
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看板
提交
b912fbea
编写于
8月 06, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove most uses of direct comparison to Null objects
上级
3506672c
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
20 addition
and
13 deletion
+20
-13
src/hb-ot-glyf-table.hh
src/hb-ot-glyf-table.hh
+3
-3
src/hb-ot-head-table.hh
src/hb-ot-head-table.hh
+2
-2
src/hb-ot-layout-gdef-table.hh
src/hb-ot-layout-gdef-table.hh
+1
-0
src/hb-ot-layout-gsubgpos-private.hh
src/hb-ot-layout-gsubgpos-private.hh
+1
-0
src/hb-ot-layout.cc
src/hb-ot-layout.cc
+3
-3
src/hb-ot-math-table.hh
src/hb-ot-math-table.hh
+2
-0
src/hb-ot-math.cc
src/hb-ot-math.cc
+1
-1
src/hb-ot-shape-complex-arabic-fallback.hh
src/hb-ot-shape-complex-arabic-fallback.hh
+2
-1
src/hb-ot-var-fvar-table.hh
src/hb-ot-var-fvar-table.hh
+2
-0
src/hb-ot-var.cc
src/hb-ot-var.cc
+1
-1
src/hb-subset.cc
src/hb-subset.cc
+1
-1
src/main.cc
src/main.cc
+1
-1
未找到文件。
src/hb-ot-glyf-table.hh
浏览文件 @
b912fbea
...
...
@@ -238,9 +238,9 @@ struct glyf
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
)
if
(
head_table
->
indexToLocFormat
>
1
||
head_table
->
glyphDataFormat
!=
0
)
{
/*
head table is not present, or in an u
nknown format. Leave num_glyphs=0, that takes care of disabling us. */
/*
U
nknown format. Leave num_glyphs=0, that takes care of disabling us. */
hb_blob_destroy
(
head_blob
);
return
;
}
...
...
@@ -270,7 +270,7 @@ struct glyf
inline
bool
get_composite
(
hb_codepoint_t
glyph
,
CompositeGlyphHeader
::
Iterator
*
composite
/* OUT */
)
const
{
if
(
this
->
glyf_table
==
&
Null
(
glyf
)
||
!
num_glyphs
)
if
(
unlikely
(
!
num_glyphs
)
)
return
false
;
unsigned
int
start_offset
,
end_offset
;
...
...
src/hb-ot-head-table.hh
浏览文件 @
b912fbea
...
...
@@ -141,8 +141,8 @@ struct head
* -1: Only strongly right to left;
* -2: Like -1 but also contains neutrals. */
public:
HBINT16
indexToLocFormat
;
/* 0 for short offsets, 1 for long. */
HBINT16
glyphDataFormat
;
/* 0 for current format. */
HB
U
INT16
indexToLocFormat
;
/* 0 for short offsets, 1 for long. */
HB
U
INT16
glyphDataFormat
;
/* 0 for current format. */
DEFINE_SIZE_STATIC
(
54
);
};
...
...
src/hb-ot-layout-gdef-table.hh
浏览文件 @
b912fbea
...
...
@@ -349,6 +349,7 @@ struct GDEF
ComponentGlyph
=
4
};
inline
bool
has_data
(
void
)
const
{
return
version
.
to_int
()
!=
0
;
}
inline
bool
has_glyph_classes
(
void
)
const
{
return
glyphClassDef
!=
0
;
}
inline
unsigned
int
get_glyph_class
(
hb_codepoint_t
glyph
)
const
{
return
(
this
+
glyphClassDef
).
get_class
(
glyph
);
}
...
...
src/hb-ot-layout-gsubgpos-private.hh
浏览文件 @
b912fbea
...
...
@@ -2320,6 +2320,7 @@ struct Extension
struct
GSUBGPOS
{
inline
bool
has_data
(
void
)
const
{
return
version
.
to_int
()
!=
0
;
}
inline
unsigned
int
get_script_count
(
void
)
const
{
return
(
this
+
scriptList
).
len
;
}
inline
const
Tag
&
get_script_tag
(
unsigned
int
i
)
const
...
...
src/hb-ot-layout.cc
浏览文件 @
b912fbea
...
...
@@ -904,7 +904,7 @@ hb_ot_layout_feature_with_variations_get_lookups (hb_face_t *face,
hb_bool_t
hb_ot_layout_has_substitution
(
hb_face_t
*
face
)
{
return
&
_get_gsub
(
face
)
!=
&
Null
(
OT
::
GSUB
);
return
_get_gsub
(
face
).
has_data
(
);
}
/**
...
...
@@ -1006,7 +1006,7 @@ hb_ot_layout_lookups_substitute_closure (hb_face_t *face,
hb_bool_t
hb_ot_layout_has_positioning
(
hb_face_t
*
face
)
{
return
&
_get_gpos
(
face
)
!=
&
Null
(
OT
::
GPOS
);
return
_get_gpos
(
face
).
has_data
(
);
}
void
...
...
@@ -1341,5 +1341,5 @@ hb_ot_layout_substitute_lookup (OT::hb_ot_apply_context_t *c,
// hb_bool_t
// hb_ot_base_has_data (hb_face_t *face)
// {
// return
&_get_base (face) != &Null(OT::BASE
);
// return
_get_base (face).has_data (
);
// }
src/hb-ot-math-table.hh
浏览文件 @
b912fbea
...
...
@@ -686,6 +686,8 @@ struct MATH
{
static
const
hb_tag_t
tableTag
=
HB_OT_TAG_MATH
;
inline
bool
has_data
(
void
)
const
{
return
version
.
to_int
()
!=
0
;
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
...
...
src/hb-ot-math.cc
浏览文件 @
b912fbea
...
...
@@ -55,7 +55,7 @@ _get_math (hb_face_t *face)
hb_bool_t
hb_ot_math_has_data
(
hb_face_t
*
face
)
{
return
&
_get_math
(
face
)
!=
&
Null
(
OT
::
MATH
);
return
_get_math
(
face
).
has_data
(
);
}
/**
...
...
src/hb-ot-shape-complex-arabic-fallback.hh
浏览文件 @
b912fbea
...
...
@@ -313,6 +313,7 @@ arabic_fallback_plan_create (const hb_ot_shape_plan_t *plan,
if
(
arabic_fallback_plan_init_win1256
(
fallback_plan
,
plan
,
font
))
return
fallback_plan
;
assert
(
fallback_plan
->
num_lookups
==
0
);
free
(
fallback_plan
);
return
const_cast
<
arabic_fallback_plan_t
*>
(
&
Null
(
arabic_fallback_plan_t
));
}
...
...
@@ -320,7 +321,7 @@ arabic_fallback_plan_create (const hb_ot_shape_plan_t *plan,
static
void
arabic_fallback_plan_destroy
(
arabic_fallback_plan_t
*
fallback_plan
)
{
if
(
!
fallback_plan
||
fallback_plan
==
&
Null
(
arabic_fallback_plan_t
)
)
if
(
!
fallback_plan
||
fallback_plan
->
num_lookups
==
0
)
return
;
for
(
unsigned
int
i
=
0
;
i
<
fallback_plan
->
num_lookups
;
i
++
)
...
...
src/hb-ot-var-fvar-table.hh
浏览文件 @
b912fbea
...
...
@@ -87,6 +87,8 @@ struct fvar
{
static
const
hb_tag_t
tableTag
=
HB_OT_TAG_fvar
;
inline
bool
has_data
(
void
)
const
{
return
version
.
to_int
()
!=
0
;
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
...
...
src/hb-ot-var.cc
浏览文件 @
b912fbea
...
...
@@ -65,7 +65,7 @@ _get_avar (hb_face_t *face)
hb_bool_t
hb_ot_var_has_data
(
hb_face_t
*
face
)
{
return
&
_get_fvar
(
face
)
!=
&
Null
(
OT
::
fvar
);
return
_get_fvar
(
face
).
has_data
(
);
}
/**
...
...
src/hb-subset.cc
浏览文件 @
b912fbea
...
...
@@ -83,7 +83,7 @@ _subset (hb_subset_plan_t *plan)
hb_tag_t
tag
=
TableType
::
tableTag
;
hb_bool_t
result
=
false
;
if
(
table
!=
&
Null
(
TableType
)
)
if
(
source_blob
->
data
)
{
result
=
table
->
subset
(
plan
);
}
else
{
...
...
src/main.cc
浏览文件 @
b912fbea
...
...
@@ -53,7 +53,7 @@ main (int argc, char **argv)
hb_blob_t
*
font_blob
=
hb_sanitize_context_t
().
sanitize_blob
<
OpenTypeFontFile
>
(
blob
);
const
OpenTypeFontFile
*
sanitized
=
font_blob
->
as
<
OpenTypeFontFile
>
();
if
(
sanitized
==
&
Null
(
OpenTypeFontFile
)
)
if
(
!
font_blob
->
data
)
{
printf
(
"Sanitization of the file wasn't successful. Exit"
);
return
1
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录