Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
54e5aac5
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看板
提交
54e5aac5
编写于
1月 27, 2008
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
GDEF completely working now
上级
6f425b11
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
39 addition
and
26 deletion
+39
-26
src/hb-ot-layout-open-private.h
src/hb-ot-layout-open-private.h
+8
-3
src/hb-ot-layout-private.h
src/hb-ot-layout-private.h
+9
-7
src/hb-ot-layout.cc
src/hb-ot-layout.cc
+9
-10
src/hb-private.h
src/hb-private.h
+7
-0
src/main.cc
src/main.cc
+6
-6
未找到文件。
src/hb-ot-layout-open-private.h
浏览文件 @
54e5aac5
...
...
@@ -27,6 +27,10 @@
#ifndef HB_OT_LAYOUT_OPEN_PRIVATE_H
#define HB_OT_LAYOUT_OPEN_PRIVATE_H
#ifndef HB_OT_LAYOUT_CC
#error "This file should only be included from hb-ot-layout.c"
#endif
#include "hb-ot-layout-private.h"
...
...
@@ -127,7 +131,7 @@
return &(*this)[i]; \
return NULL; \
} \
inline const Type& get_##name_by_tag (hb_tag_t tag) const { \
inline const Type& get_##name
##
_by_tag (hb_tag_t tag) const { \
for (unsigned int i = 0; i < this->get_len (); i++) \
if (tag == (*this)[i].tag) \
return (*this)[i]; \
...
...
@@ -158,6 +162,7 @@
private: inline Type() {}
/* cannot be instantiated */
\
public:
/* TODO use a global nul-array for most Null's */
/* defines Null##Type as a safe nil instance of Type */
#define DEFINE_NULL_DATA(Type, size, data) \
static const unsigned char Null##Type##Data[size] = data; \
...
...
@@ -170,11 +175,11 @@
ASSERT_SIZE (Type, size); \
DEFINE_NULL_DATA (Type, size, data)
#define DEFINE_NULL_ALIAS(NewType, OldType) \
static
const NewType &Null##NewType = *(NewType *)Null##OldType##Data
/* XXX static */
const NewType &Null##NewType = *(NewType *)Null##OldType##Data
/* get_for_data() is a static class method returning a reference to an
* instance of Type located at the input data location. It's just a
* fancy cast! */
* fancy
, NULL-safe,
cast! */
#define STATIC_DEFINE_GET_FOR_DATA(Type) \
static inline const Type& get_for_data (const char *data) { \
extern const Type &Null##Type; \
...
...
src/hb-ot-layout-private.h
浏览文件 @
54e5aac5
...
...
@@ -27,10 +27,6 @@
#ifndef HB_OT_LAYOUT_PRIVATE_H
#define HB_OT_LAYOUT_PRIVATE_H
#ifndef HB_OT_LAYOUT_CC
#error "This file should only be included from hb-ot-layout.c"
#endif
#include "hb-private.h"
#include "hb-ot-layout.h"
...
...
@@ -43,17 +39,23 @@ typedef uint16_t hb_ot_layout_glyph_properties_t;
typedef
uint16_t
hb_ot_layout_lookup_flags_t
;
typedef
int
hb_ot_layout_coverage_t
;
/* -1 is not covered, >= 0 otherwise */
/* XXX #define HB_OT_LAYOUT_INTERNAL static */
#define HB_OT_LAYOUT_INTERNAL
HB_BEGIN_DECLS
();
static
hb_bool_t
/*
* GDEF
*/
HB_OT_LAYOUT_INTERNAL
hb_bool_t
_hb_ot_layout_has_new_glyph_classes
(
HB_OT_Layout
*
layout
);
static
hb_ot_layout_glyph_properties_t
HB_OT_LAYOUT_INTERNAL
hb_ot_layout_glyph_properties_t
_hb_ot_layout_get_glyph_properties
(
HB_OT_Layout
*
layout
,
hb_glyph_t
glyph
);
static
bool
HB_OT_LAYOUT_INTERNAL
hb_bool_t
_hb_ot_layout_check_glyph_properties
(
HB_OT_Layout
*
layout
,
HB_GlyphItem
gitem
,
hb_ot_layout_lookup_flags_t
lookup_flags
,
...
...
src/hb-ot-layout.cc
浏览文件 @
54e5aac5
...
...
@@ -61,9 +61,9 @@ hb_ot_layout_create (const char *font_data,
const
OpenTypeFontFile
&
font
=
OpenTypeFontFile
::
get_for_data
(
font_data
);
const
OpenTypeFontFace
&
face
=
font
.
get_face
(
face_index
);
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)));
layout
->
gdef
=
&
GDEF
::
get_for_data
(
font
.
get_table_data
(
face
.
get_table
_by_tag
(
GDEF
::
Tag
)));
layout
->
gsub
=
&
GSUB
::
get_for_data
(
font
.
get_table_data
(
face
.
get_table
_by_tag
(
GSUB
::
Tag
)));
//layout->gpos = &GPOS::get_for_data (font.get_table_data (face.get_table
_by_tag
(GPOS::Tag)));
return
layout
;
}
...
...
@@ -84,13 +84,13 @@ hb_ot_layout_has_font_glyph_classes (HB_OT_Layout *layout)
return
layout
->
gdef
->
has_glyph_classes
();
}
static
hb_bool_t
HB_OT_LAYOUT_INTERNAL
hb_bool_t
_hb_ot_layout_has_new_glyph_classes
(
HB_OT_Layout
*
layout
)
{
return
layout
->
new_gdef
.
len
>
0
;
}
static
hb_ot_layout_glyph_properties_t
HB_OT_LAYOUT_INTERNAL
hb_ot_layout_glyph_properties_t
_hb_ot_layout_get_glyph_properties
(
HB_OT_Layout
*
layout
,
hb_glyph_t
glyph
)
{
...
...
@@ -117,19 +117,18 @@ _hb_ot_layout_get_glyph_properties (HB_OT_Layout *layout,
}
}
static
bool
HB_OT_LAYOUT_INTERNAL
hb_bool_t
_hb_ot_layout_check_glyph_properties
(
HB_OT_Layout
*
layout
,
HB_GlyphItem
gitem
,
hb_ot_layout_lookup_flags_t
lookup_flags
,
hb_ot_layout_glyph_properties_t
*
property
)
{
/* TODO ugh, clean this mess up */
hb_ot_layout_glyph_class_t
basic_glyph_class
;
hb_ot_layout_glyph_properties_t
desired_attachment_class
;
if
(
gitem
->
gproperties
==
HB_
OT_LAYOUT_GLYPH_CLASS_UNCLASSIFIED
)
if
(
gitem
->
gproperties
==
HB_
BUFFER_GLYPH_PROPERTIES_UNKNOWN
)
{
gitem
->
gproperties
=
_hb_ot_layout_get_glyph_properties
(
layout
,
gitem
->
gindex
);
gitem
->
gproperties
=
*
property
=
_hb_ot_layout_get_glyph_properties
(
layout
,
gitem
->
gindex
);
if
(
gitem
->
gproperties
==
HB_OT_LAYOUT_GLYPH_CLASS_UNCLASSIFIED
)
return
false
;
}
...
...
@@ -177,7 +176,7 @@ hb_ot_layout_get_glyph_class (HB_OT_Layout *layout,
properties
=
_hb_ot_layout_get_glyph_properties
(
layout
,
glyph
);
if
(
properties
&
0xFF
)
if
(
properties
&
0xFF
00
)
return
HB_OT_LAYOUT_GLYPH_CLASS_MARK
;
return
(
hb_ot_layout_glyph_class_t
)
properties
;
...
...
src/hb-private.h
浏览文件 @
54e5aac5
...
...
@@ -52,4 +52,11 @@
#define ASSERT_SIZE(_type, _size) ASSERT_STATIC (sizeof (_type) == (_size))
/*
* buffer
*/
/* XXX */
#define HB_BUFFER_GLYPH_PROPERTIES_UNKNOWN 0xFFFF
#endif
/* HB_PRIVATE_H */
src/main.cc
浏览文件 @
54e5aac5
...
...
@@ -63,21 +63,21 @@ main (int argc, char **argv)
break
;
}
int
num_fonts
=
ot
.
get_
len
();
int
num_fonts
=
ot
.
get_
face_count
();
printf
(
"%d font(s) found in file
\n
"
,
num_fonts
);
for
(
int
n_font
=
0
;
n_font
<
num_fonts
;
n_font
++
)
{
const
OpenTypeFontFace
&
font
=
ot
[
n_font
]
;
const
OpenTypeFontFace
&
font
=
ot
.
get_face
(
n_font
)
;
printf
(
"Font %d of %d:
\n
"
,
n_font
+
1
,
num_fonts
);
int
num_tables
=
font
.
get_
len
();
int
num_tables
=
font
.
get_
table_count
();
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
]
;
const
OpenTypeTable
&
table
=
font
.
get_table
(
n_table
)
;
printf
(
" Table %2d of %2d: %.4s (0x%08lx+0x%08lx)
\n
"
,
n_table
+
1
,
num_tables
,
(
const
char
*
)
table
.
get_tag
(),
table
.
get_offset
(),
table
.
get_length
());
if
(
table
.
get_tag
()
==
"GSUB"
||
table
.
get_tag
()
==
"GPOS"
)
{
const
GSUBGPOS
&
g
=
GSUBGPOS
::
get_for_data
(
ot
[
table
]
);
if
(
table
.
get_tag
()
==
GSUBGPOS
::
GSUBTag
||
table
.
get_tag
()
==
GSUBGPOS
::
GPOSTag
)
{
const
GSUBGPOS
&
g
=
GSUBGPOS
::
get_for_data
(
ot
.
get_table_data
(
table
)
);
const
ScriptList
&
scripts
=
g
.
get_script_list
();
int
num_scripts
=
scripts
.
get_len
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录