Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
9c3747c5
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看板
提交
9c3747c5
编写于
9月 03, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[subset] More
上级
6d618522
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
45 addition
and
35 deletion
+45
-35
src/hb-ot-layout-gpos-table.hh
src/hb-ot-layout-gpos-table.hh
+6
-4
src/hb-ot-layout-gsub-table.hh
src/hb-ot-layout-gsub-table.hh
+24
-24
src/hb-ot-layout-gsubgpos.hh
src/hb-ot-layout-gsubgpos.hh
+15
-7
未找到文件。
src/hb-ot-layout-gpos-table.hh
浏览文件 @
9c3747c5
...
...
@@ -1433,7 +1433,7 @@ struct ChainContextPos : ChainContext {};
struct
ExtensionPos
:
Extension
<
ExtensionPos
>
{
typedef
struct
PosLookupSubTable
Lookup
SubTable
;
typedef
struct
PosLookupSubTable
SubTable
;
};
...
...
@@ -1498,8 +1498,10 @@ struct PosLookupSubTable
struct
PosLookup
:
Lookup
{
inline
const
PosLookupSubTable
&
get_subtable
(
unsigned
int
i
)
const
{
return
Lookup
::
get_subtable
<
PosLookupSubTable
>
(
i
);
}
typedef
struct
PosLookupSubTable
SubTable
;
inline
const
SubTable
&
get_subtable
(
unsigned
int
i
)
const
{
return
Lookup
::
get_subtable
<
SubTable
>
(
i
);
}
inline
bool
is_reverse
(
void
)
const
{
...
...
@@ -1538,7 +1540,7 @@ struct PosLookup : Lookup
template
<
typename
context_t
>
inline
typename
context_t
::
return_t
dispatch
(
context_t
*
c
)
const
{
return
Lookup
::
dispatch
<
PosLookup
SubTable
>
(
c
);
}
{
return
Lookup
::
dispatch
<
SubTable
>
(
c
);
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
...
...
src/hb-ot-layout-gsub-table.hh
浏览文件 @
9c3747c5
...
...
@@ -980,7 +980,7 @@ struct ChainContextSubst : ChainContext {};
struct
ExtensionSubst
:
Extension
<
ExtensionSubst
>
{
typedef
struct
SubstLookupSubTable
Lookup
SubTable
;
typedef
struct
SubstLookupSubTable
SubTable
;
inline
bool
is_reverse
(
void
)
const
;
};
...
...
@@ -1211,16 +1211,18 @@ struct SubstLookupSubTable
struct
SubstLookup
:
Lookup
{
inline
const
SubstLookupSubTable
&
get_subtable
(
unsigned
int
i
)
const
{
return
Lookup
::
get_subtable
<
SubstLookupSubTable
>
(
i
);
}
typedef
SubstLookupSubTable
SubTable
;
inline
const
SubTable
&
get_subtable
(
unsigned
int
i
)
const
{
return
Lookup
::
get_subtable
<
SubTable
>
(
i
);
}
inline
static
bool
lookup_type_is_reverse
(
unsigned
int
lookup_type
)
{
return
lookup_type
==
Sub
stLookupSub
Table
::
ReverseChainSingle
;
}
{
return
lookup_type
==
SubTable
::
ReverseChainSingle
;
}
inline
bool
is_reverse
(
void
)
const
{
unsigned
int
type
=
get_type
();
if
(
unlikely
(
type
==
Sub
stLookupSub
Table
::
Extension
))
if
(
unlikely
(
type
==
SubTable
::
Extension
))
return
CastR
<
ExtensionSubst
>
(
get_subtable
(
0
)).
is_reverse
();
return
lookup_type_is_reverse
(
type
);
}
...
...
@@ -1277,9 +1279,9 @@ struct SubstLookup : Lookup
static
bool
apply_recurse_func
(
hb_ot_apply_context_t
*
c
,
unsigned
int
lookup_index
);
inline
Sub
stLookupSub
Table
&
serialize_subtable
(
hb_serialize_context_t
*
c
,
unsigned
int
i
)
{
return
get_subtables
<
Sub
stLookupSub
Table
>
()[
i
].
serialize
(
c
,
this
);
}
inline
SubTable
&
serialize_subtable
(
hb_serialize_context_t
*
c
,
unsigned
int
i
)
{
return
get_subtables
<
SubTable
>
()[
i
].
serialize
(
c
,
this
);
}
inline
bool
serialize_single
(
hb_serialize_context_t
*
c
,
uint32_t
lookup_props
,
...
...
@@ -1288,7 +1290,7 @@ struct SubstLookup : Lookup
unsigned
int
num_glyphs
)
{
TRACE_SERIALIZE
(
this
);
if
(
unlikely
(
!
Lookup
::
serialize
(
c
,
Sub
stLookupSub
Table
::
Single
,
lookup_props
,
1
)))
return_trace
(
false
);
if
(
unlikely
(
!
Lookup
::
serialize
(
c
,
SubTable
::
Single
,
lookup_props
,
1
)))
return_trace
(
false
);
return_trace
(
serialize_subtable
(
c
,
0
).
u
.
single
.
serialize
(
c
,
glyphs
,
substitutes
,
num_glyphs
));
}
...
...
@@ -1300,7 +1302,7 @@ struct SubstLookup : Lookup
Supplier
<
GlyphID
>
&
substitute_glyphs_list
)
{
TRACE_SERIALIZE
(
this
);
if
(
unlikely
(
!
Lookup
::
serialize
(
c
,
Sub
stLookupSub
Table
::
Multiple
,
lookup_props
,
1
)))
return_trace
(
false
);
if
(
unlikely
(
!
Lookup
::
serialize
(
c
,
SubTable
::
Multiple
,
lookup_props
,
1
)))
return_trace
(
false
);
return_trace
(
serialize_subtable
(
c
,
0
).
u
.
multiple
.
serialize
(
c
,
glyphs
,
substitute_len_list
,
...
...
@@ -1316,7 +1318,7 @@ struct SubstLookup : Lookup
Supplier
<
GlyphID
>
&
alternate_glyphs_list
)
{
TRACE_SERIALIZE
(
this
);
if
(
unlikely
(
!
Lookup
::
serialize
(
c
,
Sub
stLookupSub
Table
::
Alternate
,
lookup_props
,
1
)))
return_trace
(
false
);
if
(
unlikely
(
!
Lookup
::
serialize
(
c
,
SubTable
::
Alternate
,
lookup_props
,
1
)))
return_trace
(
false
);
return_trace
(
serialize_subtable
(
c
,
0
).
u
.
alternate
.
serialize
(
c
,
glyphs
,
alternate_len_list
,
...
...
@@ -1334,7 +1336,7 @@ struct SubstLookup : Lookup
Supplier
<
GlyphID
>
&
component_list
/* Starting from second for each ligature */
)
{
TRACE_SERIALIZE
(
this
);
if
(
unlikely
(
!
Lookup
::
serialize
(
c
,
Sub
stLookupSub
Table
::
Ligature
,
lookup_props
,
1
)))
return_trace
(
false
);
if
(
unlikely
(
!
Lookup
::
serialize
(
c
,
SubTable
::
Ligature
,
lookup_props
,
1
)))
return_trace
(
false
);
return_trace
(
serialize_subtable
(
c
,
0
).
u
.
ligature
.
serialize
(
c
,
first_glyphs
,
ligature_per_first_glyph_count_list
,
...
...
@@ -1361,7 +1363,12 @@ struct SubstLookup : Lookup
template
<
typename
context_t
>
inline
typename
context_t
::
return_t
dispatch
(
context_t
*
c
)
const
{
return
Lookup
::
dispatch
<
SubstLookupSubTable
>
(
c
);
}
{
return
Lookup
::
dispatch
<
SubTable
>
(
c
);
}
inline
bool
subset
(
hb_subset_context_t
*
c
)
const
{
return
false
;
//XXX
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
...
...
@@ -1369,7 +1376,7 @@ struct SubstLookup : Lookup
if
(
unlikely
(
!
Lookup
::
sanitize
(
c
)))
return_trace
(
false
);
if
(
unlikely
(
!
dispatch
(
c
)))
return_trace
(
false
);
if
(
unlikely
(
get_type
()
==
Sub
stLookupSub
Table
::
Extension
))
if
(
unlikely
(
get_type
()
==
SubTable
::
Extension
))
{
/* The spec says all subtables of an Extension lookup should
* have the same type, which shall not be the Extension type
...
...
@@ -1400,14 +1407,7 @@ struct GSUB : GSUBGPOS
inline
bool
subset
(
hb_subset_context_t
*
c
)
const
{
TRACE_SUBSET
(
this
);
//struct GSUB *out = c->serializer->start_embed<GSUB> ();
if
(
unlikely
(
!
GSUBGPOS
::
subset
(
c
)))
return_trace
(
false
);
//const OffsetTo<SubstLookupList> &list = CastR<const OffsetTo<SubstLookupList> > (lookupList);
//OffsetTo<SubstLookupList> &outList = CastR<OffsetTo<SubstLookupList> > (out->lookupList);
//outList.set (0);
//outList.serialize_subset (c, this+list, out);
/* TODO Use intersects() to count how many subtables survive? */
return_trace
(
true
);
return_trace
(
GSUBGPOS
::
subset
<
SubstLookup
>
(
c
));
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
...
...
@@ -1425,8 +1425,8 @@ struct GSUB : GSUBGPOS
/*static*/
inline
bool
ExtensionSubst
::
is_reverse
(
void
)
const
{
unsigned
int
type
=
get_type
();
if
(
unlikely
(
type
==
Sub
stLookupSub
Table
::
Extension
))
return
CastR
<
ExtensionSubst
>
(
get_subtable
<
Lookup
SubTable
>
()).
is_reverse
();
if
(
unlikely
(
type
==
SubTable
::
Extension
))
return
CastR
<
ExtensionSubst
>
(
get_subtable
<
SubTable
>
()).
is_reverse
();
return
SubstLookup
::
lookup_type_is_reverse
(
type
);
}
...
...
src/hb-ot-layout-gsubgpos.hh
浏览文件 @
9c3747c5
...
...
@@ -2420,8 +2420,8 @@ struct ExtensionFormat1
inline
const
X
&
get_subtable
(
void
)
const
{
unsigned
int
offset
=
extensionOffset
;
if
(
unlikely
(
!
offset
))
return
Null
(
typename
T
::
Lookup
SubTable
);
return
StructAtOffset
<
typename
T
::
Lookup
SubTable
>
(
this
,
offset
);
if
(
unlikely
(
!
offset
))
return
Null
(
typename
T
::
SubTable
);
return
StructAtOffset
<
typename
T
::
SubTable
>
(
this
,
offset
);
}
template
<
typename
context_t
>
...
...
@@ -2429,7 +2429,7 @@ struct ExtensionFormat1
{
TRACE_DISPATCH
(
this
,
format
);
if
(
unlikely
(
!
c
->
may_dispatch
(
this
,
this
)))
return_trace
(
c
->
no_dispatch_return_value
());
return_trace
(
get_subtable
<
typename
T
::
Lookup
SubTable
>
().
dispatch
(
c
,
get_type
()));
return_trace
(
get_subtable
<
typename
T
::
SubTable
>
().
dispatch
(
c
,
get_type
()));
}
/* This is called from may_dispatch() above with hb_sanitize_context_t. */
...
...
@@ -2438,7 +2438,7 @@ struct ExtensionFormat1
TRACE_SANITIZE
(
this
);
return_trace
(
c
->
check_struct
(
this
)
&&
extensionOffset
!=
0
&&
extensionLookupType
!=
T
::
Lookup
SubTable
::
Extension
);
extensionLookupType
!=
T
::
SubTable
::
Extension
);
}
protected:
...
...
@@ -2466,8 +2466,8 @@ struct Extension
inline
const
X
&
get_subtable
(
void
)
const
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
.
template
get_subtable
<
typename
T
::
Lookup
SubTable
>
();
default:
return
Null
(
typename
T
::
Lookup
SubTable
);
case
1
:
return
u
.
format1
.
template
get_subtable
<
typename
T
::
SubTable
>
();
default:
return
Null
(
typename
T
::
SubTable
);
}
}
...
...
@@ -2546,6 +2546,7 @@ struct GSUBGPOS
return
get_feature
(
feature_index
);
}
template
<
typename
TLookup
>
inline
bool
subset
(
hb_subset_context_t
*
c
)
const
{
TRACE_SUBSET
(
this
);
...
...
@@ -2553,7 +2554,14 @@ struct GSUBGPOS
if
(
unlikely
(
!
out
))
return_trace
(
false
);
out
->
scriptList
.
serialize_subset
(
c
,
this
+
scriptList
,
out
);
out
->
featureList
.
serialize_subset
(
c
,
this
+
featureList
,
out
);
out
->
lookupList
.
set
(
0
);
/* GSUB/GPOS fill this one in. */
typedef
OffsetListOf
<
TLookup
>
TLookupList
;
/* TODO Use intersects() to count how many subtables survive? */
CastR
<
OffsetTo
<
TLookupList
>
>
(
out
->
lookupList
)
.
serialize_subset
(
c
,
this
+
CastR
<
const
OffsetTo
<
TLookupList
>
>
(
lookupList
),
out
);
if
(
version
.
to_int
()
>=
0x00010001u
)
out
->
featureVars
.
serialize_subset
(
c
,
this
+
featureVars
,
out
);
return_trace
(
true
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录