Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
a2680680
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看板
提交
a2680680
编写于
8月 26, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[ot-face] Remove tables_t. The face_data_t is what tables_t was
上级
3a0b3a29
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
54 addition
and
61 deletion
+54
-61
src/hb-aat-layout.cc
src/hb-aat-layout.cc
+2
-2
src/hb-face.cc
src/hb-face.cc
+3
-3
src/hb-ot-face.cc
src/hb-ot-face.cc
+4
-4
src/hb-ot-face.hh
src/hb-ot-face.hh
+12
-16
src/hb-ot-font.cc
src/hb-ot-font.cc
+11
-14
src/hb-ot-layout.cc
src/hb-ot-layout.cc
+18
-18
src/hb-ot-math.cc
src/hb-ot-math.cc
+2
-2
src/hb-ot-var.cc
src/hb-ot-var.cc
+2
-2
未找到文件。
src/hb-aat-layout.cc
浏览文件 @
a2680680
...
...
@@ -49,9 +49,9 @@ _get_morx (hb_face_t *face, hb_blob_t **blob = nullptr)
*
blob
=
hb_blob_get_empty
();
return
Null
(
AAT
::
morx
);
}
const
AAT
::
morx
&
morx
=
*
(
hb_ot_face_data
(
face
)
->
table
.
morx
.
get
());
const
AAT
::
morx
&
morx
=
*
(
hb_ot_face_data
(
face
)
->
morx
.
get
());
if
(
blob
)
*
blob
=
hb_ot_face_data
(
face
)
->
table
.
morx
.
get_blob
();
*
blob
=
hb_ot_face_data
(
face
)
->
morx
.
get_blob
();
return
morx
;
}
...
...
src/hb-face.cc
浏览文件 @
a2680680
...
...
@@ -533,7 +533,7 @@ hb_face_collect_unicodes (hb_face_t *face,
hb_set_t
*
out
)
{
if
(
unlikely
(
!
hb_ot_shaper_face_data_ensure
(
face
)))
return
;
hb_ot_face_data
(
face
)
->
table
.
cmap
->
collect_unicodes
(
out
);
hb_ot_face_data
(
face
)
->
cmap
->
collect_unicodes
(
out
);
}
/**
...
...
@@ -550,7 +550,7 @@ hb_face_collect_variation_selectors (hb_face_t *face,
hb_set_t
*
out
)
{
if
(
unlikely
(
!
hb_ot_shaper_face_data_ensure
(
face
)))
return
;
hb_ot_face_data
(
face
)
->
table
.
cmap
->
collect_variation_selectors
(
out
);
hb_ot_face_data
(
face
)
->
cmap
->
collect_variation_selectors
(
out
);
}
/**
...
...
@@ -568,7 +568,7 @@ hb_face_collect_variation_unicodes (hb_face_t *face,
hb_set_t
*
out
)
{
if
(
unlikely
(
!
hb_ot_shaper_face_data_ensure
(
face
)))
return
;
hb_ot_face_data
(
face
)
->
table
.
cmap
->
collect_variation_unicodes
(
variation_selector
,
out
);
hb_ot_face_data
(
face
)
->
cmap
->
collect_variation_unicodes
(
variation_selector
,
out
);
}
...
...
src/hb-ot-face.cc
浏览文件 @
a2680680
...
...
@@ -37,7 +37,7 @@
#include "hb-ot-layout-gpos-table.hh"
void
hb_ot_face_data_t
::
tables_t
::
init0
(
hb_face_t
*
face
)
void
hb_ot_face_data_t
::
init0
(
hb_face_t
*
face
)
{
this
->
face
=
face
;
#define HB_OT_LAYOUT_TABLE(Namespace, Type) Type.init0 ();
...
...
@@ -46,7 +46,7 @@ void hb_ot_face_data_t::tables_t::init0 (hb_face_t *face)
#undef HB_OT_LAYOUT_ACCELERATOR
#undef HB_OT_LAYOUT_TABLE
}
void
hb_ot_face_data_t
::
tables_t
::
fini
(
void
)
void
hb_ot_face_data_t
::
fini
(
void
)
{
#define HB_OT_LAYOUT_TABLE(Namespace, Type) Type.fini ();
#define HB_OT_LAYOUT_ACCELERATOR(Namespace, Type) HB_OT_LAYOUT_TABLE (Namespace, Type)
...
...
@@ -62,7 +62,7 @@ _hb_ot_face_data_create (hb_face_t *face)
if
(
unlikely
(
!
data
))
return
nullptr
;
data
->
table
.
init0
(
face
);
data
->
init0
(
face
);
return
data
;
}
...
...
@@ -70,7 +70,7 @@ _hb_ot_face_data_create (hb_face_t *face)
void
_hb_ot_face_data_destroy
(
hb_ot_face_data_t
*
data
)
{
data
->
table
.
fini
();
data
->
fini
();
free
(
data
);
}
src/hb-ot-face.hh
浏览文件 @
a2680680
...
...
@@ -80,33 +80,29 @@ HB_OT_LAYOUT_TABLES
struct
hb_ot_face_data_t
{
/* All the president's tables. */
struct
tables_t
{
HB_INTERNAL
void
init0
(
hb_face_t
*
face
);
HB_INTERNAL
void
fini
(
void
);
HB_INTERNAL
void
init0
(
hb_face_t
*
face
);
HB_INTERNAL
void
fini
(
void
);
#define HB_OT_LAYOUT_TABLE_ORDER(Namespace, Type) \
HB_PASTE (ORDER_, HB_PASTE (Namespace, HB_PASTE (_, Type)))
enum
order_t
{
ORDER_ZERO
,
HB_PASTE (ORDER_, HB_PASTE (Namespace, HB_PASTE (_, Type)))
enum
order_t
{
ORDER_ZERO
,
#define HB_OT_LAYOUT_TABLE(Namespace, Type) HB_OT_LAYOUT_TABLE_ORDER (Namespace, Type),
#define HB_OT_LAYOUT_ACCELERATOR(Namespace, Type) HB_OT_LAYOUT_TABLE (Namespace, Type)
HB_OT_LAYOUT_TABLES
HB_OT_LAYOUT_TABLES
#undef HB_OT_LAYOUT_ACCELERATOR
#undef HB_OT_LAYOUT_TABLE
};
};
hb_face_t
*
face
;
/* MUST be JUST before the lazy loaders. */
hb_face_t
*
face
;
/* MUST be JUST before the lazy loaders. */
#define HB_OT_LAYOUT_TABLE(Namespace, Type) \
hb_table_lazy_loader_t<Namespace::Type, HB_OT_LAYOUT_TABLE_ORDER (Namespace, Type)> Type;
hb_table_lazy_loader_t<Namespace::Type, HB_OT_LAYOUT_TABLE_ORDER (Namespace, Type)> Type;
#define HB_OT_LAYOUT_ACCELERATOR(Namespace, Type) \
hb_face_lazy_loader_t<Namespace::Type##_accelerator_t, HB_OT_LAYOUT_TABLE_ORDER (Namespace, Type)> Type;
HB_OT_LAYOUT_TABLES
hb_face_lazy_loader_t<Namespace::Type##_accelerator_t, HB_OT_LAYOUT_TABLE_ORDER (Namespace, Type)> Type;
HB_OT_LAYOUT_TABLES
#undef HB_OT_LAYOUT_ACCELERATOR
#undef HB_OT_LAYOUT_TABLE
}
table
;
};
...
...
src/hb-ot-font.cc
浏览文件 @
a2680680
...
...
@@ -40,9 +40,6 @@
#include "hb-ot-color-cbdt-table.hh"
typedef
hb_ot_face_data_t
::
tables_t
hb_ot_font_t
;
static
hb_bool_t
hb_ot_get_nominal_glyph
(
hb_font_t
*
font
HB_UNUSED
,
void
*
font_data
,
...
...
@@ -51,7 +48,7 @@ hb_ot_get_nominal_glyph (hb_font_t *font HB_UNUSED,
void
*
user_data
HB_UNUSED
)
{
const
hb_ot_f
ont_t
*
ot_font
=
(
const
hb_ot_font
_t
*
)
font_data
;
const
hb_ot_f
ace_data_t
*
ot_font
=
(
const
hb_ot_face_data
_t
*
)
font_data
;
return
ot_font
->
cmap
.
get_relaxed
()
->
get_nominal_glyph
(
unicode
,
glyph
);
}
...
...
@@ -63,7 +60,7 @@ hb_ot_get_variation_glyph (hb_font_t *font HB_UNUSED,
hb_codepoint_t
*
glyph
,
void
*
user_data
HB_UNUSED
)
{
const
hb_ot_f
ont_t
*
ot_font
=
(
const
hb_ot_font
_t
*
)
font_data
;
const
hb_ot_f
ace_data_t
*
ot_font
=
(
const
hb_ot_face_data
_t
*
)
font_data
;
return
ot_font
->
cmap
.
get_relaxed
()
->
get_variation_glyph
(
unicode
,
variation_selector
,
glyph
);
}
...
...
@@ -73,7 +70,7 @@ hb_ot_get_glyph_h_advance (hb_font_t *font,
hb_codepoint_t
glyph
,
void
*
user_data
HB_UNUSED
)
{
const
hb_ot_f
ont_t
*
ot_font
=
(
const
hb_ot_font
_t
*
)
font_data
;
const
hb_ot_f
ace_data_t
*
ot_font
=
(
const
hb_ot_face_data
_t
*
)
font_data
;
return
font
->
em_scale_x
(
ot_font
->
hmtx
.
get_relaxed
()
->
get_advance
(
glyph
,
font
));
}
...
...
@@ -83,7 +80,7 @@ hb_ot_get_glyph_v_advance (hb_font_t *font,
hb_codepoint_t
glyph
,
void
*
user_data
HB_UNUSED
)
{
const
hb_ot_f
ont_t
*
ot_font
=
(
const
hb_ot_font
_t
*
)
font_data
;
const
hb_ot_f
ace_data_t
*
ot_font
=
(
const
hb_ot_face_data
_t
*
)
font_data
;
return
font
->
em_scale_y
(
-
(
int
)
ot_font
->
vmtx
.
get_relaxed
()
->
get_advance
(
glyph
,
font
));
}
...
...
@@ -94,7 +91,7 @@ hb_ot_get_glyph_h_kerning (hb_font_t *font,
hb_codepoint_t
right_glyph
,
void
*
user_data
HB_UNUSED
)
{
const
hb_ot_f
ont_t
*
ot_font
=
(
const
hb_ot_font
_t
*
)
font_data
;
const
hb_ot_f
ace_data_t
*
ot_font
=
(
const
hb_ot_face_data
_t
*
)
font_data
;
return
font
->
em_scale_x
(
ot_font
->
kern
->
get_h_kerning
(
left_glyph
,
right_glyph
));
}
...
...
@@ -105,7 +102,7 @@ hb_ot_get_glyph_extents (hb_font_t *font,
hb_glyph_extents_t
*
extents
,
void
*
user_data
HB_UNUSED
)
{
const
hb_ot_f
ont_t
*
ot_font
=
(
const
hb_ot_font
_t
*
)
font_data
;
const
hb_ot_f
ace_data_t
*
ot_font
=
(
const
hb_ot_face_data
_t
*
)
font_data
;
bool
ret
=
ot_font
->
glyf
->
get_extents
(
glyph
,
extents
);
if
(
!
ret
)
ret
=
ot_font
->
CBDT
->
get_extents
(
glyph
,
extents
);
...
...
@@ -124,7 +121,7 @@ hb_ot_get_glyph_name (hb_font_t *font HB_UNUSED,
char
*
name
,
unsigned
int
size
,
void
*
user_data
HB_UNUSED
)
{
const
hb_ot_f
ont_t
*
ot_font
=
(
const
hb_ot_font
_t
*
)
font_data
;
const
hb_ot_f
ace_data_t
*
ot_font
=
(
const
hb_ot_face_data
_t
*
)
font_data
;
return
ot_font
->
post
->
get_glyph_name
(
glyph
,
name
,
size
);
}
...
...
@@ -135,7 +132,7 @@ hb_ot_get_glyph_from_name (hb_font_t *font HB_UNUSED,
hb_codepoint_t
*
glyph
,
void
*
user_data
HB_UNUSED
)
{
const
hb_ot_f
ont_t
*
ot_font
=
(
const
hb_ot_font
_t
*
)
font_data
;
const
hb_ot_f
ace_data_t
*
ot_font
=
(
const
hb_ot_face_data
_t
*
)
font_data
;
return
ot_font
->
post
->
get_glyph_from_name
(
name
,
len
,
glyph
);
}
...
...
@@ -145,7 +142,7 @@ hb_ot_get_font_h_extents (hb_font_t *font,
hb_font_extents_t
*
metrics
,
void
*
user_data
HB_UNUSED
)
{
const
hb_ot_f
ont_t
*
ot_font
=
(
const
hb_ot_font
_t
*
)
font_data
;
const
hb_ot_f
ace_data_t
*
ot_font
=
(
const
hb_ot_face_data
_t
*
)
font_data
;
metrics
->
ascender
=
font
->
em_scale_y
(
ot_font
->
hmtx
.
get_relaxed
()
->
ascender
);
metrics
->
descender
=
font
->
em_scale_y
(
ot_font
->
hmtx
.
get_relaxed
()
->
descender
);
metrics
->
line_gap
=
font
->
em_scale_y
(
ot_font
->
hmtx
.
get_relaxed
()
->
line_gap
);
...
...
@@ -159,7 +156,7 @@ hb_ot_get_font_v_extents (hb_font_t *font,
hb_font_extents_t
*
metrics
,
void
*
user_data
HB_UNUSED
)
{
const
hb_ot_f
ont_t
*
ot_font
=
(
const
hb_ot_font
_t
*
)
font_data
;
const
hb_ot_f
ace_data_t
*
ot_font
=
(
const
hb_ot_face_data
_t
*
)
font_data
;
metrics
->
ascender
=
font
->
em_scale_x
(
ot_font
->
vmtx
.
get_relaxed
()
->
ascender
);
metrics
->
descender
=
font
->
em_scale_x
(
ot_font
->
vmtx
.
get_relaxed
()
->
descender
);
metrics
->
line_gap
=
font
->
em_scale_x
(
ot_font
->
vmtx
.
get_relaxed
()
->
line_gap
);
...
...
@@ -226,7 +223,7 @@ void
hb_ot_font_set_funcs
(
hb_font_t
*
font
)
{
if
(
unlikely
(
!
hb_ot_shaper_face_data_ensure
(
font
->
face
)))
return
;
hb_ot_f
ont_t
*
ot_font
=
&
hb_ot_face_data
(
font
->
face
)
->
table
;
hb_ot_f
ace_data_t
*
ot_font
=
hb_ot_face_data
(
font
->
face
)
;
/* Load them lazies. We access them with get_relaxed() for performance. */
ot_font
->
cmap
.
get
();
...
...
src/hb-ot-layout.cc
浏览文件 @
a2680680
...
...
@@ -59,35 +59,35 @@
inline
const
OT
::
GDEF
&
_get_gdef
(
hb_face_t
*
face
)
{
if
(
unlikely
(
!
hb_ot_shaper_face_data_ensure
(
face
)))
return
Null
(
OT
::
GDEF
);
return
*
hb_ot_face_data
(
face
)
->
table
.
GDEF
->
table
;
return
*
hb_ot_face_data
(
face
)
->
GDEF
->
table
;
}
static
hb_blob_t
*
_get_gsub_blob
(
hb_face_t
*
face
)
{
if
(
unlikely
(
!
hb_ot_shaper_face_data_ensure
(
face
)))
return
hb_blob_get_empty
();
return
hb_ot_face_data
(
face
)
->
table
.
GSUB
->
blob
;
return
hb_ot_face_data
(
face
)
->
GSUB
->
blob
;
}
static
inline
const
OT
::
GSUB
&
_get_gsub
(
hb_face_t
*
face
)
{
if
(
unlikely
(
!
hb_ot_shaper_face_data_ensure
(
face
)))
return
Null
(
OT
::
GSUB
);
return
*
hb_ot_face_data
(
face
)
->
table
.
GSUB
->
table
;
return
*
hb_ot_face_data
(
face
)
->
GSUB
->
table
;
}
inline
const
OT
::
GSUB
&
_get_gsub_relaxed
(
hb_face_t
*
face
)
{
return
*
hb_ot_face_data
(
face
)
->
table
.
GSUB
.
get_relaxed
()
->
table
;
return
*
hb_ot_face_data
(
face
)
->
GSUB
.
get_relaxed
()
->
table
;
}
static
hb_blob_t
*
_get_gpos_blob
(
hb_face_t
*
face
)
{
if
(
unlikely
(
!
hb_ot_shaper_face_data_ensure
(
face
)))
return
hb_blob_get_empty
();
return
hb_ot_face_data
(
face
)
->
table
.
GPOS
->
blob
;
return
hb_ot_face_data
(
face
)
->
GPOS
->
blob
;
}
static
inline
const
OT
::
GPOS
&
_get_gpos
(
hb_face_t
*
face
)
{
if
(
unlikely
(
!
hb_ot_shaper_face_data_ensure
(
face
)))
return
Null
(
OT
::
GPOS
);
return
*
hb_ot_face_data
(
face
)
->
table
.
GPOS
->
table
;
return
*
hb_ot_face_data
(
face
)
->
GPOS
->
table
;
}
inline
const
OT
::
GPOS
&
_get_gpos_relaxed
(
hb_face_t
*
face
)
{
return
*
hb_ot_face_data
(
face
)
->
table
.
GPOS
.
get_relaxed
()
->
table
;
return
*
hb_ot_face_data
(
face
)
->
GPOS
.
get_relaxed
()
->
table
;
}
...
...
@@ -614,11 +614,11 @@ hb_ot_layout_table_get_lookup_count (hb_face_t *face,
{
case
HB_OT_TAG_GSUB
:
{
return
hb_ot_face_data
(
face
)
->
table
.
GSUB
->
lookup_count
;
return
hb_ot_face_data
(
face
)
->
GSUB
->
lookup_count
;
}
case
HB_OT_TAG_GPOS
:
{
return
hb_ot_face_data
(
face
)
->
table
.
GPOS
->
lookup_count
;
return
hb_ot_face_data
(
face
)
->
GPOS
->
lookup_count
;
}
}
return
0
;
...
...
@@ -832,13 +832,13 @@ hb_ot_layout_lookup_collect_glyphs (hb_face_t *face,
{
case
HB_OT_TAG_GSUB
:
{
const
OT
::
SubstLookup
&
l
=
hb_ot_face_data
(
face
)
->
table
.
GSUB
->
table
->
get_lookup
(
lookup_index
);
const
OT
::
SubstLookup
&
l
=
hb_ot_face_data
(
face
)
->
GSUB
->
table
->
get_lookup
(
lookup_index
);
l
.
collect_glyphs
(
&
c
);
return
;
}
case
HB_OT_TAG_GPOS
:
{
const
OT
::
PosLookup
&
l
=
hb_ot_face_data
(
face
)
->
table
.
GPOS
->
table
->
get_lookup
(
lookup_index
);
const
OT
::
PosLookup
&
l
=
hb_ot_face_data
(
face
)
->
GPOS
->
table
->
get_lookup
(
lookup_index
);
l
.
collect_glyphs
(
&
c
);
return
;
}
...
...
@@ -911,12 +911,12 @@ hb_ot_layout_lookup_would_substitute_fast (hb_face_t *face,
unsigned
int
glyphs_length
,
hb_bool_t
zero_context
)
{
if
(
unlikely
(
lookup_index
>=
hb_ot_face_data
(
face
)
->
table
.
GSUB
->
lookup_count
))
return
false
;
if
(
unlikely
(
lookup_index
>=
hb_ot_face_data
(
face
)
->
GSUB
->
lookup_count
))
return
false
;
OT
::
hb_would_apply_context_t
c
(
face
,
glyphs
,
glyphs_length
,
(
bool
)
zero_context
);
const
OT
::
SubstLookup
&
l
=
hb_ot_face_data
(
face
)
->
table
.
GSUB
->
table
->
get_lookup
(
lookup_index
);
const
OT
::
SubstLookup
&
l
=
hb_ot_face_data
(
face
)
->
GSUB
->
table
->
get_lookup
(
lookup_index
);
return
l
.
would_apply
(
&
c
,
&
hb_ot_face_data
(
face
)
->
table
.
GSUB
->
accels
[
lookup_index
]);
return
l
.
would_apply
(
&
c
,
&
hb_ot_face_data
(
face
)
->
GSUB
->
accels
[
lookup_index
]);
}
void
...
...
@@ -1073,8 +1073,8 @@ struct GSUBProxy
typedef
OT
::
SubstLookup
Lookup
;
GSUBProxy
(
hb_face_t
*
face
)
:
table
(
*
hb_ot_face_data
(
face
)
->
table
.
GSUB
->
table
),
accels
(
hb_ot_face_data
(
face
)
->
table
.
GSUB
->
accels
)
{}
table
(
*
hb_ot_face_data
(
face
)
->
GSUB
->
table
),
accels
(
hb_ot_face_data
(
face
)
->
GSUB
->
accels
)
{}
const
OT
::
GSUB
&
table
;
const
hb_ot_layout_lookup_accelerator_t
*
accels
;
...
...
@@ -1087,8 +1087,8 @@ struct GPOSProxy
typedef
OT
::
PosLookup
Lookup
;
GPOSProxy
(
hb_face_t
*
face
)
:
table
(
*
hb_ot_face_data
(
face
)
->
table
.
GPOS
->
table
),
accels
(
hb_ot_face_data
(
face
)
->
table
.
GPOS
->
accels
)
{}
table
(
*
hb_ot_face_data
(
face
)
->
GPOS
->
table
),
accels
(
hb_ot_face_data
(
face
)
->
GPOS
->
accels
)
{}
const
OT
::
GPOS
&
table
;
const
hb_ot_layout_lookup_accelerator_t
*
accels
;
...
...
src/hb-ot-math.cc
浏览文件 @
a2680680
...
...
@@ -33,8 +33,8 @@ static inline const OT::MATH&
_get_math
(
hb_face_t
*
face
)
{
if
(
unlikely
(
!
hb_ot_shaper_face_data_ensure
(
face
)))
return
Null
(
OT
::
MATH
);
hb_ot_face_data_t
*
layout
=
hb_ot_face_data
(
face
);
return
*
(
layout
->
table
.
MATH
.
get
());
hb_ot_face_data_t
*
data
=
hb_ot_face_data
(
face
);
return
*
(
data
->
MATH
.
get
());
}
/*
...
...
src/hb-ot-var.cc
浏览文件 @
a2680680
...
...
@@ -41,14 +41,14 @@ _get_fvar (hb_face_t *face)
{
if
(
unlikely
(
!
hb_ot_shaper_face_data_ensure
(
face
)))
return
Null
(
OT
::
fvar
);
hb_ot_face_data_t
*
layout
=
hb_ot_face_data
(
face
);
return
*
(
layout
->
table
.
fvar
.
get
());
return
*
(
layout
->
fvar
.
get
());
}
static
inline
const
OT
::
avar
&
_get_avar
(
hb_face_t
*
face
)
{
if
(
unlikely
(
!
hb_ot_shaper_face_data_ensure
(
face
)))
return
Null
(
OT
::
avar
);
hb_ot_face_data_t
*
layout
=
hb_ot_face_data
(
face
);
return
*
(
layout
->
table
.
avar
.
get
());
return
*
(
layout
->
avar
.
get
());
}
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录