Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
2098a021
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看板
提交
2098a021
编写于
8月 02, 2009
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[HB] Move OT file handling out of ot-layout
上级
0ead481a
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
157 addition
and
118 deletion
+157
-118
src/Makefile.am
src/Makefile.am
+2
-1
src/hb-open-file-private.h
src/hb-open-file-private.h
+145
-0
src/hb-open-types-private.h
src/hb-open-types-private.h
+4
-113
src/hb-ot-layout-common-private.h
src/hb-ot-layout-common-private.h
+3
-1
src/hb-ot-layout.cc
src/hb-ot-layout.cc
+1
-1
src/main.cc
src/main.cc
+2
-2
未找到文件。
src/Makefile.am
浏览文件 @
2098a021
...
...
@@ -13,13 +13,14 @@ HBSOURCES = \
hb-font.c
\
hb-font-private.h
\
hb-private.h
\
hb-open-file-private.h
\
hb-open-types-private.h
\
hb-ot-layout.cc
\
hb-ot-layout-common-private.h
\
hb-ot-layout-gdef-private.h
\
hb-ot-layout-gpos-private.h
\
hb-ot-layout-gsubgpos-private.h
\
hb-ot-layout-gsub-private.h
\
hb-ot-layout-open-private.h
\
hb-ot-layout-private.h
\
hb-object-private.h
\
$(NULL)
...
...
src/hb-open-file-private.h
0 → 100644
浏览文件 @
2098a021
/*
* Copyright (C) 2007,2008,2009 Red Hat, Inc.
*
* This is part of HarfBuzz, an OpenType Layout engine library.
*
* Permission is hereby granted, without written agreement and without
* license or royalty fees, to use, copy, modify, and distribute this
* software and its documentation for any purpose, provided that the
* above copyright notice and the following two paragraphs appear in
* all copies of this software.
*
* IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
* ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
* IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
* THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
* ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*
* Red Hat Author(s): Behdad Esfahbod
*/
#ifndef HB_OPEN_FILE_PRIVATE_H
#define HB_OPEN_FILE_PRIVATE_H
#include "hb-open-types-private.h"
/*
*
* The OpenType Font File
*
*/
/*
* Organization of an OpenType Font
*/
struct
OpenTypeFontFile
;
struct
OffsetTable
;
struct
TTCHeader
;
typedef
struct
TableDirectory
{
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. */
}
OpenTypeTable
;
ASSERT_SIZE
(
TableDirectory
,
16
);
typedef
struct
OffsetTable
{
friend
struct
OpenTypeFontFile
;
friend
struct
TTCHeader
;
DEFINE_TAG_ARRAY_INTERFACE
(
OpenTypeTable
,
table
);
/* get_table_count(), get_table(i), get_table_tag(i) */
DEFINE_TAG_FIND_INTERFACE
(
OpenTypeTable
,
table
);
/* find_table_index(tag), get_table_by_tag(tag) */
private:
/* OpenTypeTables, in no particular order */
DEFINE_ARRAY_TYPE
(
TableDirectory
,
tableDir
,
numTables
);
private:
Tag
sfnt_version
;
/* '\0\001\0\00' if TrueType / 'OTTO' if CFF */
USHORT
numTables
;
/* Number of tables. */
USHORT
searchRange
;
/* (Maximum power of 2 <= numTables) x 16 */
USHORT
entrySelector
;
/* Log2(maximum power of 2 <= numTables). */
USHORT
rangeShift
;
/* NumTables x 16-searchRange. */
TableDirectory
tableDir
[];
/* TableDirectory entries. numTables items */
}
OpenTypeFontFace
;
ASSERT_SIZE
(
OffsetTable
,
12
);
/*
* TrueType Collections
*/
struct
TTCHeader
{
friend
struct
OpenTypeFontFile
;
STATIC_DEFINE_GET_FOR_DATA_CHECK_MAJOR_VERSION
(
TTCHeader
,
2
);
private:
Tag
ttcTag
;
/* TrueType Collection ID string: 'ttcf' */
FixedVersion
version
;
/* Version of the TTC Header (1.0 or 2.0),
* 0x00010000 or 0x00020000 */
LongOffsetLongArrayOf
<
OffsetTable
>
table
;
/* Array of offsets to the OffsetTable for each font
* from the beginning of the file */
};
ASSERT_SIZE
(
TTCHeader
,
12
);
/*
* OpenType Font File
*/
struct
OpenTypeFontFile
{
static
const
hb_tag_t
TrueTypeTag
=
HB_TAG
(
0
,
1
,
0
,
0
);
static
const
hb_tag_t
CFFTag
=
HB_TAG
(
'O'
,
'T'
,
'T'
,
'O'
);
static
const
hb_tag_t
TTCTag
=
HB_TAG
(
't'
,
't'
,
'c'
,
'f'
);
STATIC_DEFINE_GET_FOR_DATA
(
OpenTypeFontFile
);
unsigned
int
get_face_count
(
void
)
const
{
switch
(
tag
)
{
default:
return
0
;
case
TrueTypeTag
:
case
CFFTag
:
return
1
;
case
TTCTag
:
return
TTCHeader
::
get_for_data
((
const
char
*
)
this
).
table
.
len
;
}
}
const
OpenTypeFontFace
&
get_face
(
unsigned
int
i
)
const
{
switch
(
tag
)
{
default:
return
Null
(
OpenTypeFontFace
);
/* Note: for non-collection SFNT data we ignore index. This is because
* Apple dfont container is a container of SFNT's. So each SFNT is a
* non-TTC, but the index is more than zero. */
case
TrueTypeTag
:
case
CFFTag
:
return
*
(
const
OffsetTable
*
)
this
;
case
TTCTag
:
return
this
+
TTCHeader
::
get_for_data
((
const
char
*
)
this
).
table
[
i
];
}
}
/* This is how you get a table */
inline
const
char
*
get_table_data
(
const
OpenTypeTable
&
table
)
const
{
if
(
HB_UNLIKELY
(
table
.
offset
==
0
))
return
NULL
;
return
((
const
char
*
)
this
)
+
table
.
offset
;
}
Tag
tag
;
/* 4-byte identifier. */
};
ASSERT_SIZE
(
OpenTypeFontFile
,
4
);
#endif
/* HB_OPEN_FILE_PRIVATE_H */
src/hb-o
t-layout-open
-private.h
→
src/hb-o
pen-types
-private.h
浏览文件 @
2098a021
...
...
@@ -24,14 +24,10 @@
* Red Hat Author(s): Behdad Esfahbod
*/
#ifndef HB_O
T_LAYOUT_OPEN
_PRIVATE_H
#define HB_O
T_LAYOUT_OPEN
_PRIVATE_H
#ifndef HB_O
PEN_TYPES
_PRIVATE_H
#define HB_O
PEN_TYPES
_PRIVATE_H
#ifndef HB_OT_LAYOUT_CC
#error "This file should only be included from hb-ot-layout.cc"
#endif
#include "hb-ot-layout-private.h"
#include "hb-private.h"
#define NO_INDEX ((unsigned int) 0xFFFF)
...
...
@@ -387,109 +383,4 @@ struct LongOffsetLongArrayOf : LongArrayOf<LongOffsetTo<Type> > {};
}
/*
* Organization of an OpenType Font
*/
struct
OpenTypeFontFile
;
struct
OffsetTable
;
struct
TTCHeader
;
typedef
struct
TableDirectory
{
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. */
}
OpenTypeTable
;
ASSERT_SIZE
(
TableDirectory
,
16
);
typedef
struct
OffsetTable
{
friend
struct
OpenTypeFontFile
;
friend
struct
TTCHeader
;
DEFINE_TAG_ARRAY_INTERFACE
(
OpenTypeTable
,
table
);
/* get_table_count(), get_table(i), get_table_tag(i) */
DEFINE_TAG_FIND_INTERFACE
(
OpenTypeTable
,
table
);
/* find_table_index(tag), get_table_by_tag(tag) */
private:
/* OpenTypeTables, in no particular order */
DEFINE_ARRAY_TYPE
(
TableDirectory
,
tableDir
,
numTables
);
private:
Tag
sfnt_version
;
/* '\0\001\0\00' if TrueType / 'OTTO' if CFF */
USHORT
numTables
;
/* Number of tables. */
USHORT
searchRange
;
/* (Maximum power of 2 <= numTables) x 16 */
USHORT
entrySelector
;
/* Log2(maximum power of 2 <= numTables). */
USHORT
rangeShift
;
/* NumTables x 16-searchRange. */
TableDirectory
tableDir
[];
/* TableDirectory entries. numTables items */
}
OpenTypeFontFace
;
ASSERT_SIZE
(
OffsetTable
,
12
);
/*
* TrueType Collections
*/
struct
TTCHeader
{
friend
struct
OpenTypeFontFile
;
STATIC_DEFINE_GET_FOR_DATA_CHECK_MAJOR_VERSION
(
TTCHeader
,
2
);
private:
Tag
ttcTag
;
/* TrueType Collection ID string: 'ttcf' */
FixedVersion
version
;
/* Version of the TTC Header (1.0 or 2.0),
* 0x00010000 or 0x00020000 */
LongOffsetLongArrayOf
<
OffsetTable
>
table
;
/* Array of offsets to the OffsetTable for each font
* from the beginning of the file */
};
ASSERT_SIZE
(
TTCHeader
,
12
);
/*
* OpenType Font File
*/
struct
OpenTypeFontFile
{
static
const
hb_tag_t
TrueTypeTag
=
HB_TAG
(
0
,
1
,
0
,
0
);
static
const
hb_tag_t
CFFTag
=
HB_TAG
(
'O'
,
'T'
,
'T'
,
'O'
);
static
const
hb_tag_t
TTCTag
=
HB_TAG
(
't'
,
't'
,
'c'
,
'f'
);
STATIC_DEFINE_GET_FOR_DATA
(
OpenTypeFontFile
);
unsigned
int
get_face_count
(
void
)
const
{
switch
(
tag
)
{
default:
return
0
;
case
TrueTypeTag
:
case
CFFTag
:
return
1
;
case
TTCTag
:
return
TTCHeader
::
get_for_data
((
const
char
*
)
this
).
table
.
len
;
}
}
const
OpenTypeFontFace
&
get_face
(
unsigned
int
i
)
const
{
switch
(
tag
)
{
default:
return
Null
(
OpenTypeFontFace
);
/* Note: for non-collection SFNT data we ignore index. This is because
* Apple dfont container is a container of SFNT's. So each SFNT is a
* non-TTC, but the index is more than zero. */
case
TrueTypeTag
:
case
CFFTag
:
return
*
(
const
OffsetTable
*
)
this
;
case
TTCTag
:
return
this
+
TTCHeader
::
get_for_data
((
const
char
*
)
this
).
table
[
i
];
}
}
/* This is how you get a table */
inline
const
char
*
get_table_data
(
const
OpenTypeTable
&
table
)
const
{
if
(
HB_UNLIKELY
(
table
.
offset
==
0
))
return
NULL
;
return
((
const
char
*
)
this
)
+
table
.
offset
;
}
Tag
tag
;
/* 4-byte identifier. */
};
ASSERT_SIZE
(
OpenTypeFontFile
,
4
);
#endif
/* HB_OT_LAYOUT_OPEN_PRIVATE_H */
#endif
/* HB_OPEN_TYPES_PRIVATE_H */
src/hb-ot-layout-common-private.h
浏览文件 @
2098a021
...
...
@@ -27,7 +27,9 @@
#ifndef HB_OT_LAYOUT_COMMON_PRIVATE_H
#define HB_OT_LAYOUT_COMMON_PRIVATE_H
#include "hb-ot-layout-open-private.h"
#include "hb-ot-layout-private.h"
#include "hb-open-types-private.h"
/*
...
...
src/hb-ot-layout.cc
浏览文件 @
2098a021
...
...
@@ -30,7 +30,7 @@
#include "hb-ot-layout-private.h"
#include "hb-o
t-layout-open
-private.h"
#include "hb-o
pen-file
-private.h"
#include "hb-ot-layout-gdef-private.h"
#include "hb-ot-layout-gsub-private.h"
#include "hb-ot-layout-gpos-private.h"
...
...
src/main.cc
浏览文件 @
2098a021
...
...
@@ -25,9 +25,9 @@
*/
#define HB_OT_LAYOUT_CC
#include "hb-o
t-layout-open
-private.h"
#include "hb-o
pen-file
-private.h"
#include "hb-ot-layout-gdef-private.h"
#include "hb-ot-layout-gsub-private.h"
#include "hb-ot-layout-gsub
gpos
-private.h"
#include <glib.h>
#include <stdlib.h>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录