Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
f8dc67b3
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看板
提交
f8dc67b3
编写于
5月 17, 2009
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[HB] Cleanup format unions
上级
da1097bc
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
77 addition
and
85 deletion
+77
-85
src/hb-ot-layout-gdef-private.h
src/hb-ot-layout-gdef-private.h
+9
-9
src/hb-ot-layout-gsub-private.h
src/hb-ot-layout-gsub-private.h
+45
-42
src/hb-ot-layout-gsubgpos-private.h
src/hb-ot-layout-gsubgpos-private.h
+8
-8
src/hb-ot-layout-open-private.h
src/hb-ot-layout-open-private.h
+15
-26
未找到文件。
src/hb-ot-layout-gdef-private.h
浏览文件 @
f8dc67b3
...
...
@@ -129,23 +129,23 @@ ASSERT_SIZE (CaretValueFormat3, 6);
struct
CaretValue
{
/* XXX we need access to a load-contour-point vfunc here */
int
get_caret_value
(
int
ppem
)
const
{
switch
(
u
.
caretValueF
ormat
)
{
case
1
:
return
u
.
format1
.
get_caret_value
(
ppem
);
case
2
:
return
u
.
format2
.
get_caret_value
(
ppem
);
case
3
:
return
u
.
format3
.
get_caret_value
(
ppem
);
switch
(
u
.
f
ormat
)
{
case
1
:
return
u
.
format1
->
get_caret_value
(
ppem
);
case
2
:
return
u
.
format2
->
get_caret_value
(
ppem
);
case
3
:
return
u
.
format3
->
get_caret_value
(
ppem
);
default:
return
0
;
}
}
private:
union
{
USHORT
caretValueFormat
;
/* Format identifier */
CaretValueFormat1
format1
;
CaretValueFormat2
format2
;
CaretValueFormat3
format3
;
USHORT
format
;
/* Format identifier */
CaretValueFormat1
format1
[]
;
CaretValueFormat2
format2
[]
;
CaretValueFormat3
format3
[]
;
}
u
;
};
DEFINE_NULL
(
CaretValue
,
2
);
ASSERT_SIZE
(
CaretValue
,
2
);
struct
LigGlyph
{
...
...
src/hb-ot-layout-gsub-private.h
浏览文件 @
f8dc67b3
...
...
@@ -91,9 +91,9 @@ struct SingleSubst {
private:
inline
bool
single_substitute
(
hb_codepoint_t
&
glyph_id
)
const
{
switch
(
u
.
substF
ormat
)
{
case
1
:
return
u
.
format1
.
single_substitute
(
glyph_id
);
case
2
:
return
u
.
format2
.
single_substitute
(
glyph_id
);
switch
(
u
.
f
ormat
)
{
case
1
:
return
u
.
format1
->
single_substitute
(
glyph_id
);
case
2
:
return
u
.
format2
->
single_substitute
(
glyph_id
);
default:
return
false
;
}
}
...
...
@@ -118,12 +118,12 @@ struct SingleSubst {
private:
union
{
USHORT
substFormat
;
/* Format identifier */
SingleSubstFormat1
format1
;
SingleSubstFormat2
format2
;
USHORT
format
;
/* Format identifier */
SingleSubstFormat1
format1
[]
;
SingleSubstFormat2
format2
[]
;
}
u
;
};
DEFINE_NULL
(
SingleSubst
,
2
);
ASSERT_SIZE
(
SingleSubst
,
2
);
struct
Sequence
{
...
...
@@ -197,19 +197,19 @@ struct MultipleSubst {
private:
inline
bool
substitute
(
LOOKUP_ARGS_DEF
)
const
{
switch
(
u
.
substF
ormat
)
{
case
1
:
return
u
.
format1
.
substitute
(
LOOKUP_ARGS
);
switch
(
u
.
f
ormat
)
{
case
1
:
return
u
.
format1
->
substitute
(
LOOKUP_ARGS
);
default:
return
false
;
}
}
private:
union
{
USHORT
substFormat
;
/* Format identifier */
MultipleSubstFormat1
format1
;
USHORT
format
;
/* Format identifier */
MultipleSubstFormat1
format1
[]
;
}
u
;
};
DEFINE_NULL
(
MultipleSubst
,
2
);
ASSERT_SIZE
(
MultipleSubst
,
2
);
typedef
ArrayOf
<
GlyphID
>
AlternateSet
;
/* Array of alternate GlyphIDs--in
...
...
@@ -275,19 +275,19 @@ struct AlternateSubst {
private:
inline
bool
substitute
(
LOOKUP_ARGS_DEF
)
const
{
switch
(
u
.
substF
ormat
)
{
case
1
:
return
u
.
format1
.
substitute
(
LOOKUP_ARGS
);
switch
(
u
.
f
ormat
)
{
case
1
:
return
u
.
format1
->
substitute
(
LOOKUP_ARGS
);
default:
return
false
;
}
}
private:
union
{
USHORT
substFormat
;
/* Format identifier */
AlternateSubstFormat1
format1
;
USHORT
format
;
/* Format identifier */
AlternateSubstFormat1
format1
[]
;
}
u
;
};
DEFINE_NULL
(
AlternateSubst
,
2
);
ASSERT_SIZE
(
AlternateSubst
,
2
);
struct
Ligature
{
...
...
@@ -432,19 +432,19 @@ struct LigatureSubst {
private:
inline
bool
substitute
(
LOOKUP_ARGS_DEF
)
const
{
switch
(
u
.
substF
ormat
)
{
case
1
:
return
u
.
format1
.
substitute
(
LOOKUP_ARGS
);
switch
(
u
.
f
ormat
)
{
case
1
:
return
u
.
format1
->
substitute
(
LOOKUP_ARGS
);
default:
return
false
;
}
}
private:
union
{
USHORT
substFormat
;
/* Format identifier */
LigatureSubstFormat1
format1
;
USHORT
format
;
/* Format identifier */
LigatureSubstFormat1
format1
[]
;
}
u
;
};
DEFINE_NULL
(
LigatureSubst
,
2
);
ASSERT_SIZE
(
LigatureSubst
,
2
);
...
...
@@ -456,7 +456,7 @@ struct ContextSubst : Context {
return
this
->
apply
(
LOOKUP_ARGS
,
substitute_lookup
);
}
};
DEFINE_NULL
(
ContextSubst
,
2
);
ASSERT_SIZE
(
ContextSubst
,
2
);
struct
ChainSubRule
{
...
...
@@ -622,23 +622,23 @@ struct ChainContextSubst {
private:
inline
bool
substitute
(
LOOKUP_ARGS_DEF
)
const
{
switch
(
u
.
substF
ormat
)
{
case
1
:
return
u
.
format1
.
substitute
(
LOOKUP_ARGS
);
case
2
:
return
u
.
format2
.
substitute
(
LOOKUP_ARGS
);
case
3
:
return
u
.
format3
.
substitute
(
LOOKUP_ARGS
);
switch
(
u
.
f
ormat
)
{
case
1
:
return
u
.
format1
->
substitute
(
LOOKUP_ARGS
);
case
2
:
return
u
.
format2
->
substitute
(
LOOKUP_ARGS
);
case
3
:
return
u
.
format3
->
substitute
(
LOOKUP_ARGS
);
default:
return
false
;
}
}
private:
union
{
USHORT
substF
ormat
;
/* Format identifier */
ChainContextSubstFormat1
format1
;
ChainContextSubstFormat2
format2
;
ChainContextSubstFormat3
format3
;
USHORT
f
ormat
;
/* Format identifier */
ChainContextSubstFormat1
format1
[]
;
ChainContextSubstFormat2
format2
[]
;
ChainContextSubstFormat3
format3
[]
;
}
u
;
};
DEFINE_NULL
(
ChainContextSubst
,
2
);
ASSERT_SIZE
(
ChainContextSubst
,
2
);
struct
ExtensionSubstFormat1
{
...
...
@@ -647,6 +647,7 @@ struct ExtensionSubstFormat1 {
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
substitute
(
LOOKUP_ARGS_DEF
)
const
;
private:
...
...
@@ -654,8 +655,10 @@ struct ExtensionSubstFormat1 {
USHORT
extensionLookupType
;
/* Lookup type of subtable referenced
* by ExtensionOffset (i.e. the
* extension subtable). */
ULONG
extensionOffset
;
/* Offset to the extension subtable,
* of lookup type 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
);
...
...
@@ -667,26 +670,26 @@ struct ExtensionSubst {
private:
inline
unsigned
int
get_type
(
void
)
const
{
switch
(
u
.
substF
ormat
)
{
case
1
:
return
u
.
format1
.
get_type
();
switch
(
u
.
f
ormat
)
{
case
1
:
return
u
.
format1
->
get_type
();
default:
return
0
;
}
}
inline
bool
substitute
(
LOOKUP_ARGS_DEF
)
const
{
switch
(
u
.
substF
ormat
)
{
case
1
:
return
u
.
format1
.
substitute
(
LOOKUP_ARGS
);
switch
(
u
.
f
ormat
)
{
case
1
:
return
u
.
format1
->
substitute
(
LOOKUP_ARGS
);
default:
return
false
;
}
}
private:
union
{
USHORT
substFormat
;
/* Format identifier */
ExtensionSubstFormat1
format1
;
USHORT
format
;
/* Format identifier */
ExtensionSubstFormat1
format1
[]
;
}
u
;
};
DEFINE_NULL
(
ExtensionSubst
,
2
);
ASSERT_SIZE
(
ExtensionSubst
,
2
);
...
...
@@ -905,7 +908,7 @@ struct GSUB : GSUBGPOS {
inline
bool
ExtensionSubstFormat1
::
substitute
(
LOOKUP_ARGS_DEF
)
const
{
/* XXX either check in sanitize or here that the lookuptype is not 7 again,
* or we can loop indefinitely. */
return
(
*
(
SubstLookupSubTable
*
)(((
char
*
)
this
)
+
extensionOffset
)).
substitute
(
LOOKUP_ARGS
,
return
(
*
(
SubstLookupSubTable
*
)(((
char
*
)
this
)
+
get_offset
()
)).
substitute
(
LOOKUP_ARGS
,
get_type
());
}
...
...
src/hb-ot-layout-gsubgpos-private.h
浏览文件 @
f8dc67b3
...
...
@@ -315,22 +315,22 @@ struct Context {
protected:
bool
apply
(
LOOKUP_ARGS_DEF
,
apply_lookup_func_t
apply_func
)
const
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
.
apply
(
LOOKUP_ARGS
,
apply_func
);
case
2
:
return
u
.
format2
.
apply
(
LOOKUP_ARGS
,
apply_func
);
case
3
:
return
u
.
format3
.
apply
(
LOOKUP_ARGS
,
apply_func
);
case
1
:
return
u
.
format1
->
apply
(
LOOKUP_ARGS
,
apply_func
);
case
2
:
return
u
.
format2
->
apply
(
LOOKUP_ARGS
,
apply_func
);
case
3
:
return
u
.
format3
->
apply
(
LOOKUP_ARGS
,
apply_func
);
default:
return
false
;
}
}
private:
union
{
USHORT
format
;
/* Format identifier */
ContextFormat1
format1
;
ContextFormat2
format2
;
ContextFormat3
format3
;
USHORT
format
;
/* Format identifier */
ContextFormat1
format1
[]
;
ContextFormat2
format2
[]
;
ContextFormat3
format3
[]
;
}
u
;
};
DEFINE_NULL
(
Context
,
2
);
ASSERT_SIZE
(
Context
,
2
);
#endif
/* HB_OT_LAYOUT_GSUBGPOS_PRIVATE_H */
src/hb-ot-layout-open-private.h
浏览文件 @
f8dc67b3
...
...
@@ -167,22 +167,11 @@ static const char NullPool[16] = "";
/* Generic template for nul-content sizeof-sized Null objects. */
template
<
typename
Type
>
struct
NullSize
{
char
bytes
[
sizeof
(
Type
)];
};
template
<
typename
Type
>
struct
Null
{
ASSERT_STATIC
(
sizeof
(
NullSize
<
Type
>
)
<=
sizeof
(
NullPool
));
ASSERT_STATIC
(
sizeof
(
Type
)
<=
sizeof
(
NullPool
));
static
inline
const
Type
&
get
()
{
return
(
const
Type
&
)
*
(
const
Type
*
)
NullPool
;
}
};
/* Specializaiton for nul-content arbitrary-sized Null objects. */
#define DEFINE_NULL(Type, size) \
template <> \
struct NullSize <Type> { \
char bytes[size]; \
}
/* Specializaiton for arbitrary-content arbitrary-sized Null objects. */
#define DEFINE_NULL_DATA(Type, size, data) \
template <> \
...
...
@@ -785,9 +774,9 @@ ASSERT_SIZE (CoverageFormat2, 4);
struct
Coverage
{
unsigned
int
get_coverage
(
hb_codepoint_t
glyph_id
)
const
{
switch
(
u
.
coverageF
ormat
)
{
case
1
:
return
u
.
format1
.
get_coverage
(
glyph_id
);
case
2
:
return
u
.
format2
.
get_coverage
(
glyph_id
);
switch
(
u
.
f
ormat
)
{
case
1
:
return
u
.
format1
->
get_coverage
(
glyph_id
);
case
2
:
return
u
.
format2
->
get_coverage
(
glyph_id
);
default:
return
NOT_COVERED
;
}
}
...
...
@@ -798,12 +787,12 @@ struct Coverage {
private:
union
{
USHORT
coverageFormat
;
/* Format identifier */
CoverageFormat1
format1
;
CoverageFormat2
format2
;
USHORT
format
;
/* Format identifier */
CoverageFormat1
format1
[]
;
CoverageFormat2
format2
[]
;
}
u
;
};
DEFINE_NULL
(
Coverage
,
2
);
ASSERT_SIZE
(
Coverage
,
2
);
/*
* Class Definition Table
...
...
@@ -870,21 +859,21 @@ ASSERT_SIZE (ClassDefFormat2, 4);
struct
ClassDef
{
hb_ot_layout_class_t
get_class
(
hb_codepoint_t
glyph_id
)
const
{
switch
(
u
.
classF
ormat
)
{
case
1
:
return
u
.
format1
.
get_class
(
glyph_id
);
case
2
:
return
u
.
format2
.
get_class
(
glyph_id
);
switch
(
u
.
f
ormat
)
{
case
1
:
return
u
.
format1
->
get_class
(
glyph_id
);
case
2
:
return
u
.
format2
->
get_class
(
glyph_id
);
default:
return
0
;
}
}
private:
union
{
USHORT
classFormat
;
/* Format identifier */
ClassDefFormat1
format1
;
ClassDefFormat2
format2
;
USHORT
format
;
/* Format identifier */
ClassDefFormat1
format1
[]
;
ClassDefFormat2
format2
[]
;
}
u
;
};
DEFINE_NULL
(
ClassDef
,
2
);
ASSERT_SIZE
(
ClassDef
,
2
);
/*
* Device Tables
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录