Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
0b0fad3e
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看板
提交
0b0fad3e
编写于
11月 11, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[color] Port to hb_blob_ptr_t
Fix hb_blob_ptr_t::get_length () as well.
上级
925b7a21
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
31 addition
and
52 deletion
+31
-52
src/hb-blob.hh
src/hb-blob.hh
+1
-1
src/hb-ot-color-cbdt-table.hh
src/hb-ot-color-cbdt-table.hh
+13
-25
src/hb-ot-color-sbix-table.hh
src/hb-ot-color-sbix-table.hh
+4
-6
src/hb-ot-color-svg-table.hh
src/hb-ot-color-svg-table.hh
+5
-6
src/hb-ot-glyf-table.hh
src/hb-ot-glyf-table.hh
+8
-14
未找到文件。
src/hb-blob.hh
浏览文件 @
0b0fad3e
...
@@ -96,7 +96,7 @@ struct hb_blob_ptr_t
...
@@ -96,7 +96,7 @@ struct hb_blob_ptr_t
inline
operator
const
char
*
(
void
)
const
{
return
(
const
char
*
)
get
();
}
inline
operator
const
char
*
(
void
)
const
{
return
(
const
char
*
)
get
();
}
inline
const
T
*
get
(
void
)
const
{
return
b
->
as
<
T
>
();
}
inline
const
T
*
get
(
void
)
const
{
return
b
->
as
<
T
>
();
}
inline
hb_blob_t
*
get_blob
(
void
)
const
{
return
b
.
get_raw
();
}
inline
hb_blob_t
*
get_blob
(
void
)
const
{
return
b
.
get_raw
();
}
inline
unsigned
int
get_length
(
void
)
const
{
return
get_blob
()
->
length
;
}
inline
unsigned
int
get_length
(
void
)
const
{
return
b
.
get
()
->
length
;
}
hb_nonnull_ptr_t
<
hb_blob_t
>
b
;
hb_nonnull_ptr_t
<
hb_blob_t
>
b
;
};
};
...
...
src/hb-ot-color-cbdt-table.hh
浏览文件 @
0b0fad3e
...
@@ -384,26 +384,16 @@ struct CBDT
...
@@ -384,26 +384,16 @@ struct CBDT
{
{
inline
void
init
(
hb_face_t
*
face
)
inline
void
init
(
hb_face_t
*
face
)
{
{
upem
=
hb_face_get_upem
(
face
);
cblc
=
hb_sanitize_context_t
().
reference_table
<
CBLC
>
(
face
);
cbdt
=
hb_sanitize_context_t
().
reference_table
<
CBDT
>
(
face
);
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
)
{
cblc
=
nullptr
;
cbdt
=
nullptr
;
return
;
/* Not a bitmap font. */
}
cblc
=
cblc_blob
->
as
<
CBLC
>
();
cbdt
=
cbdt_blob
->
as
<
CBDT
>
();
upem
=
hb_face_get_upem
(
face
);
}
}
inline
void
fini
(
void
)
inline
void
fini
(
void
)
{
{
hb_blob_destroy
(
this
->
cblc
_blob
);
hb_blob_destroy
(
this
->
cblc
.
get_blob
()
);
hb_blob_destroy
(
this
->
cbdt
_blob
);
hb_blob_destroy
(
this
->
cbdt
.
get_blob
()
);
}
}
inline
bool
get_extents
(
hb_font_t
*
font
,
hb_codepoint_t
glyph
,
inline
bool
get_extents
(
hb_font_t
*
font
,
hb_codepoint_t
glyph
,
...
@@ -423,6 +413,7 @@ struct CBDT
...
@@ -423,6 +413,7 @@ struct CBDT
return
false
;
return
false
;
{
{
unsigned
int
cbdt_len
=
cbdt
.
get_length
();
if
(
unlikely
(
image_offset
>
cbdt_len
||
cbdt_len
-
image_offset
<
image_length
))
if
(
unlikely
(
image_offset
>
cbdt_len
||
cbdt_len
-
image_offset
<
image_length
))
return
false
;
return
false
;
...
@@ -475,6 +466,7 @@ struct CBDT
...
@@ -475,6 +466,7 @@ struct CBDT
return
hb_blob_get_empty
();
return
hb_blob_get_empty
();
{
{
unsigned
int
cbdt_len
=
cbdt
.
get_length
();
if
(
unlikely
(
image_offset
>
cbdt_len
||
cbdt_len
-
image_offset
<
image_length
))
if
(
unlikely
(
image_offset
>
cbdt_len
||
cbdt_len
-
image_offset
<
image_length
))
return
hb_blob_get_empty
();
return
hb_blob_get_empty
();
...
@@ -485,7 +477,7 @@ struct CBDT
...
@@ -485,7 +477,7 @@ struct CBDT
return
hb_blob_get_empty
();
return
hb_blob_get_empty
();
const
GlyphBitmapDataFormat17
&
glyphFormat17
=
const
GlyphBitmapDataFormat17
&
glyphFormat17
=
StructAtOffset
<
GlyphBitmapDataFormat17
>
(
this
->
cbdt
,
image_offset
);
StructAtOffset
<
GlyphBitmapDataFormat17
>
(
this
->
cbdt
,
image_offset
);
return
hb_blob_create_sub_blob
(
cbdt
_blob
,
return
hb_blob_create_sub_blob
(
cbdt
.
get_blob
()
,
image_offset
+
GlyphBitmapDataFormat17
::
min_size
,
image_offset
+
GlyphBitmapDataFormat17
::
min_size
,
glyphFormat17
.
data
.
len
);
glyphFormat17
.
data
.
len
);
}
}
...
@@ -494,7 +486,7 @@ struct CBDT
...
@@ -494,7 +486,7 @@ struct CBDT
return
hb_blob_get_empty
();
return
hb_blob_get_empty
();
const
GlyphBitmapDataFormat18
&
glyphFormat18
=
const
GlyphBitmapDataFormat18
&
glyphFormat18
=
StructAtOffset
<
GlyphBitmapDataFormat18
>
(
this
->
cbdt
,
image_offset
);
StructAtOffset
<
GlyphBitmapDataFormat18
>
(
this
->
cbdt
,
image_offset
);
return
hb_blob_create_sub_blob
(
cbdt
_blob
,
return
hb_blob_create_sub_blob
(
cbdt
.
get_blob
()
,
image_offset
+
GlyphBitmapDataFormat18
::
min_size
,
image_offset
+
GlyphBitmapDataFormat18
::
min_size
,
glyphFormat18
.
data
.
len
);
glyphFormat18
.
data
.
len
);
}
}
...
@@ -503,7 +495,7 @@ struct CBDT
...
@@ -503,7 +495,7 @@ struct CBDT
return
hb_blob_get_empty
();
return
hb_blob_get_empty
();
const
GlyphBitmapDataFormat19
&
glyphFormat19
=
const
GlyphBitmapDataFormat19
&
glyphFormat19
=
StructAtOffset
<
GlyphBitmapDataFormat19
>
(
this
->
cbdt
,
image_offset
);
StructAtOffset
<
GlyphBitmapDataFormat19
>
(
this
->
cbdt
,
image_offset
);
return
hb_blob_create_sub_blob
(
cbdt
_blob
,
return
hb_blob_create_sub_blob
(
cbdt
.
get_blob
()
,
image_offset
+
GlyphBitmapDataFormat19
::
min_size
,
image_offset
+
GlyphBitmapDataFormat19
::
min_size
,
glyphFormat19
.
data
.
len
);
glyphFormat19
.
data
.
len
);
}
}
...
@@ -513,16 +505,12 @@ struct CBDT
...
@@ -513,16 +505,12 @@ struct CBDT
return
hb_blob_get_empty
();
return
hb_blob_get_empty
();
}
}
inline
bool
has_data
()
const
inline
bool
has_data
()
const
{
return
cbdt
.
get_length
();
}
{
return
cbdt_len
;
}
private:
private:
hb_blob_t
*
cblc_blob
;
hb_blob_ptr_t
<
CBLC
>
cblc
;
hb_blob_t
*
cbdt_blob
;
hb_blob_ptr_t
<
CBDT
>
cbdt
;
hb_nonnull_ptr_t
<
const
CBLC
>
cblc
;
hb_nonnull_ptr_t
<
const
CBDT
>
cbdt
;
unsigned
int
cbdt_len
;
unsigned
int
upem
;
unsigned
int
upem
;
};
};
...
...
src/hb-ot-color-sbix-table.hh
浏览文件 @
0b0fad3e
...
@@ -140,14 +140,13 @@ struct sbix
...
@@ -140,14 +140,13 @@ struct sbix
{
{
inline
void
init
(
hb_face_t
*
face
)
inline
void
init
(
hb_face_t
*
face
)
{
{
sbix_blob
=
hb_sanitize_context_t
().
reference_table
<
sbix
>
(
face
);
table
=
hb_sanitize_context_t
().
reference_table
<
sbix
>
(
face
);
table
=
sbix_blob
->
as
<
sbix
>
();
num_glyphs
=
face
->
get_num_glyphs
();
num_glyphs
=
face
->
get_num_glyphs
();
}
}
inline
void
fini
(
void
)
inline
void
fini
(
void
)
{
{
hb_blob_destroy
(
sbix_blob
);
hb_blob_destroy
(
table
.
get_blob
()
);
}
}
inline
bool
has_data
()
const
inline
bool
has_data
()
const
...
@@ -169,7 +168,7 @@ struct sbix
...
@@ -169,7 +168,7 @@ struct sbix
int
*
y_offset
,
int
*
y_offset
,
unsigned
int
*
available_ppem
)
const
unsigned
int
*
available_ppem
)
const
{
{
return
choose_strike
(
font
).
get_glyph_blob
(
glyph_id
,
sbix_blob
,
return
choose_strike
(
font
).
get_glyph_blob
(
glyph_id
,
table
.
get_blob
()
,
HB_TAG
(
'p'
,
'n'
,
'g'
,
' '
),
HB_TAG
(
'p'
,
'n'
,
'g'
,
' '
),
x_offset
,
y_offset
,
x_offset
,
y_offset
,
num_glyphs
,
available_ppem
);
num_glyphs
,
available_ppem
);
...
@@ -263,8 +262,7 @@ struct sbix
...
@@ -263,8 +262,7 @@ struct sbix
}
}
private:
private:
hb_blob_t
*
sbix_blob
;
hb_blob_ptr_t
<
sbix
>
table
;
hb_nonnull_ptr_t
<
const
sbix
>
table
;
unsigned
int
num_glyphs
;
unsigned
int
num_glyphs
;
};
};
...
...
src/hb-ot-color-svg-table.hh
浏览文件 @
0b0fad3e
...
@@ -81,25 +81,24 @@ struct SVG
...
@@ -81,25 +81,24 @@ struct SVG
{
{
inline
void
init
(
hb_face_t
*
face
)
inline
void
init
(
hb_face_t
*
face
)
{
{
svg_blob
=
hb_sanitize_context_t
().
reference_table
<
SVG
>
(
face
);
table
=
hb_sanitize_context_t
().
reference_table
<
SVG
>
(
face
);
table
=
svg_blob
->
as
<
SVG
>
();
}
}
inline
void
fini
(
void
)
inline
void
fini
(
void
)
{
{
hb_blob_destroy
(
svg_blob
);
hb_blob_destroy
(
table
.
get_blob
()
);
}
}
inline
hb_blob_t
*
reference_blob_for_glyph
(
hb_codepoint_t
glyph_id
)
const
inline
hb_blob_t
*
reference_blob_for_glyph
(
hb_codepoint_t
glyph_id
)
const
{
{
return
table
->
get_glyph_entry
(
glyph_id
).
reference_blob
(
svg_blob
,
table
->
svgDocEntries
);
return
table
->
get_glyph_entry
(
glyph_id
).
reference_blob
(
table
.
get_blob
(),
table
->
svgDocEntries
);
}
}
inline
bool
has_data
()
const
{
return
table
->
has_data
();
}
inline
bool
has_data
()
const
{
return
table
->
has_data
();
}
private:
private:
hb_blob_t
*
svg_blob
;
hb_blob_ptr_t
<
SVG
>
table
;
hb_nonnull_ptr_t
<
const
SVG
>
table
;
};
};
inline
const
SVGDocumentIndexEntry
&
get_glyph_entry
(
hb_codepoint_t
glyph_id
)
const
inline
const
SVGDocumentIndexEntry
&
get_glyph_entry
(
hb_codepoint_t
glyph_id
)
const
...
...
src/hb-ot-glyf-table.hh
浏览文件 @
0b0fad3e
...
@@ -246,19 +246,16 @@ struct glyf
...
@@ -246,19 +246,16 @@ struct glyf
short_offset
=
0
==
head_table
->
indexToLocFormat
;
short_offset
=
0
==
head_table
->
indexToLocFormat
;
hb_blob_destroy
(
head_blob
);
hb_blob_destroy
(
head_blob
);
loca_blob
=
hb_sanitize_context_t
().
reference_table
<
loca
>
(
face
);
loca_table
=
hb_sanitize_context_t
().
reference_table
<
loca
>
(
face
);
loca_table
=
loca_blob
->
as
<
loca
>
();
glyf_table
=
hb_sanitize_context_t
().
reference_table
<
glyf
>
(
face
);
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
;
num_glyphs
=
MAX
(
1u
,
loca_table
.
get_length
()
/
(
short_offset
?
2
:
4
))
-
1
;
glyf_len
=
hb_blob_get_length
(
glyf_blob
);
}
}
inline
void
fini
(
void
)
inline
void
fini
(
void
)
{
{
hb_blob_destroy
(
loca_
blob
);
hb_blob_destroy
(
loca_
table
.
get_blob
()
);
hb_blob_destroy
(
glyf_
blob
);
hb_blob_destroy
(
glyf_
table
.
get_blob
()
);
}
}
/*
/*
...
@@ -388,7 +385,7 @@ struct glyf
...
@@ -388,7 +385,7 @@ struct glyf
*
end_offset
=
offsets
[
glyph
+
1
];
*
end_offset
=
offsets
[
glyph
+
1
];
}
}
if
(
*
start_offset
>
*
end_offset
||
*
end_offset
>
glyf_
len
)
if
(
*
start_offset
>
*
end_offset
||
*
end_offset
>
glyf_
table
.
get_length
()
)
return
false
;
return
false
;
return
true
;
return
true
;
...
@@ -476,11 +473,8 @@ struct glyf
...
@@ -476,11 +473,8 @@ struct glyf
private:
private:
bool
short_offset
;
bool
short_offset
;
unsigned
int
num_glyphs
;
unsigned
int
num_glyphs
;
hb_nonnull_ptr_t
<
const
loca
>
loca_table
;
hb_blob_ptr_t
<
loca
>
loca_table
;
hb_nonnull_ptr_t
<
const
glyf
>
glyf_table
;
hb_blob_ptr_t
<
glyf
>
glyf_table
;
hb_blob_t
*
loca_blob
;
hb_blob_t
*
glyf_blob
;
unsigned
int
glyf_len
;
};
};
protected:
protected:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录