Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
eb32e374
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
12 个月 前同步成功
通知
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,发现更多精彩内容 >>
提交
eb32e374
编写于
12月 26, 2006
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ClassDef
上级
53502c67
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
97 addition
and
24 deletion
+97
-24
src/harfbuzz-ng.cc
src/harfbuzz-ng.cc
+97
-24
未找到文件。
src/harfbuzz-ng.cc
浏览文件 @
eb32e374
...
...
@@ -244,8 +244,7 @@ struct TTCHeader {
* 0x00010000 or 0x00020000 */
ULONG
numFonts
;
/* Number of fonts in TTC */
ULONG
offsetTable
[];
/* Array of offsets to the OffsetTable for each font
* from the beginning of the file.
* numFonts entries long. */
* from the beginning of the file */
};
...
...
@@ -328,7 +327,7 @@ struct ScriptList {
USHORT
scriptCount
;
/* Number of ScriptRecords */
ScriptRecord
scriptRecord
[];
/* Array of ScriptRecords--listed alphabetically
* by ScriptTag
. scriptCount entries long
*/
* by ScriptTag */
};
struct
Script
{
...
...
@@ -385,8 +384,7 @@ struct FeatureList {
USHORT
featureCount
;
/* Number of FeatureRecords in this table */
FeatureRecord
featureRecord
[];
/* Array of FeatureRecords--zero-based (first
* feature has FeatureIndex = 0)--listed
* alphabetically by FeatureTag. featureCount
* entries long */
* alphabetically by FeatureTag */
};
struct
Feature
{
...
...
@@ -403,8 +401,7 @@ struct Feature {
* feature */
USHORT
lookupIndex
[];
/* Array of LookupList indices for this
* feature--zero-based (first lookup is
* LookupListIndex = 0). lookupCount
* entries long */
* LookupListIndex = 0) */
};
struct
LookupList
{
...
...
@@ -414,8 +411,7 @@ struct LookupList {
USHORT
lookupCount
;
/* Number of lookups in this table */
Offset
lookupOffset
[];
/* Array of offsets to Lookup tables--from
* beginning of LookupList--zero based (first
* lookup is Lookup index = 0). lookupCount
* entries long */
* lookup is Lookup index = 0) */
};
struct
LookupFlag
:
USHORT
{
...
...
@@ -441,8 +437,7 @@ struct Lookup {
USHORT
lookupFlag
;
/* Lookup qualifiers */
USHORT
subTableCount
;
/* Number of SubTables for this lookup */
Offset
subTableOffset
[];
/* Array of offsets to SubTables-from
* beginning of Lookup table. subTableCount
* entries long. */
* beginning of Lookup table */
};
/*
...
...
@@ -453,7 +448,7 @@ struct CoverageFormat1 {
/* GlyphIDs, in sorted numerical order */
DEFINE_ARRAY_TYPE
(
GlyphID
,
glyphArray
,
glyphCount
);
inline
unsigned
int
get_coverage
(
uint16_t
glyph_id
)
const
{
inline
int
get_coverage
(
uint16_t
glyph_id
)
const
{
GlyphID
gid
(
glyph_id
);
// TODO: bsearch
for
(
int
i
=
0
;
i
<
glyphCount
;
i
++
)
...
...
@@ -462,14 +457,14 @@ struct CoverageFormat1 {
return
-
1
;
}
USHORT
coverageFormat
;
/* Format identifier--format = 1 */
USHORT
glyphCount
;
/* Number of glyphs in the GlyphArray */
GlyphID
glyphArray
[];
/* Array of GlyphIDs--in numerical
* order. glyphCount entries long */
USHORT
coverageFormat
;
/* Format identifier--format = 1 */
USHORT
glyphCount
;
/* Number of glyphs in the GlyphArray */
GlyphID
glyphArray
[];
/* Array of GlyphIDs--in numerical order */
};
struct
CoverageRangeRecord
{
inline
unsigned
int
get_coverage
(
uint16_t
glyph_id
)
const
{
inline
int
get_coverage
(
uint16_t
glyph_id
)
const
{
if
(
glyph_id
>=
start
&&
glyph_id
<=
end
)
return
startCoverageIndex
+
(
glyph_id
-
start
);
return
-
1
;
...
...
@@ -485,7 +480,7 @@ struct CoverageFormat2 {
/* CoverageRangeRecords, in sorted numerical start order */
DEFINE_ARRAY_TYPE
(
CoverageRangeRecord
,
rangeRecord
,
rangeCount
);
inline
unsigned
int
get_coverage
(
uint16_t
glyph_id
)
const
{
inline
int
get_coverage
(
uint16_t
glyph_id
)
const
{
// TODO: bsearch
for
(
int
i
=
0
;
i
<
rangeCount
;
i
++
)
{
int
coverage
=
rangeRecord
[
i
].
get_coverage
(
glyph_id
);
...
...
@@ -495,9 +490,9 @@ struct CoverageFormat2 {
return
-
1
;
}
USHORT
coverageFormat
;
/* Format identifier--format = 2 */
USHORT
rangeCount
;
/* Number of Cover
RangeRecords */
CoverageRangeRecord
rangeRecord
[];
/* Array of glyph ranges--ordered by
USHORT
coverageFormat
;
/* Format identifier--format = 2 */
USHORT
rangeCount
;
/* Number of Coverage
RangeRecords */
CoverageRangeRecord
rangeRecord
[];
/* Array of glyph ranges--ordered by
* Start GlyphID. rangeCount entries
* long */
};
...
...
@@ -509,22 +504,100 @@ struct Coverage {
switch
(
coverageFormat
)
{
case
1
:
return
((
const
CoverageFormat1
&
)
*
this
).
get_size
();
case
2
:
return
((
const
CoverageFormat2
&
)
*
this
).
get_size
();
default:
return
sizeof
(
Coverage
);
default:
return
sizeof
(
Coverage
);
}
}
/* Returns -1 if not covered. */
inline
unsigned
int
get_coverage
(
uint16_t
glyph_id
)
const
{
inline
int
get_coverage
(
uint16_t
glyph_id
)
const
{
switch
(
coverageFormat
)
{
case
1
:
return
((
const
CoverageFormat1
&
)
*
this
).
get_coverage
(
glyph_id
);
case
2
:
return
((
const
CoverageFormat2
&
)
*
this
).
get_coverage
(
glyph_id
);
default:
return
-
1
;
default:
return
-
1
;
}
}
USHORT
coverageFormat
;
/* Format identifier */
};
/*
* Class Definition
*/
struct
ClassDefFormat1
{
/* GlyphIDs, in sorted numerical order */
DEFINE_ARRAY_TYPE
(
USHORT
,
classValueArray
,
glyphCount
);
inline
int
get_class
(
uint16_t
glyph_id
)
const
{
if
(
glyph_id
>=
startGlyph
&&
glyph_id
<
startGlyph
+
glyphCount
)
return
classValueArray
[
glyph_id
-
startGlyph
];
return
0
;
}
USHORT
classFormat
;
/* Format identifier--format = 1 */
GlyphID
startGlyph
;
/* First GlyphID of the classValueArray */
USHORT
glyphCount
;
/* Size of the classValueArray */
USHORT
classValueArray
[];
/* Array of Class Values--one per GlyphID */
};
struct
ClassRangeRecord
{
inline
int
get_class
(
uint16_t
glyph_id
)
const
{
if
(
glyph_id
>=
start
&&
glyph_id
<=
end
)
return
classValue
;
return
0
;
}
GlyphID
start
;
/* First GlyphID in the range */
GlyphID
end
;
/* Last GlyphID in the range */
USHORT
classValue
;
/* Applied to all glyphs in the range
*/
};
struct
ClassDefFormat2
{
/* ClassRangeRecords, in sorted numerical start order */
DEFINE_ARRAY_TYPE
(
ClassRangeRecord
,
rangeRecord
,
rangeCount
);
inline
int
get_class
(
uint16_t
glyph_id
)
const
{
// TODO: bsearch
for
(
int
i
=
0
;
i
<
rangeCount
;
i
++
)
{
int
classValue
=
rangeRecord
[
i
].
get_class
(
glyph_id
);
if
(
classValue
>
0
)
return
classValue
;
}
return
0
;
}
USHORT
classFormat
;
/* Format identifier--format = 2 */
USHORT
rangeCount
;
/* Number of Number of ClassRangeRecords */
ClassRangeRecord
rangeRecord
[];
/* Array of glyph ranges--ordered by
* Start GlyphID */
};
struct
ClassDef
{
DEFINE_NON_INSTANTIABLE
(
ClassDef
);
inline
unsigned
int
get_size
(
void
)
const
{
switch
(
classFormat
)
{
case
1
:
return
((
const
ClassDefFormat1
&
)
*
this
).
get_size
();
case
2
:
return
((
const
ClassDefFormat2
&
)
*
this
).
get_size
();
default:
return
sizeof
(
ClassDef
);
}
}
/* Returns 0 if not found. */
inline
int
get_class
(
uint16_t
glyph_id
)
const
{
switch
(
classFormat
)
{
case
1
:
return
((
const
ClassDefFormat1
&
)
*
this
).
get_class
(
glyph_id
);
case
2
:
return
((
const
ClassDefFormat2
&
)
*
this
).
get_class
(
glyph_id
);
default:
return
0
;
}
}
USHORT
classFormat
;
/* Format identifier */
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录