Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
befc022a
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看板
提交
befc022a
编写于
12月 25, 2006
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
LangSys
上级
c81efca1
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
44 addition
and
7 deletion
+44
-7
src/hb-types-private.cc
src/hb-types-private.cc
+44
-7
未找到文件。
src/hb-types-private.cc
浏览文件 @
befc022a
...
...
@@ -27,7 +27,7 @@ typedef uint32_t hb_tag_t;
#define DEFINE_INT_TYPE1(NAME, TYPE, BIG_ENDIAN) \
struct NAME { \
inline NAME (void) { v = 0; } \
inline NAME (TYPE i) { v = BIG_ENDIAN(i); } \
explicit
inline NAME (TYPE i) { v = BIG_ENDIAN(i); } \
inline NAME& operator = (TYPE i) { v = BIG_ENDIAN(i); return *this; } \
inline operator TYPE(void) const { return BIG_ENDIAN(v); } \
inline bool operator== (NAME o) const { return v == o.v; } \
...
...
@@ -157,10 +157,11 @@ struct F2DOT14 : SHORT {
* system, feature, or baseline */
struct
Tag
{
inline
Tag
(
void
)
{
v
[
0
]
=
v
[
1
]
=
v
[
2
]
=
v
[
3
]
=
0
;
}
inline
Tag
(
uint32_t
v
)
{
(
ULONG
&
)(
*
this
)
=
v
;
}
inline
Tag
(
const
char
*
c
)
{
v
[
0
]
=
c
[
0
];
v
[
1
]
=
c
[
1
];
v
[
2
]
=
c
[
2
];
v
[
3
]
=
c
[
3
];
}
inline
operator
uint32_t
(
void
)
const
{
return
(
v
[
0
]
<<
24
)
+
(
v
[
1
]
<<
16
)
+
(
v
[
2
]
<<
8
)
+
v
[
3
];
}
\
/*
The char* these two
return is NOT nul-terminated. Print using "%.4s" */
inline
bool
operator
==
(
Tag
o
)
const
{
return
v
[
0
]
==
o
.
v
[
0
]
&&
v
[
1
]
==
o
.
v
[
1
]
&&
v
[
2
]
==
o
.
v
[
2
]
&&
v
[
3
]
==
o
.
v
[
3
];
}
inline
operator
uint32_t
(
void
)
const
{
return
(
v
[
0
]
<<
24
)
+
(
v
[
1
]
<<
16
)
+
(
v
[
2
]
<<
8
)
+
v
[
3
];
}
/*
What the char* converters
return is NOT nul-terminated. Print using "%.4s" */
inline
operator
const
char
*
(
void
)
const
{
return
(
const
char
*
)
this
;
}
inline
operator
char
*
(
void
)
{
return
(
char
*
)
this
;
}
...
...
@@ -219,6 +220,7 @@ typedef struct TableDirectory {
typedef
struct
OffsetTable
{
DEFINE_NOT_INSTANTIABLE
(
OffsetTable
);
/* OpenTypeTables, in no particular order */
DEFINE_ARRAY_TYPE
(
TableDirectory
,
tableDir
,
numTables
);
// TODO: Implement find_table
...
...
@@ -236,8 +238,7 @@ typedef struct OffsetTable {
struct
TTCHeader
{
DEFINE_NOT_INSTANTIABLE
(
TTCHeader
);
/* This works as an array type because TTCHeader is always located at the
* beginning of the file */
/* OpenTypeFonts, in no particular order */
DEFINE_OFFSET_ARRAY_TYPE
(
OffsetTable
,
offsetTable
,
numFonts
);
Tag
TTCTag
;
/* TrueType Collection ID string: 'ttcf' */
...
...
@@ -318,6 +319,7 @@ struct Script;
struct
ScriptList
{
DEFINE_NOT_INSTANTIABLE
(
ScriptList
);
/* Scripts, in sorted alphabetical order */
DEFINE_RECORD_ARRAY_TYPE
(
Script
,
scriptRecord
,
scriptCount
);
USHORT
scriptCount
;
/* Number of ScriptRecords */
...
...
@@ -327,8 +329,21 @@ struct ScriptList {
struct
Script
{
DEFINE_NOT_INSTANTIABLE
(
Script
);
/* LangSys', in sorted alphabetical order */
DEFINE_RECORD_ARRAY_TYPE
(
LangSys
,
langSysRecord
,
langSysCount
);
/* Return NULL if none */
inline
const
LangSys
*
get_default_language_system
(
void
)
const
{
if
(
!
defaultLangSys
)
return
NULL
;
return
(
const
LangSys
*
)((
const
char
*
)
this
+
defaultLangSys
);
}
inline
LangSys
*
get_default_language_system
(
void
)
{
if
(
!
defaultLangSys
)
return
NULL
;
return
(
LangSys
*
)((
char
*
)
this
+
defaultLangSys
);
}
Offset
defaultLangSys
;
/* Offset to DefaultLangSys table--from
* beginning of Script table--may be NULL */
USHORT
langSysCount
;
/* Number of LangSysRecords for this script--
...
...
@@ -338,8 +353,27 @@ struct Script {
};
struct
LangSys
{
DEFINE_NOT_INSTANTIABLE
(
LangSys
);
/* FeatureIndexes, in no particular order */
DEFINE_ARRAY_TYPE
(
USHORT
,
featureIndex
,
featureCount
);
/* Returns -1 if none */
inline
int
get_required_feature_index
(
void
)
const
{
if
(
reqFeatureIndex
==
0xffff
)
return
-
1
;
return
reqFeatureIndex
;;
}
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 */
USHORT
featureCount
;
/* Number of FeatureIndex values for this
* language system--excludes the required
* feature */
USHORT
featureIndex
[];
/* Array of indices into the FeatureList--in
* arbitrary order */
};
...
...
@@ -387,10 +421,13 @@ main (int argc, char **argv)
printf
(
"%d table(s) found in font
\n
"
,
num_tables
);
for
(
int
n_table
=
0
;
n_table
<
num_tables
;
n_table
++
)
{
const
OpenTypeTable
&
table
=
font
[
n_table
];
printf
(
"Table %
d of %d: %.4s (%04x+%04
x)
\n
"
,
n_table
+
1
,
num_tables
,
printf
(
"Table %
2d of %2d: %.4s (0x%06x+0x%06
x)
\n
"
,
n_table
+
1
,
num_tables
,
(
const
char
*
)
table
.
tag
,
(
int
)
table
.
offset
,
(
int
)
table
.
length
);
}
}
Tag
a
;
a
==
((
Tag
)
"1234"
);
return
0
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录