Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
0271c7ab
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看板
提交
0271c7ab
编写于
8月 03, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[ot] Move GSUB/GPOS into tables_t
上级
f73d2775
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
30 addition
and
40 deletion
+30
-40
src/hb-machinery-private.hh
src/hb-machinery-private.hh
+2
-4
src/hb-ot-layout-gpos-table.hh
src/hb-ot-layout-gpos-table.hh
+2
-2
src/hb-ot-layout-gsub-table.hh
src/hb-ot-layout-gsub-table.hh
+2
-2
src/hb-ot-layout-private.hh
src/hb-ot-layout-private.hh
+2
-5
src/hb-ot-layout.cc
src/hb-ot-layout.cc
+22
-27
未找到文件。
src/hb-machinery-private.hh
浏览文件 @
0271c7ab
...
...
@@ -613,10 +613,8 @@ struct hb_base_lazy_loader_t
thiz
()
->
destroy
(
instance
);
}
inline
const
Returned
*
operator
->
(
void
)
const
{
return
thiz
()
->
get
();
}
inline
const
Returned
*
operator
->
(
void
)
const
{
return
thiz
()
->
get
();
}
inline
const
Returned
&
operator
*
(
void
)
const
{
return
*
thiz
()
->
get
();
}
inline
Stored
*
get_stored
(
void
)
const
{
...
...
src/hb-ot-layout-gpos-table.hh
浏览文件 @
0271c7ab
...
...
@@ -1628,14 +1628,14 @@ GPOS::position_finish_offsets (hb_font_t *font HB_UNUSED, hb_buffer_t *buffer)
template
<
typename
context_t
>
/*static*/
inline
typename
context_t
::
return_t
PosLookup
::
dispatch_recurse_func
(
context_t
*
c
,
unsigned
int
lookup_index
)
{
const
GPOS
&
gpos
=
*
(
hb_ot_layout_from_face
(
c
->
face
)
->
gpos
);
const
GPOS
&
gpos
=
*
(
hb_ot_layout_from_face
(
c
->
face
)
->
table
.
GPOS
);
const
PosLookup
&
l
=
gpos
.
get_lookup
(
lookup_index
);
return
l
.
dispatch
(
c
);
}
/*static*/
inline
bool
PosLookup
::
apply_recurse_func
(
hb_ot_apply_context_t
*
c
,
unsigned
int
lookup_index
)
{
const
GPOS
&
gpos
=
*
(
hb_ot_layout_from_face
(
c
->
face
)
->
gpos
);
const
GPOS
&
gpos
=
*
(
hb_ot_layout_from_face
(
c
->
face
)
->
table
.
GPOS
);
const
PosLookup
&
l
=
gpos
.
get_lookup
(
lookup_index
);
unsigned
int
saved_lookup_props
=
c
->
lookup_props
;
unsigned
int
saved_lookup_index
=
c
->
lookup_index
;
...
...
src/hb-ot-layout-gsub-table.hh
浏览文件 @
0271c7ab
...
...
@@ -1359,14 +1359,14 @@ GSUB::substitute_start (hb_font_t *font, hb_buffer_t *buffer)
template
<
typename
context_t
>
/*static*/
inline
typename
context_t
::
return_t
SubstLookup
::
dispatch_recurse_func
(
context_t
*
c
,
unsigned
int
lookup_index
)
{
const
GSUB
&
gsub
=
*
(
hb_ot_layout_from_face
(
c
->
face
)
->
gsub
);
const
GSUB
&
gsub
=
*
(
hb_ot_layout_from_face
(
c
->
face
)
->
table
.
GSUB
);
const
SubstLookup
&
l
=
gsub
.
get_lookup
(
lookup_index
);
return
l
.
dispatch
(
c
);
}
/*static*/
inline
bool
SubstLookup
::
apply_recurse_func
(
hb_ot_apply_context_t
*
c
,
unsigned
int
lookup_index
)
{
const
GSUB
&
gsub
=
*
(
hb_ot_layout_from_face
(
c
->
face
)
->
gsub
);
const
GSUB
&
gsub
=
*
(
hb_ot_layout_from_face
(
c
->
face
)
->
table
.
GSUB
);
const
SubstLookup
&
l
=
gsub
.
get_lookup
(
lookup_index
);
unsigned
int
saved_lookup_props
=
c
->
lookup_props
;
unsigned
int
saved_lookup_index
=
c
->
lookup_index
;
...
...
src/hb-ot-layout-private.hh
浏览文件 @
0271c7ab
...
...
@@ -158,6 +158,8 @@ namespace AAT {
}
#define HB_OT_LAYOUT_TABLES \
HB_OT_LAYOUT_TABLE(OT, GSUB) \
HB_OT_LAYOUT_TABLE(OT, GPOS) \
HB_OT_LAYOUT_TABLE(OT, MATH) \
HB_OT_LAYOUT_TABLE(OT, fvar) \
HB_OT_LAYOUT_TABLE(OT, avar) \
...
...
@@ -171,12 +173,7 @@ HB_OT_LAYOUT_TABLES
struct
hb_ot_layout_t
{
hb_blob_t
*
gdef_blob
;
hb_blob_t
*
gsub_blob
;
hb_blob_t
*
gpos_blob
;
const
struct
OT
::
GDEF
*
gdef
;
const
struct
OT
::
GSUB
*
gsub
;
const
struct
OT
::
GPOS
*
gpos
;
unsigned
int
gsub_lookup_count
;
unsigned
int
gpos_lookup_count
;
...
...
src/hb-ot-layout.cc
浏览文件 @
0271c7ab
...
...
@@ -173,36 +173,33 @@ _hb_ot_layout_create (hb_face_t *face)
layout
->
gdef_blob
=
hb_sanitize_context_t
().
reference_table
<
OT
::
GDEF
>
(
face
);
layout
->
gdef
=
layout
->
gdef_blob
->
as
<
OT
::
GDEF
>
();
layout
->
gsub_blob
=
hb_sanitize_context_t
().
reference_table
<
OT
::
GSUB
>
(
face
);
layout
->
gsub
=
layout
->
gsub_blob
->
as
<
OT
::
GSUB
>
();
layout
->
gpos_blob
=
hb_sanitize_context_t
().
reference_table
<
OT
::
GPOS
>
(
face
);
layout
->
gpos
=
layout
->
gpos_blob
->
as
<
OT
::
GPOS
>
();
layout
->
table
.
init0
(
face
);
const
OT
::
GSUB
&
gsub
=
*
layout
->
table
.
GSUB
;
const
OT
::
GPOS
&
gpos
=
*
layout
->
table
.
GPOS
;
if
(
_hb_ot_blacklist_gdef
(
layout
->
gdef_blob
->
length
,
layout
->
gsub_blob
->
length
,
layout
->
gpos_blob
->
length
))
layout
->
table
.
GSUB
.
get_blob
()
->
length
,
layout
->
table
.
GPOS
.
get_blob
()
->
length
))
layout
->
gdef
=
&
Null
(
OT
::
GDEF
);
layout
->
gsub_lookup_count
=
layout
->
gsub
->
get_lookup_count
();
layout
->
gpos_lookup_count
=
layout
->
gpos
->
get_lookup_count
();
unsigned
int
gsub_lookup_count
=
layout
->
gsub_lookup_count
=
gsub
.
get_lookup_count
();
unsigned
int
gpos_lookup_count
=
layout
->
gpos_lookup_count
=
gpos
.
get_lookup_count
();
layout
->
gsub_accels
=
(
hb_ot_layout_lookup_accelerator_t
*
)
calloc
(
layout
->
gsub
->
get_lookup_count
()
,
sizeof
(
hb_ot_layout_lookup_accelerator_t
));
layout
->
gpos_accels
=
(
hb_ot_layout_lookup_accelerator_t
*
)
calloc
(
layout
->
gpos
->
get_lookup_count
()
,
sizeof
(
hb_ot_layout_lookup_accelerator_t
));
layout
->
gsub_accels
=
(
hb_ot_layout_lookup_accelerator_t
*
)
calloc
(
gsub_lookup_count
,
sizeof
(
hb_ot_layout_lookup_accelerator_t
));
layout
->
gpos_accels
=
(
hb_ot_layout_lookup_accelerator_t
*
)
calloc
(
gpos_lookup_count
,
sizeof
(
hb_ot_layout_lookup_accelerator_t
));
if
(
unlikely
((
layout
->
gsub_lookup_count
&&
!
layout
->
gsub_accels
)
||
(
layout
->
gpos_lookup_count
&&
!
layout
->
gpos_accels
)))
if
(
unlikely
((
gsub_lookup_count
&&
!
layout
->
gsub_accels
)
||
(
gpos_lookup_count
&&
!
layout
->
gpos_accels
)))
{
_hb_ot_layout_destroy
(
layout
);
return
nullptr
;
}
for
(
unsigned
int
i
=
0
;
i
<
layout
->
gsub_lookup_count
;
i
++
)
layout
->
gsub_accels
[
i
].
init
(
layout
->
gsub
->
get_lookup
(
i
));
for
(
unsigned
int
i
=
0
;
i
<
layout
->
gpos_lookup_count
;
i
++
)
layout
->
gpos_accels
[
i
].
init
(
layout
->
gpos
->
get_lookup
(
i
));
for
(
unsigned
int
i
=
0
;
i
<
gsub_lookup_count
;
i
++
)
layout
->
gsub_accels
[
i
].
init
(
gsub
.
get_lookup
(
i
));
for
(
unsigned
int
i
=
0
;
i
<
gpos_lookup_count
;
i
++
)
layout
->
gpos_accels
[
i
].
init
(
gpos
.
get_lookup
(
i
));
return
layout
;
}
...
...
@@ -221,8 +218,6 @@ _hb_ot_layout_destroy (hb_ot_layout_t *layout)
free
(
layout
->
gpos_accels
);
hb_blob_destroy
(
layout
->
gdef_blob
);
hb_blob_destroy
(
layout
->
gsub_blob
);
hb_blob_destroy
(
layout
->
gpos_blob
);
layout
->
table
.
fini
();
...
...
@@ -247,13 +242,13 @@ 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_layout_from_face
(
face
)
->
gsub
;
return
*
hb_ot_layout_from_face
(
face
)
->
table
.
GSUB
;
}
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_layout_from_face
(
face
)
->
gpos
;
return
*
hb_ot_layout_from_face
(
face
)
->
table
.
GPOS
;
}
/*
...
...
@@ -861,13 +856,13 @@ hb_ot_layout_lookup_collect_glyphs (hb_face_t *face,
{
case
HB_OT_TAG_GSUB
:
{
const
OT
::
SubstLookup
&
l
=
hb_ot_layout_from_face
(
face
)
->
gsub
->
get_lookup
(
lookup_index
);
const
OT
::
SubstLookup
&
l
=
hb_ot_layout_from_face
(
face
)
->
table
.
GSUB
->
get_lookup
(
lookup_index
);
l
.
collect_glyphs
(
&
c
);
return
;
}
case
HB_OT_TAG_GPOS
:
{
const
OT
::
PosLookup
&
l
=
hb_ot_layout_from_face
(
face
)
->
gpos
->
get_lookup
(
lookup_index
);
const
OT
::
PosLookup
&
l
=
hb_ot_layout_from_face
(
face
)
->
table
.
GPOS
->
get_lookup
(
lookup_index
);
l
.
collect_glyphs
(
&
c
);
return
;
}
...
...
@@ -943,7 +938,7 @@ hb_ot_layout_lookup_would_substitute_fast (hb_face_t *face,
if
(
unlikely
(
lookup_index
>=
hb_ot_layout_from_face
(
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_layout_from_face
(
face
)
->
gsub
->
get_lookup
(
lookup_index
);
const
OT
::
SubstLookup
&
l
=
hb_ot_layout_from_face
(
face
)
->
table
.
GSUB
->
get_lookup
(
lookup_index
);
return
l
.
would_apply
(
&
c
,
&
hb_ot_layout_from_face
(
face
)
->
gsub_accels
[
lookup_index
]);
}
...
...
@@ -1101,7 +1096,7 @@ struct GSUBProxy
typedef
OT
::
SubstLookup
Lookup
;
GSUBProxy
(
hb_face_t
*
face
)
:
table
(
*
hb_ot_layout_from_face
(
face
)
->
gsub
),
table
(
*
hb_ot_layout_from_face
(
face
)
->
table
.
GSUB
),
accels
(
hb_ot_layout_from_face
(
face
)
->
gsub_accels
)
{}
const
OT
::
GSUB
&
table
;
...
...
@@ -1115,7 +1110,7 @@ struct GPOSProxy
typedef
OT
::
PosLookup
Lookup
;
GPOSProxy
(
hb_face_t
*
face
)
:
table
(
*
hb_ot_layout_from_face
(
face
)
->
gpos
),
table
(
*
hb_ot_layout_from_face
(
face
)
->
table
.
GPOS
),
accels
(
hb_ot_layout_from_face
(
face
)
->
gpos_accels
)
{}
const
OT
::
GPOS
&
table
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录