Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
f1322e52
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看板
提交
f1322e52
编写于
8月 01, 2009
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[HB] Cleanup public buffer structs
上级
6d5bb18e
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
97 addition
and
66 deletion
+97
-66
src/hb-buffer-private.h
src/hb-buffer-private.h
+38
-8
src/hb-buffer.c
src/hb-buffer.c
+25
-24
src/hb-buffer.h
src/hb-buffer.h
+17
-18
src/hb-ot-layout-gpos-private.h
src/hb-ot-layout-gpos-private.h
+4
-4
src/hb-ot-layout-private.h
src/hb-ot-layout-private.h
+3
-2
src/hb-ot-layout.cc
src/hb-ot-layout.cc
+10
-10
未找到文件。
src/hb-buffer-private.h
浏览文件 @
f1322e52
...
...
@@ -36,6 +36,36 @@ HB_BEGIN_DECLS
#define HB_BUFFER_GLYPH_PROPERTIES_UNKNOWN 0xFFFF
typedef
struct
_hb_internal_glyph_info_t
{
hb_codepoint_t
codepoint
;
uint32_t
properties
;
uint32_t
cluster
;
uint16_t
component
;
uint16_t
lig_id
;
uint32_t
gproperty
;
}
hb_internal_glyph_info_t
;
typedef
struct
_hb_internal_glyph_position_t
{
hb_position_t
x_pos
;
hb_position_t
y_pos
;
hb_position_t
x_advance
;
hb_position_t
y_advance
;
hb_bool_t
new_advance
:
1
;
/* if set, the advance width values are
absolute, i.e., they won't be
added to the original glyph's value
but rather replace them */
unsigned
short
back
:
15
;
/* number of glyphs to go back
for drawing current glyph */
short
cursive_chain
:
16
;
/* character to which this connects,
may be positive or negative; used
only internally */
}
hb_internal_glyph_position_t
;
ASSERT_STATIC
(
sizeof
(
hb_glyph_info_t
)
==
sizeof
(
hb_internal_glyph_info_t
));
ASSERT_STATIC
(
sizeof
(
hb_glyph_position_t
)
==
sizeof
(
hb_internal_glyph_position_t
));
ASSERT_STATIC
(
sizeof
(
hb_glyph_info_t
)
==
sizeof
(
hb_glyph_position_t
));
struct
_hb_buffer_t
{
hb_reference_count_t
ref_count
;
...
...
@@ -46,10 +76,10 @@ struct _hb_buffer_t {
unsigned
int
in_pos
;
unsigned
int
out_pos
;
hb_glyph_info_t
*
in_string
;
hb_glyph_info_t
*
out_string
;
hb_glyph_info_t
*
alt_string
;
hb_glyph_position_t
*
positions
;
hb_
internal_
glyph_info_t
*
in_string
;
hb_
internal_
glyph_info_t
*
out_string
;
hb_
internal_
glyph_info_t
*
alt_string
;
hb_
internal_
glyph_position_t
*
positions
;
hb_direction_t
direction
;
unsigned
int
max_lig_id
;
...
...
@@ -88,16 +118,16 @@ _hb_buffer_allocate_lig_id (hb_buffer_t *buffer);
/* convenience macros */
#define IN_GLYPH(pos) (buffer->in_string[(pos)].
gindex
)
#define IN_GLYPH(pos) (buffer->in_string[(pos)].
codepoint
)
#define IN_INFO(pos) (&buffer->in_string[(pos)])
#define IN_CURGLYPH() (buffer->in_string[buffer->in_pos].
gindex
)
#define IN_CURGLYPH() (buffer->in_string[buffer->in_pos].
codepoint
)
#define IN_CURINFO() (&buffer->in_string[buffer->in_pos])
#define IN_PROPERTIES(pos) (buffer->in_string[(pos)].properties)
#define IN_LIGID(pos) (buffer->in_string[(pos)].lig
ID
)
#define IN_LIGID(pos) (buffer->in_string[(pos)].lig
_id
)
#define IN_COMPONENT(pos) (buffer->in_string[(pos)].component)
#define POSITION(pos) (&buffer->positions[(pos)])
#define CURPOSITION() (&buffer->positions[buffer->in_pos])
#define OUT_GLYPH(pos) (buffer->out_string[(pos)].
gindex
)
#define OUT_GLYPH(pos) (buffer->out_string[(pos)].
codepoint
)
#define OUT_INFO(pos) (&buffer->out_string[(pos)])
HB_END_DECLS
...
...
src/hb-buffer.c
浏览文件 @
f1322e52
...
...
@@ -29,6 +29,7 @@
#include <string.h>
static
hb_buffer_t
_hb_buffer_nil
=
{
HB_REFERENCE_COUNT_INVALID
/* ref_count */
};
...
...
@@ -158,21 +159,21 @@ hb_buffer_ensure (hb_buffer_t *buffer, unsigned int size)
void
hb_buffer_add_glyph
(
hb_buffer_t
*
buffer
,
hb_codepoint_t
glyph_index
,
hb_codepoint_t
codepoint
,
unsigned
int
properties
,
unsigned
int
cluster
)
{
hb_glyph_info_t
*
glyph
;
hb_
internal_
glyph_info_t
*
glyph
;
hb_buffer_ensure
(
buffer
,
buffer
->
in_length
+
1
);
glyph
=
&
buffer
->
in_string
[
buffer
->
in_length
];
glyph
->
gindex
=
glyph_index
;
glyph
->
codepoint
=
codepoint
;
glyph
->
properties
=
properties
;
glyph
->
cluster
=
cluster
;
glyph
->
component
=
0
;
glyph
->
lig
ID
=
0
;
glyph
->
internal
=
HB_BUFFER_GLYPH_PROPERTIES_UNKNOWN
;
glyph
->
lig
_id
=
0
;
glyph
->
gproperty
=
HB_BUFFER_GLYPH_PROPERTIES_UNKNOWN
;
buffer
->
in_length
++
;
}
...
...
@@ -217,7 +218,7 @@ _hb_buffer_swap (hb_buffer_t *buffer)
if
(
buffer
->
out_string
!=
buffer
->
in_string
)
{
hb_glyph_info_t
*
tmp_string
;
hb_
internal_
glyph_info_t
*
tmp_string
;
tmp_string
=
buffer
->
in_string
;
buffer
->
in_string
=
buffer
->
out_string
;
buffer
->
out_string
=
tmp_string
;
...
...
@@ -243,9 +244,9 @@ _hb_buffer_swap (hb_buffer_t *buffer)
will copied `num_out' times, otherwise `component' itself will
be used to fill the `component' fields.
If `lig
ID' is 0xFFFF, the ligID
value from buffer->in_pos
will copied `num_out' times, otherwise `lig
ID
' itself will
be used to fill the `lig
ID
' fields.
If `lig
_id' is 0xFFFF, the lig_id
value from buffer->in_pos
will copied `num_out' times, otherwise `lig
_id
' itself will
be used to fill the `lig
_id
' fields.
The properties for all replacement glyphs are taken
from the glyph at position `buffer->in_pos'.
...
...
@@ -258,7 +259,7 @@ _hb_buffer_add_output_glyphs (hb_buffer_t *buffer,
unsigned
int
num_out
,
const
uint16_t
*
glyph_data_be
,
unsigned
short
component
,
unsigned
short
lig
ID
)
unsigned
short
lig
_id
)
{
unsigned
int
i
;
unsigned
int
properties
;
...
...
@@ -274,18 +275,18 @@ _hb_buffer_add_output_glyphs (hb_buffer_t *buffer,
cluster
=
buffer
->
in_string
[
buffer
->
in_pos
].
cluster
;
if
(
component
==
0xFFFF
)
component
=
buffer
->
in_string
[
buffer
->
in_pos
].
component
;
if
(
lig
ID
==
0xFFFF
)
lig
ID
=
buffer
->
in_string
[
buffer
->
in_pos
].
ligID
;
if
(
lig
_id
==
0xFFFF
)
lig
_id
=
buffer
->
in_string
[
buffer
->
in_pos
].
lig_id
;
for
(
i
=
0
;
i
<
num_out
;
i
++
)
{
hb_glyph_info_t
*
info
=
&
buffer
->
out_string
[
buffer
->
out_pos
+
i
];
info
->
gindex
=
hb_be_uint16
(
glyph_data_be
[
i
]);
hb_
internal_
glyph_info_t
*
info
=
&
buffer
->
out_string
[
buffer
->
out_pos
+
i
];
info
->
codepoint
=
hb_be_uint16
(
glyph_data_be
[
i
]);
info
->
properties
=
properties
;
info
->
cluster
=
cluster
;
info
->
component
=
component
;
info
->
lig
ID
=
ligID
;
info
->
internal
=
HB_BUFFER_GLYPH_PROPERTIES_UNKNOWN
;
info
->
lig
_id
=
lig_id
;
info
->
gproperty
=
HB_BUFFER_GLYPH_PROPERTIES_UNKNOWN
;
}
buffer
->
in_pos
+=
num_in
;
...
...
@@ -298,9 +299,9 @@ HB_INTERNAL void
_hb_buffer_add_output_glyph
(
hb_buffer_t
*
buffer
,
hb_codepoint_t
glyph_index
,
unsigned
short
component
,
unsigned
short
lig
ID
)
unsigned
short
lig
_id
)
{
hb_glyph_info_t
*
info
;
hb_
internal_
glyph_info_t
*
info
;
if
(
buffer
->
out_string
!=
buffer
->
in_string
)
{
...
...
@@ -311,12 +312,12 @@ _hb_buffer_add_output_glyph (hb_buffer_t *buffer,
buffer
->
out_string
[
buffer
->
out_pos
]
=
buffer
->
in_string
[
buffer
->
in_pos
];
info
=
&
buffer
->
out_string
[
buffer
->
out_pos
];
info
->
gindex
=
glyph_index
;
info
->
codepoint
=
glyph_index
;
if
(
component
!=
0xFFFF
)
info
->
component
=
component
;
if
(
lig
ID
!=
0xFFFF
)
info
->
lig
ID
=
ligID
;
info
->
internal
=
HB_BUFFER_GLYPH_PROPERTIES_UNKNOWN
;
if
(
lig
_id
!=
0xFFFF
)
info
->
lig
_id
=
lig_id
;
info
->
gproperty
=
HB_BUFFER_GLYPH_PROPERTIES_UNKNOWN
;
buffer
->
in_pos
++
;
buffer
->
out_pos
++
;
...
...
@@ -363,7 +364,7 @@ hb_buffer_get_len (hb_buffer_t *buffer)
hb_glyph_info_t
*
hb_buffer_get_glyph_infos
(
hb_buffer_t
*
buffer
)
{
return
buffer
->
in_string
;
return
(
hb_glyph_info_t
*
)
buffer
->
in_string
;
}
/* Return value valid as long as buffer not modified */
...
...
@@ -373,5 +374,5 @@ hb_buffer_get_glyph_positions (hb_buffer_t *buffer)
if
(
buffer
->
in_length
&&
!
buffer
->
positions
)
hb_buffer_clear_positions
(
buffer
);
return
buffer
->
positions
;
return
(
hb_glyph_position_t
*
)
buffer
->
positions
;
}
src/hb-buffer.h
浏览文件 @
f1322e52
...
...
@@ -41,15 +41,13 @@ typedef enum _hb_direction_t {
HB_DIRECTION_BTT
}
hb_direction_t
;
/* XXX these structs need review before we can commit to them */
typedef
struct
_hb_glyph_info_t
{
hb_codepoint_t
gindex
;
u
nsigned
int
properties
;
u
nsigned
int
cluster
;
u
nsigned
short
component
;
u
nsigned
short
ligID
;
u
nsigned
int
internal
;
hb_codepoint_t
codepoint
;
u
int32_t
properties
;
u
int32_t
cluster
;
u
int16_t
component
;
u
int16_t
lig_id
;
u
int32_t
internal
;
}
hb_glyph_info_t
;
typedef
struct
_hb_glyph_position_t
{
...
...
@@ -57,15 +55,16 @@ typedef struct _hb_glyph_position_t {
hb_position_t
y_pos
;
hb_position_t
x_advance
;
hb_position_t
y_advance
;
unsigned
short
back
;
/* number of glyphs to go back
for drawing current glyph */
hb_bool_t
new_advance
;
/* if set, the advance width values are
absolute, i.e., they won't be
added to the original glyph's value
but rather replace them */
short
cursive_chain
;
/* character to which this connects,
may be positive or negative; used
only internally */
/* XXX these should all be replaced by "uint32_t internal" */
hb_bool_t
new_advance
:
1
;
/* if set, the advance width values are
absolute, i.e., they won't be
added to the original glyph's value
but rather replace them */
unsigned
short
back
:
15
;
/* number of glyphs to go back
for drawing current glyph */
short
cursive_chain
:
16
;
/* character to which this connects,
may be positive or negative; used
only internally */
}
hb_glyph_position_t
;
...
...
@@ -103,7 +102,7 @@ hb_buffer_ensure (hb_buffer_t *buffer,
void
hb_buffer_add_glyph
(
hb_buffer_t
*
buffer
,
hb_codepoint_t
glyph_index
,
hb_codepoint_t
codepoint
,
unsigned
int
properties
,
unsigned
int
cluster
);
...
...
src/hb-ot-layout-gpos-private.h
浏览文件 @
f1322e52
...
...
@@ -58,7 +58,7 @@ struct ValueFormat : USHORT
const
void
apply_value
(
hb_ot_layout_t
*
layout
,
const
char
*
base
,
const
Value
*
values
,
hb_glyph_position_t
*
glyph_pos
)
const
hb_
internal_
glyph_position_t
*
glyph_pos
)
const
{
unsigned
int
x_ppem
,
y_ppem
;
hb_16dot16_t
x_scale
,
y_scale
;
...
...
@@ -825,7 +825,7 @@ struct MarkBasePosFormat1
unsigned
int
index
=
base_index
*
classCount
+
mark_class
;
(
&
base_array
+
base_array
.
matrix
[
index
]).
get_anchor
(
layout
,
IN_GLYPH
(
j
),
&
base_x
,
&
base_y
);
hb_glyph_position_t
*
o
=
POSITION
(
buffer
->
in_pos
);
hb_
internal_
glyph_position_t
*
o
=
POSITION
(
buffer
->
in_pos
);
o
->
x_pos
=
base_x
-
mark_x
;
o
->
y_pos
=
base_y
-
mark_y
;
o
->
x_advance
=
0
;
...
...
@@ -962,7 +962,7 @@ struct MarkLigPosFormat1
unsigned
int
index
=
comp_index
*
classCount
+
mark_class
;
(
&
lig_attach
+
lig_attach
.
matrix
[
index
]).
get_anchor
(
layout
,
IN_GLYPH
(
j
),
&
lig_x
,
&
lig_y
);
hb_glyph_position_t
*
o
=
POSITION
(
buffer
->
in_pos
);
hb_
internal_
glyph_position_t
*
o
=
POSITION
(
buffer
->
in_pos
);
o
->
x_pos
=
lig_x
-
mark_x
;
o
->
y_pos
=
lig_y
-
mark_y
;
o
->
x_advance
=
0
;
...
...
@@ -1077,7 +1077,7 @@ struct MarkMarkPosFormat1
unsigned
int
index
=
mark2_index
*
classCount
+
mark1_class
;
(
&
mark2_array
+
mark2_array
.
matrix
[
index
]).
get_anchor
(
layout
,
IN_GLYPH
(
j
),
&
mark2_x
,
&
mark2_y
);
hb_glyph_position_t
*
o
=
POSITION
(
buffer
->
in_pos
);
hb_
internal_
glyph_position_t
*
o
=
POSITION
(
buffer
->
in_pos
);
o
->
x_pos
=
mark2_x
-
mark1_x
;
o
->
y_pos
=
mark2_y
-
mark1_y
;
o
->
x_advance
=
0
;
...
...
src/hb-ot-layout-private.h
浏览文件 @
f1322e52
...
...
@@ -29,6 +29,7 @@
#include "hb-private.h"
#include "hb-ot-layout.h"
#include "hb-buffer-private.h"
typedef
unsigned
int
hb_ot_layout_class_t
;
...
...
@@ -78,13 +79,13 @@ _hb_ot_layout_set_glyph_property (hb_ot_layout_t *layout,
HB_INTERNAL
hb_bool_t
_hb_ot_layout_check_glyph_property
(
hb_ot_layout_t
*
layout
,
hb_glyph_info_t
*
ginfo
,
hb_
internal_
glyph_info_t
*
ginfo
,
unsigned
int
lookup_flags
,
unsigned
int
*
property
);
HB_INTERNAL
hb_bool_t
_hb_ot_layout_skip_mark
(
hb_ot_layout_t
*
layout
,
hb_glyph_info_t
*
ginfo
,
hb_
internal_
glyph_info_t
*
ginfo
,
unsigned
int
lookup_flags
,
unsigned
int
*
property
);
...
...
src/hb-ot-layout.cc
浏览文件 @
f1322e52
...
...
@@ -176,15 +176,15 @@ _hb_ot_layout_get_glyph_property (hb_ot_layout_t *layout,
HB_INTERNAL
hb_bool_t
_hb_ot_layout_check_glyph_property
(
hb_ot_layout_t
*
layout
,
hb_glyph_info_t
*
ginfo
,
hb_
internal_
glyph_info_t
*
ginfo
,
unsigned
int
lookup_flags
,
unsigned
int
*
property_out
)
{
unsigned
int
property
;
if
(
ginfo
->
internal
==
HB_BUFFER_GLYPH_PROPERTIES_UNKNOWN
)
ginfo
->
internal
=
_hb_ot_layout_get_glyph_property
(
layout
,
ginfo
->
gindex
);
property
=
ginfo
->
internal
;
if
(
ginfo
->
gproperty
==
HB_BUFFER_GLYPH_PROPERTIES_UNKNOWN
)
ginfo
->
gproperty
=
_hb_ot_layout_get_glyph_property
(
layout
,
ginfo
->
codepoint
);
property
=
ginfo
->
gproperty
;
if
(
property_out
)
*
property_out
=
property
;
...
...
@@ -200,7 +200,7 @@ _hb_ot_layout_check_glyph_property (hb_ot_layout_t *layout,
* lookup_flags has the set index.
*/
if
(
lookup_flags
&
LookupFlag
::
UseMarkFilteringSet
)
return
layout
->
gdef
->
mark_set_covers
(
lookup_flags
>>
16
,
ginfo
->
gindex
);
return
layout
->
gdef
->
mark_set_covers
(
lookup_flags
>>
16
,
ginfo
->
codepoint
);
/* The second byte of lookup_flags has the meaning
* "ignore marks of attachment type different than
...
...
@@ -215,15 +215,15 @@ _hb_ot_layout_check_glyph_property (hb_ot_layout_t *layout,
HB_INTERNAL
hb_bool_t
_hb_ot_layout_skip_mark
(
hb_ot_layout_t
*
layout
,
hb_glyph_info_t
*
ginfo
,
hb_
internal_
glyph_info_t
*
ginfo
,
unsigned
int
lookup_flags
,
unsigned
int
*
property_out
)
{
unsigned
int
property
;
if
(
ginfo
->
internal
==
HB_BUFFER_GLYPH_PROPERTIES_UNKNOWN
)
ginfo
->
internal
=
_hb_ot_layout_get_glyph_property
(
layout
,
ginfo
->
gindex
);
property
=
ginfo
->
internal
;
if
(
ginfo
->
gproperty
==
HB_BUFFER_GLYPH_PROPERTIES_UNKNOWN
)
ginfo
->
gproperty
=
_hb_ot_layout_get_glyph_property
(
layout
,
ginfo
->
codepoint
);
property
=
ginfo
->
gproperty
;
if
(
property_out
)
*
property_out
=
property
;
...
...
@@ -235,7 +235,7 @@ _hb_ot_layout_skip_mark (hb_ot_layout_t *layout,
/* If using mark filtering sets, the high short of lookup_flags has the set index. */
if
(
lookup_flags
&
LookupFlag
::
UseMarkFilteringSet
)
return
!
layout
->
gdef
->
mark_set_covers
(
lookup_flags
>>
16
,
ginfo
->
gindex
);
return
!
layout
->
gdef
->
mark_set_covers
(
lookup_flags
>>
16
,
ginfo
->
codepoint
);
/* The second byte of lookup_flags has the meaning "ignore marks of attachment type
* different than the attachment type specified." */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录