Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
ead428d7
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看板
提交
ead428d7
编写于
1月 24, 2008
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
More public api
上级
fd92a3dd
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
39 addition
and
25 deletion
+39
-25
src/hb-ot-layout-open-private.h
src/hb-ot-layout-open-private.h
+19
-13
src/hb-ot-layout-private.h
src/hb-ot-layout-private.h
+6
-3
src/hb-ot-layout.cc
src/hb-ot-layout.cc
+14
-7
src/hb-ot-layout.h
src/hb-ot-layout.h
+0
-2
未找到文件。
src/hb-ot-layout-open-private.h
浏览文件 @
ead428d7
...
...
@@ -34,6 +34,8 @@
* Int types
*/
/* XXX define these as structs of chars on machines that do not allow
* unaligned access */
#define DEFINE_INT_TYPE1(NAME, TYPE, BIG_ENDIAN) \
inline NAME& operator = (TYPE i) { v = BIG_ENDIAN(i); return *this; } \
inline operator TYPE(void) const { return BIG_ENDIAN(v); } \
...
...
@@ -100,11 +102,7 @@
if (HB_UNLIKELY (!array[i].offset)) return Null##Type; \
return *(const Type *)((const char*)this + array[i].offset); \
} \
inline const Tag& get_tag (unsigned int i) const { \
if (HB_UNLIKELY (i >= num)) return NullTag; \
return array[i].tag; \
} \
/* TODO: implement find_tag() */
/* TODO: implement find_tag() and get_tag() publicly */
#define DEFINE_ARRAY_INTERFACE(Type, name) \
...
...
@@ -332,10 +330,11 @@ struct TTCHeader;
typedef
struct
TableDirectory
{
friend
struct
OpenTypeFontFile
;
friend
struct
OffsetTable
;
inline
bool
is_null
(
void
)
const
{
return
length
==
0
;
}
inline
const
Tag
&
get_tag
(
void
)
const
{
return
tag
;
}
inline
hb_tag_t
get_tag
(
void
)
const
{
return
tag
;
}
inline
unsigned
long
get_checksum
(
void
)
const
{
return
checkSum
;
}
inline
unsigned
long
get_offset
(
void
)
const
{
return
offset
;
}
inline
unsigned
long
get_length
(
void
)
const
{
return
length
;
}
...
...
@@ -409,17 +408,25 @@ struct OpenTypeFontFile {
STATIC_DEFINE_GET_FOR_DATA
(
OpenTypeFontFile
);
DEFINE_ARRAY_INTERFACE
(
OpenTypeFontFace
,
face
);
inline
hb_tag_t
get_tag
(
void
)
const
{
return
tag
;
}
/* This is how you get a table */
inline
const
char
*
get_table
(
const
OpenTypeTable
&
table
)
const
{
return
(
(
const
char
*
)
this
)
+
table
.
offset
;
inline
const
char
*
get_table
_data
(
const
OpenTypeTable
&
table
)
const
{
return
(
*
this
)[
table
]
;
}
inline
char
*
get_table
(
const
OpenTypeTable
&
table
)
{
return
(
(
char
*
)
this
)
+
table
.
offset
;
inline
char
*
get_table
_data
(
const
OpenTypeTable
&
table
)
{
return
(
*
this
)[
table
]
;
}
private:
inline
const
char
*
operator
[]
(
const
OpenTypeTable
&
table
)
const
{
if
(
G_UNLIKELY
(
table
.
offset
==
0
))
return
NULL
;
return
((
const
char
*
)
this
)
+
table
.
offset
;
}
inline
char
*
operator
[]
(
const
OpenTypeTable
&
table
)
{
if
(
G_UNLIKELY
(
table
.
offset
==
0
))
return
NULL
;
return
((
char
*
)
this
)
+
table
.
offset
;
}
...
...
@@ -438,7 +445,6 @@ struct OpenTypeFontFile {
case
TTCTag
:
return
((
const
TTCHeader
&
)
*
this
)[
i
];
}
}
inline
const
Tag
&
get_tag
(
void
)
const
{
return
tag
;
}
private:
Tag
tag
;
/* 4-byte identifier. */
...
...
@@ -731,7 +737,7 @@ struct ClassDefFormat1 {
DEFINE_ARRAY_TYPE
(
USHORT
,
classValueArray
,
glyphCount
);
inline
hb_ot_layout_class_t
get_class
(
hb_ot_layout_glyph_t
glyph_id
)
const
{
if
(
glyph_id
>=
startGlyph
&&
glyph_id
<
startGlyph
+
glyphCount
)
if
(
glyph_id
>=
startGlyph
&&
glyph_id
-
startGlyph
<
glyphCount
)
return
classValueArray
[
glyph_id
-
startGlyph
];
return
0
;
}
...
...
@@ -799,7 +805,7 @@ struct ClassDef {
}
}
hb_ot_layout_class_t
get_class
(
hb_ot_layout_glyph_t
glyph_id
)
const
{
inline
hb_ot_layout_class_t
get_class
(
hb_ot_layout_glyph_t
glyph_id
)
const
{
switch
(
u
.
classFormat
)
{
case
1
:
return
u
.
format1
.
get_class
(
glyph_id
);
case
2
:
return
u
.
format2
.
get_class
(
glyph_id
);
...
...
src/hb-ot-layout-private.h
浏览文件 @
ead428d7
...
...
@@ -34,6 +34,9 @@
#include "hb-private.h"
#include "hb-ot-layout.h"
typedef
uint16_t
hb_ot_layout_class_t
;
typedef
int
hb_ot_layout_coverage_t
;
/* -1 is not covered, >= 0 otherwise */
struct
GDEF
;
struct
GSUB
;
struct
GPOS
;
...
...
@@ -41,9 +44,9 @@ struct GPOS;
HB_BEGIN_DECLS
();
struct
_HB_OT_Layout
{
GDEF
*
gdef
;
GSUB
*
gsub
;
GPOS
*
gpos
;
const
GDEF
*
gdef
;
const
GSUB
*
gsub
;
const
GPOS
*
gpos
;
};
HB_END_DECLS
();
...
...
src/hb-ot-layout.cc
浏览文件 @
ead428d7
...
...
@@ -41,12 +41,12 @@ hb_ot_layout_create (const char *font_data,
{
HB_OT_Layout
*
layout
=
(
HB_OT_Layout
*
)
calloc
(
1
,
sizeof
(
HB_OT_Layout
));
const
OpenTypeFontFile
&
o
t
=
OpenTypeFontFile
::
get_for_data
(
font_data
);
const
OpenTypeFontFace
&
f
ont
=
ot
[
face_index
]
;
const
OpenTypeFontFile
&
fon
t
=
OpenTypeFontFile
::
get_for_data
(
font_data
);
const
OpenTypeFontFace
&
f
ace
=
font
.
get_face
(
face_index
)
;
layout
->
gdef
=
font
.
find_table
(
GDEF
::
Tag
);
layout
->
gsub
=
font
.
find_table
(
GSUB
::
Tag
);
layout
->
gpos
=
font
.
find_table
(
GPOS
::
Tag
);
layout
->
gdef
=
&
GDEF
::
get_for_data
(
font
.
get_table_data
(
face
.
get_table
(
GDEF
::
Tag
))
);
layout
->
gsub
=
&
GSUB
::
get_for_data
(
font
.
get_table_data
(
face
.
get_table
(
GSUB
::
Tag
))
);
//layout->gpos = &GPOS::get_for_data (font.get_table_data (face.get_table (GPOS::Tag))
);
return
layout
;
}
...
...
@@ -59,9 +59,16 @@ hb_ot_layout_destroy (HB_OT_Layout *layout)
hb_ot_layout_glyph_properties_t
hb_ot_layout_get_glyph_properties
(
HB_OT_Layout
*
layout
,
hb_ot_layout_glyph_t
glyph
);
hb_ot_layout_glyph_t
glyph
)
{
}
void
hb_ot_layout_set_glyph_properties
(
HB_OT_Layout
*
layout
,
hb_ot_layout_glyph_t
glyph
,
hb_ot_layout_glyph_properties_t
properties
);
hb_ot_layout_glyph_properties_t
properties
)
{
}
src/hb-ot-layout.h
浏览文件 @
ead428d7
...
...
@@ -40,8 +40,6 @@ typedef uint32_t hb_tag_t;
typedef
uint16_t
hb_ot_layout_glyph_properties_t
;
typedef
uint16_t
hb_ot_layout_glyph_t
;
typedef
uint16_t
hb_ot_layout_class_t
;
typedef
int
hb_ot_layout_coverage_t
;
/* -1 is not covered, >= 0 otherwise */
typedef
struct
_HB_OT_Layout
HB_OT_Layout
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录