Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
d468f9af
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d468f9af
编写于
5月 21, 2009
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[HB] Share Extension lookup code between GSUB and GPOS
上级
498f1909
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
77 addition
and
122 deletion
+77
-122
src/hb-ot-layout-gpos-private.h
src/hb-ot-layout-gpos-private.h
+11
-53
src/hb-ot-layout-gsub-private.h
src/hb-ot-layout-gsub-private.h
+14
-69
src/hb-ot-layout-gsubgpos-private.h
src/hb-ot-layout-gsubgpos-private.h
+52
-0
未找到文件。
src/hb-ot-layout-gpos-private.h
浏览文件 @
d468f9af
...
...
@@ -318,7 +318,6 @@ struct SinglePos
friend
struct
PosLookupSubTable
;
private:
inline
bool
apply
(
APPLY_ARG_DEF
)
const
{
switch
(
u
.
format
)
{
...
...
@@ -507,7 +506,6 @@ struct PairPos
friend
struct
PosLookupSubTable
;
private:
inline
bool
apply
(
APPLY_ARG_DEF
)
const
{
switch
(
u
.
format
)
{
...
...
@@ -734,7 +732,6 @@ struct CursivePos
friend
struct
PosLookupSubTable
;
private:
inline
bool
apply
(
APPLY_ARG_DEF
)
const
{
switch
(
u
.
format
)
{
...
...
@@ -853,7 +850,6 @@ struct MarkBasePos
friend
struct
PosLookupSubTable
;
private:
inline
bool
apply
(
APPLY_ARG_DEF
)
const
{
switch
(
u
.
format
)
{
...
...
@@ -943,7 +939,6 @@ struct MarkLigPos
friend
struct
PosLookupSubTable
;
private:
inline
bool
apply
(
APPLY_ARG_DEF
)
const
{
switch
(
u
.
format
)
{
...
...
@@ -1061,7 +1056,6 @@ struct MarkMarkPos
friend
struct
PosLookupSubTable
;
private:
inline
bool
apply
(
APPLY_ARG_DEF
)
const
{
switch
(
u
.
format
)
{
...
...
@@ -1083,6 +1077,9 @@ static inline bool position_lookup (APPLY_ARG_DEF, unsigned int lookup_index);
struct
ContextPos
:
Context
{
friend
struct
PosLookupSubTable
;
private:
inline
bool
apply
(
APPLY_ARG_DEF
)
const
{
return
Context
::
apply
(
APPLY_ARG
,
position_lookup
);
...
...
@@ -1092,6 +1089,9 @@ ASSERT_SIZE (ContextPos, 2);
struct
ChainContextPos
:
ChainContext
{
friend
struct
PosLookupSubTable
;
private:
inline
bool
apply
(
APPLY_ARG_DEF
)
const
{
return
ChainContext
::
apply
(
APPLY_ARG
,
position_lookup
);
...
...
@@ -1100,59 +1100,17 @@ struct ChainContextPos : ChainContext
ASSERT_SIZE
(
ChainContextPos
,
2
);
struct
ExtensionPosFormat1
{
friend
struct
ExtensionPos
;
private:
inline
unsigned
int
get_type
(
void
)
const
{
return
extensionLookupType
;
}
inline
unsigned
int
get_offset
(
void
)
const
{
return
(
extensionOffset
[
0
]
<<
16
)
+
extensionOffset
[
1
];
}
inline
bool
apply
(
APPLY_ARG_DEF
)
const
;
private:
USHORT
format
;
/* Format identifier. Set to 1. */
USHORT
extensionLookupType
;
/* Lookup type of subtable referenced
* by ExtensionOffset (i.e. the
* extension subtable). */
USHORT
extensionOffset
[
2
];
/* Offset to the extension subtable,
* of lookup type subtable.
* Defined as two shorts to avoid
* alignment requirements. */
};
ASSERT_SIZE
(
ExtensionPosFormat1
,
8
);
struct
ExtensionPos
struct
ExtensionPos
:
Extension
{
friend
struct
PosLookup
;
friend
struct
PosLookupSubTable
;
private:
inline
unsigned
int
get_type
(
void
)
const
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
->
get_type
();
default:
return
0
;
}
}
inline
bool
apply
(
APPLY_ARG_DEF
)
const
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
->
apply
(
APPLY_ARG
);
default:
return
false
;
}
}
private:
union
{
USHORT
format
;
/* Format identifier */
ExtensionPosFormat1
format1
[];
}
u
;
inline
bool
apply
(
APPLY_ARG_DEF
)
const
;
};
ASSERT_SIZE
(
ExtensionPos
,
2
);
/*
* PosLookup
*/
...
...
@@ -1329,14 +1287,14 @@ ASSERT_SIZE (GPOS, 10);
/* Out-of-class implementation for methods recursing */
inline
bool
ExtensionPos
Format1
::
apply
(
APPLY_ARG_DEF
)
const
inline
bool
ExtensionPos
::
apply
(
APPLY_ARG_DEF
)
const
{
unsigned
int
lookup_type
=
get_type
();
if
(
HB_UNLIKELY
(
lookup_type
==
PosLookupSubTable
::
Extension
))
return
false
;
return
((
PosLookupSubTable
&
)
*
(((
char
*
)
this
)
+
get_offset
()
)).
apply
(
APPLY_ARG
,
lookup_type
);
return
((
PosLookupSubTable
&
)
get_subtable
(
)).
apply
(
APPLY_ARG
,
lookup_type
);
}
static
inline
bool
position_lookup
(
APPLY_ARG_DEF
,
unsigned
int
lookup_index
)
...
...
src/hb-ot-layout-gsub-private.h
浏览文件 @
d468f9af
...
...
@@ -45,7 +45,6 @@ struct SingleSubstFormat1
friend
struct
SingleSubst
;
private:
inline
bool
apply
(
APPLY_ARG_DEF
)
const
{
hb_codepoint_t
glyph_id
=
IN_CURGLYPH
();
...
...
@@ -80,7 +79,6 @@ struct SingleSubstFormat2
friend
struct
SingleSubst
;
private:
inline
bool
apply
(
APPLY_ARG_DEF
)
const
{
hb_codepoint_t
glyph_id
=
IN_CURGLYPH
();
...
...
@@ -119,7 +117,6 @@ struct SingleSubst
friend
struct
SubstLookupSubTable
;
private:
inline
bool
apply
(
APPLY_ARG_DEF
)
const
{
switch
(
u
.
format
)
{
...
...
@@ -144,14 +141,6 @@ struct Sequence
friend
struct
MultipleSubstFormat1
;
private:
inline
void
set_glyph_class
(
hb_ot_layout_t
*
layout
,
unsigned
int
property
)
const
{
unsigned
int
count
=
substitute
.
len
;
for
(
unsigned
int
n
=
0
;
n
<
count
;
n
++
)
_hb_ot_layout_set_glyph_property
(
layout
,
substitute
[
n
],
property
);
}
inline
bool
apply
(
APPLY_ARG_DEF
)
const
{
if
(
HB_UNLIKELY
(
!
substitute
.
len
))
...
...
@@ -164,11 +153,12 @@ struct Sequence
if
(
_hb_ot_layout_has_new_glyph_classes
(
layout
)
)
{
/* this is a guess only ... */
if
(
property
==
HB_OT_LAYOUT_GLYPH_CLASS_LIGATURE
)
property
=
HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH
;
set_glyph_class
(
layout
,
property
);
unsigned
int
count
=
substitute
.
len
;
for
(
unsigned
int
n
=
0
;
n
<
count
;
n
++
)
_hb_ot_layout_set_glyph_property
(
layout
,
substitute
[
n
],
property
);
}
return
true
;
...
...
@@ -185,7 +175,6 @@ struct MultipleSubstFormat1
friend
struct
MultipleSubst
;
private:
inline
bool
apply
(
APPLY_ARG_DEF
)
const
{
...
...
@@ -212,7 +201,6 @@ struct MultipleSubst
friend
struct
SubstLookupSubTable
;
private:
inline
bool
apply
(
APPLY_ARG_DEF
)
const
{
switch
(
u
.
format
)
{
...
...
@@ -239,7 +227,6 @@ struct AlternateSubstFormat1
friend
struct
AlternateSubst
;
private:
inline
bool
apply
(
APPLY_ARG_DEF
)
const
{
hb_codepoint_t
glyph_id
=
IN_CURGLYPH
();
...
...
@@ -294,7 +281,6 @@ struct AlternateSubst
friend
struct
SubstLookupSubTable
;
private:
inline
bool
apply
(
APPLY_ARG_DEF
)
const
{
switch
(
u
.
format
)
{
...
...
@@ -397,7 +383,6 @@ struct LigatureSet
friend
struct
LigatureSubstFormat1
;
private:
inline
bool
apply
(
APPLY_ARG_DEF
,
bool
is_mark
)
const
{
unsigned
int
num_ligs
=
ligature
.
len
;
...
...
@@ -423,7 +408,6 @@ struct LigatureSubstFormat1
friend
struct
LigatureSubst
;
private:
inline
bool
apply
(
APPLY_ARG_DEF
)
const
{
hb_codepoint_t
glyph_id
=
IN_CURGLYPH
();
...
...
@@ -455,7 +439,6 @@ struct LigatureSubst
friend
struct
SubstLookupSubTable
;
private:
inline
bool
apply
(
APPLY_ARG_DEF
)
const
{
switch
(
u
.
format
)
{
...
...
@@ -478,6 +461,9 @@ static inline bool substitute_lookup (APPLY_ARG_DEF, unsigned int lookup_index);
struct
ContextSubst
:
Context
{
friend
struct
SubstLookupSubTable
;
private:
inline
bool
apply
(
APPLY_ARG_DEF
)
const
{
return
Context
::
apply
(
APPLY_ARG
,
substitute_lookup
);
...
...
@@ -487,6 +473,9 @@ ASSERT_SIZE (ContextSubst, 2);
struct
ChainContextSubst
:
ChainContext
{
friend
struct
SubstLookupSubTable
;
private:
inline
bool
apply
(
APPLY_ARG_DEF
)
const
{
return
ChainContext
::
apply
(
APPLY_ARG
,
substitute_lookup
);
...
...
@@ -495,55 +484,12 @@ struct ChainContextSubst : ChainContext
ASSERT_SIZE
(
ChainContextSubst
,
2
);
struct
ExtensionSubstFormat1
{
friend
struct
ExtensionSubst
;
private:
inline
unsigned
int
get_type
(
void
)
const
{
return
extensionLookupType
;
}
inline
unsigned
int
get_offset
(
void
)
const
{
return
(
extensionOffset
[
0
]
<<
16
)
+
extensionOffset
[
1
];
}
inline
bool
apply
(
APPLY_ARG_DEF
)
const
;
private:
USHORT
format
;
/* Format identifier. Set to 1. */
USHORT
extensionLookupType
;
/* Lookup type of subtable referenced
* by ExtensionOffset (i.e. the
* extension subtable). */
USHORT
extensionOffset
[
2
];
/* Offset to the extension subtable,
* of lookup type subtable.
* Defined as two shorts to avoid
* alignment requirements. */
};
ASSERT_SIZE
(
ExtensionSubstFormat1
,
8
);
struct
ExtensionSubst
struct
ExtensionSubst
:
Extension
{
friend
struct
SubstLookup
;
friend
struct
SubstLookupSubTable
;
private:
inline
unsigned
int
get_type
(
void
)
const
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
->
get_type
();
default:
return
0
;
}
}
inline
bool
apply
(
APPLY_ARG_DEF
)
const
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
->
apply
(
APPLY_ARG
);
default:
return
false
;
}
}
private:
union
{
USHORT
format
;
/* Format identifier */
ExtensionSubstFormat1
format1
[];
}
u
;
inline
bool
apply
(
APPLY_ARG_DEF
)
const
;
};
ASSERT_SIZE
(
ExtensionSubst
,
2
);
...
...
@@ -607,7 +553,6 @@ struct ReverseChainSingleSubst
friend
struct
SubstLookupSubTable
;
private:
inline
bool
apply
(
APPLY_ARG_DEF
)
const
{
switch
(
u
.
format
)
{
...
...
@@ -815,14 +760,14 @@ ASSERT_SIZE (GSUB, 10);
/* Out-of-class implementation for methods recursing */
inline
bool
ExtensionSubst
Format1
::
apply
(
APPLY_ARG_DEF
)
const
inline
bool
ExtensionSubst
::
apply
(
APPLY_ARG_DEF
)
const
{
unsigned
int
lookup_type
=
get_type
();
if
(
HB_UNLIKELY
(
lookup_type
==
SubstLookupSubTable
::
Extension
))
if
(
HB_UNLIKELY
(
lookup_type
==
SubstLookupSubTable
::
Extension
))
return
false
;
return
((
SubstLookupSubTable
&
)
*
(((
char
*
)
this
)
+
get_offset
()
)).
apply
(
APPLY_ARG
,
lookup_type
);
return
((
SubstLookupSubTable
&
)
get_subtable
(
)).
apply
(
APPLY_ARG
,
lookup_type
);
}
static
inline
bool
substitute_lookup
(
APPLY_ARG_DEF
,
unsigned
int
lookup_index
)
...
...
src/hb-ot-layout-gsubgpos-private.h
浏览文件 @
d468f9af
...
...
@@ -686,6 +686,58 @@ struct ChainContext
ASSERT_SIZE
(
ChainContext
,
2
);
struct
ExtensionFormat1
{
friend
struct
Extension
;
private:
inline
unsigned
int
get_type
(
void
)
const
{
return
extensionLookupType
;
}
inline
unsigned
int
get_offset
(
void
)
const
{
return
(
extensionOffset
[
0
]
<<
16
)
+
extensionOffset
[
1
];
}
inline
const
LookupSubTable
&
get_subtable
(
void
)
const
{
unsigned
int
offset
=
get_offset
();
if
(
HB_UNLIKELY
(
!
offset
))
return
Null
(
LookupSubTable
);
return
(
LookupSubTable
&
)
*
(((
char
*
)
this
)
+
offset
);
}
private:
USHORT
format
;
/* Format identifier. Set to 1. */
USHORT
extensionLookupType
;
/* Lookup type of subtable referenced
* by ExtensionOffset (i.e. the
* extension subtable). */
USHORT
extensionOffset
[
2
];
/* Offset to the extension subtable,
* of lookup type subtable.
* Defined as two shorts to avoid
* alignment requirements. */
};
ASSERT_SIZE
(
ExtensionFormat1
,
8
);
struct
Extension
{
inline
unsigned
int
get_type
(
void
)
const
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
->
get_type
();
default:
return
0
;
}
}
inline
const
LookupSubTable
&
get_subtable
(
void
)
const
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
->
get_subtable
();
default:
return
Null
(
LookupSubTable
);
}
}
private:
union
{
USHORT
format
;
/* Format identifier */
ExtensionFormat1
format1
[];
}
u
;
};
ASSERT_SIZE
(
Extension
,
2
);
/*
* GSUB/GPOS Common
*/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录