Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
569da92b
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
接近 2 年 前同步成功
通知
1
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看板
提交
569da92b
编写于
5月 10, 2010
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Cleanup ASSERT_SIZE_VAR
上级
99bf0345
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
49 addition
and
39 deletion
+49
-39
src/hb-open-file-private.hh
src/hb-open-file-private.hh
+6
-3
src/hb-open-type-private.hh
src/hb-open-type-private.hh
+4
-2
src/hb-ot-layout-common-private.hh
src/hb-ot-layout-common-private.hh
+12
-10
src/hb-ot-layout-gdef-private.hh
src/hb-ot-layout-gdef-private.hh
+2
-1
src/hb-ot-layout-gpos-private.hh
src/hb-ot-layout-gpos-private.hh
+19
-11
src/hb-ot-layout-gsubgpos-private.hh
src/hb-ot-layout-gsubgpos-private.hh
+6
-4
src/hb-private.h
src/hb-private.h
+0
-8
未找到文件。
src/hb-open-file-private.hh
浏览文件 @
569da92b
...
...
@@ -45,6 +45,7 @@ struct OpenTypeFontFile;
struct
OffsetTable
;
struct
TTCHeader
;
typedef
struct
TableDirectory
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
context
)
{
...
...
@@ -52,13 +53,13 @@ typedef struct TableDirectory
return
context
->
check_struct
(
this
);
}
DEFINE_SIZE_STATIC
(
16
);
Tag
tag
;
/* 4-byte identifier. */
CheckSum
checkSum
;
/* CheckSum for this table. */
ULONG
offset
;
/* Offset from beginning of TrueType font
* file. */
ULONG
length
;
/* Length of this table. */
public:
DEFINE_SIZE_STATIC
(
16
);
}
OpenTypeTable
;
typedef
struct
OffsetTable
...
...
@@ -110,8 +111,10 @@ typedef struct OffsetTable
USHORT
entrySelector
;
/* Log2(maximum power of 2 <= numTables). */
USHORT
rangeShift
;
/* NumTables x 16-searchRange. */
TableDirectory
tableDir
[
VAR
];
/* TableDirectory entries. numTables items */
public:
DEFINE_SIZE_VAR
(
12
,
TableDirectory
);
}
OpenTypeFontFace
;
ASSERT_SIZE_VAR
(
OffsetTable
,
12
,
TableDirectory
);
/*
* TrueType Collections
...
...
src/hb-open-type-private.hh
浏览文件 @
569da92b
...
...
@@ -101,7 +101,7 @@ inline Type& StructAfter(TObject &X)
{ ASSERT_STATIC (sizeof (*this) == (size) + VAR0 * sizeof (_var_type)); } \
static const unsigned int min_size = (size)
#define DEFINE_SIZE_VAR2(
_type,
size, _var_type1, _var_type2) \
#define DEFINE_SIZE_VAR2(size, _var_type1, _var_type2) \
inline void _size_assertion (void) const \
{ ASSERT_STATIC (sizeof (*this) == (size) + VAR0 * sizeof (_var_type1) + VAR0 * sizeof (_var_type2)); } \
static const unsigned int min_size = (size)
...
...
@@ -379,8 +379,10 @@ struct IntType
TRACE_SANITIZE
();
return
context
->
check_struct
(
this
);
}
private:
BEInt
<
Type
,
sizeof
(
Type
)
>
v
;
public:
DEFINE_SIZE_STATIC
(
sizeof
(
Type
));
private:
BEInt
<
Type
,
sizeof
(
Type
)
>
v
;
};
typedef
IntType
<
uint16_t
>
USHORT
;
/* 16-bit unsigned integer. */
...
...
src/hb-ot-layout-common-private.hh
浏览文件 @
569da92b
...
...
@@ -57,12 +57,12 @@ struct Record
&&
offset
.
sanitize
(
context
,
base
);
}
DEFINE_SIZE_STATIC
(
6
);
Tag
tag
;
/* 4-byte Tag identifier */
OffsetTo
<
Type
>
offset
;
/* Offset from beginning of object holding
* the Record */
public:
DEFINE_SIZE_STATIC
(
6
);
};
template
<
typename
Type
>
...
...
@@ -170,14 +170,14 @@ struct LangSys
&&
featureIndex
.
sanitize
(
context
);
}
DEFINE_SIZE_STATIC
(
6
);
Offset
lookupOrder
;
/* = Null (reserved for an offset to a
* reordering table) */
USHORT
reqFeatureIndex
;
/* Index of a feature required for this
* language system--if no required features
* = 0xFFFF */
IndexArray
featureIndex
;
/* Array of indices into the FeatureList */
public:
DEFINE_SIZE_STATIC
(
6
);
};
DEFINE_NULL_DATA
(
LangSys
,
"
\0\0\xFF\xFF
"
);
...
...
@@ -305,8 +305,9 @@ struct Lookup
USHORT
markFilteringSetX
[
VAR
];
/* Index (base 0) into GDEF mark glyph sets
* structure. This field is only present if bit
* UseMarkFilteringSet of lookup flags is set. */
public:
DEFINE_SIZE_VAR
(
6
,
USHORT
);
};
ASSERT_SIZE_VAR
(
Lookup
,
6
,
USHORT
);
typedef
OffsetListOf
<
Lookup
>
LookupList
;
ASSERT_SIZE
(
LookupList
,
2
);
...
...
@@ -365,13 +366,13 @@ struct CoverageRangeRecord
return
context
->
check_struct
(
this
);
}
DEFINE_SIZE_STATIC
(
6
);
private:
GlyphID
start
;
/* First GlyphID in the range */
GlyphID
end
;
/* Last GlyphID in the range */
USHORT
startCoverageIndex
;
/* Coverage Index of first GlyphID in
* range */
public:
DEFINE_SIZE_STATIC
(
6
);
};
DEFINE_NULL_DATA
(
CoverageRangeRecord
,
"
\000\001
"
);
...
...
@@ -486,12 +487,12 @@ struct ClassRangeRecord
return
context
->
check_struct
(
this
);
}
DEFINE_SIZE_STATIC
(
6
);
private:
GlyphID
start
;
/* First GlyphID in the range */
GlyphID
end
;
/* Last GlyphID in the range */
USHORT
classValue
;
/* Applied to all glyphs in the range */
public:
DEFINE_SIZE_STATIC
(
6
);
};
DEFINE_NULL_DATA
(
ClassRangeRecord
,
"
\000\001
"
);
...
...
@@ -610,8 +611,9 @@ struct Device
* 3 Signed 8-bit value, 2 values per uint16
*/
USHORT
deltaValue
[
VAR
];
/* Array of compressed data */
public:
DEFINE_SIZE_VAR
(
6
,
USHORT
);
};
ASSERT_SIZE_VAR
(
Device
,
6
,
USHORT
);
#endif
/* HB_OT_LAYOUT_COMMON_PRIVATE_HH */
src/hb-ot-layout-gdef-private.hh
浏览文件 @
569da92b
...
...
@@ -383,8 +383,9 @@ struct GDEF
* definitions--from beginning of GDEF
* header (may be NULL). Introduced
* in version 00010002. */
public:
DEFINE_SIZE_VAR
(
12
,
OffsetTo
<
MarkGlyphSets
>
);
};
ASSERT_SIZE_VAR
(
GDEF
,
12
,
OffsetTo
<
MarkGlyphSets
>
);
#endif
/* HB_OT_LAYOUT_GDEF_PRIVATE_HH */
src/hb-ot-layout-gpos-private.hh
浏览文件 @
569da92b
...
...
@@ -41,7 +41,6 @@
typedef
USHORT
Value
;
typedef
Value
ValueRecord
[
VAR0
];
ASSERT_SIZE_VAR
(
ValueRecord
,
0
,
Value
);
struct
ValueFormat
:
USHORT
{
...
...
@@ -360,8 +359,9 @@ struct AnchorMatrix
OffsetTo
<
Anchor
>
matrix
[
VAR
];
/* Matrix of offsets to Anchor tables--
* from beginning of AnchorMatrix table */
public:
DEFINE_SIZE_VAR
(
2
,
OffsetTo
<
Anchor
>
);
};
ASSERT_SIZE_VAR
(
AnchorMatrix
,
2
,
OffsetTo
<
Anchor
>
);
struct
MarkRecord
...
...
@@ -374,13 +374,13 @@ struct MarkRecord
&&
markAnchor
.
sanitize
(
context
,
base
);
}
DEFINE_SIZE_STATIC
(
4
);
private:
USHORT
klass
;
/* Class defined for this mark */
OffsetTo
<
Anchor
>
markAnchor
;
/* Offset to Anchor table--from
* beginning of MarkArray table */
public:
DEFINE_SIZE_STATIC
(
4
);
};
struct
MarkArray
...
...
@@ -462,8 +462,9 @@ struct SinglePosFormat1
ValueRecord
values
;
/* Defines positioning
* value(s)--applied to all glyphs in
* the Coverage table */
public:
DEFINE_SIZE_VAR
(
6
,
ValueRecord
);
};
ASSERT_SIZE_VAR
(
SinglePosFormat1
,
6
,
ValueRecord
);
struct
SinglePosFormat2
{
...
...
@@ -505,8 +506,9 @@ struct SinglePosFormat2
USHORT
valueCount
;
/* Number of ValueRecords */
ValueRecord
values
;
/* Array of ValueRecords--positioning
* values applied to glyphs */
public:
DEFINE_SIZE_VAR
(
8
,
ValueRecord
);
};
ASSERT_SIZE_VAR
(
SinglePosFormat2
,
8
,
ValueRecord
);
struct
SinglePos
{
...
...
@@ -552,8 +554,9 @@ struct PairValueRecord
* Coverage table */
ValueRecord
values
;
/* Positioning data for the first glyph
* followed by for second glyph */
public:
DEFINE_SIZE_VAR
(
2
,
ValueRecord
);
};
ASSERT_SIZE_VAR
(
PairValueRecord
,
2
,
ValueRecord
);
struct
PairSet
{
...
...
@@ -572,8 +575,9 @@ struct PairSet
PairValueRecord
array
[
VAR
];
/* Array of PairValueRecords--ordered
* by GlyphID of the second glyph */
public:
DEFINE_SIZE_VAR
(
2
,
PairValueRecord
);
};
ASSERT_SIZE_VAR
(
PairSet
,
2
,
PairValueRecord
);
struct
PairPosFormat1
{
...
...
@@ -755,8 +759,9 @@ struct PairPosFormat2
ValueRecord
values
;
/* Matrix of value pairs:
* class1-major, class2-minor,
* Each entry has value1 and value2 */
public:
DEFINE_SIZE_VAR
(
16
,
ValueRecord
);
};
ASSERT_SIZE_VAR
(
PairPosFormat2
,
16
,
ValueRecord
);
struct
PairPos
{
...
...
@@ -794,14 +799,15 @@ struct PairPos
struct
EntryExitRecord
{
friend
struct
CursivePosFormat1
;
inline
bool
sanitize
(
hb_sanitize_context_t
*
context
,
void
*
base
)
{
TRACE_SANITIZE
();
return
entryAnchor
.
sanitize
(
context
,
base
)
&&
exitAnchor
.
sanitize
(
context
,
base
);
}
DEFINE_SIZE_STATIC
(
4
);
private:
OffsetTo
<
Anchor
>
entryAnchor
;
/* Offset to EntryAnchor table--from
* beginning of CursivePos
...
...
@@ -810,6 +816,8 @@ struct EntryExitRecord
exitAnchor
;
/* Offset to ExitAnchor table--from
* beginning of CursivePos
* subtable--may be NULL */
public:
DEFINE_SIZE_STATIC
(
4
);
};
struct
CursivePosFormat1
...
...
src/hb-ot-layout-gsubgpos-private.hh
浏览文件 @
569da92b
...
...
@@ -177,12 +177,12 @@ struct LookupRecord
return
context
->
check_struct
(
this
);
}
DEFINE_SIZE_STATIC
(
4
);
USHORT
sequenceIndex
;
/* Index into current glyph
* sequence--first glyph = 0 */
USHORT
lookupListIndex
;
/* Lookup to apply to that
* position--zero--based */
public:
DEFINE_SIZE_STATIC
(
4
);
};
static
inline
bool
apply_lookup
(
hb_apply_context_t
*
context
,
...
...
@@ -302,8 +302,9 @@ struct Rule
* second glyph */
LookupRecord
lookupRecordX
[
VAR
];
/* Array of LookupRecords--in
* design order */
public:
DEFINE_SIZE_VAR2
(
4
,
USHORT
,
LookupRecord
);
};
ASSERT_SIZE_VAR2
(
Rule
,
4
,
USHORT
,
LookupRecord
);
struct
RuleSet
{
...
...
@@ -461,8 +462,9 @@ struct ContextFormat3
* table in glyph sequence order */
LookupRecord
lookupRecordX
[
VAR
];
/* Array of LookupRecords--in
* design order */
public:
DEFINE_SIZE_VAR2
(
6
,
OffsetTo
<
Coverage
>
,
LookupRecord
);
};
ASSERT_SIZE_VAR2
(
ContextFormat3
,
6
,
OffsetTo
<
Coverage
>
,
LookupRecord
);
struct
Context
{
...
...
src/hb-private.h
浏览文件 @
569da92b
...
...
@@ -85,14 +85,6 @@
#define ASSERT_SIZE(_type, _size) ASSERT_STATIC (sizeof (_type) == (_size))
/* Size signifying variable-sized array */
#define VAR 1
#define VAR0 (VAR+0)
#define ASSERT_SIZE_VAR(_type, _size, _var_type) \
ASSERT_STATIC (sizeof (_type) == (_size) + VAR0 * sizeof (_var_type))
#define ASSERT_SIZE_VAR2(_type, _size, _var_type1, _var_type2) \
ASSERT_STATIC (sizeof (_type) == (_size) + VAR0 * sizeof (_var_type1) + VAR0 * sizeof (_var_type2))
#if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__)
#define _HB_BOOLEAN_EXPR(expr) \
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录