Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
686567ba
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看板
提交
686567ba
编写于
2月 11, 2016
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[GPOS] Merge attach_chain() and cursive_chain()
Differentiate, using new attach_type().
上级
806ad8dc
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
32 addition
and
18 deletion
+32
-18
src/hb-ot-layout-gpos-table.hh
src/hb-ot-layout-gpos-table.hh
+32
-18
未找到文件。
src/hb-ot-layout-gpos-table.hh
浏览文件 @
686567ba
...
...
@@ -36,8 +36,17 @@ namespace OT {
/* buffer **position** var allocations */
#define attach_chain() var.i16[0]
/* glyph to which this attaches to, relative to current glyphs; negative for going back. */
#define cursive_chain() var.i16[1]
/* glyph to which this connects, may be positive or negative */
#define attach_chain() var.i16[0]
/* glyph to which this attaches to, relative to current glyphs; negative for going back, positive for forward. */
#define attach_type() var.u8[2]
/* attachment type */
/* Note! if attach_chain() is zero, the value of attach_type() is irrelevant. */
enum
attach_type_t
{
ATTACH_TYPE_NONE
=
0X00
,
/* Each attachment should be either a mark or a cursive; can't be both. */
ATTACH_TYPE_MARK
=
0X01
,
ATTACH_TYPE_CURSIVE
=
0X02
,
};
/* Shared Tables: ValueRecord, Anchor Table, and MarkArray */
...
...
@@ -425,6 +434,7 @@ struct MarkArray : ArrayOf<MarkRecord> /* Array of MarkRecords--in Coverage orde
hb_glyph_position_t
&
o
=
buffer
->
cur_pos
();
o
.
x_offset
=
base_x
-
mark_x
;
o
.
y_offset
=
base_y
-
mark_y
;
o
.
attach_type
()
=
ATTACH_TYPE_MARK
;
o
.
attach_chain
()
=
(
int
)
glyph_pos
-
(
int
)
buffer
->
idx
;
buffer
->
scratch_flags
|=
HB_BUFFER_SCRATCH_FLAG_HAS_GPOS_ATTACHMENT
;
...
...
@@ -993,7 +1003,8 @@ struct CursivePosFormat1
*/
reverse_cursive_minor_offset
(
pos
,
child
,
c
->
direction
,
parent
);
pos
[
child
].
cursive_chain
()
=
(
int
)
parent
-
(
int
)
child
;
pos
[
child
].
attach_type
()
=
ATTACH_TYPE_CURSIVE
;
pos
[
child
].
attach_chain
()
=
(
int
)
parent
-
(
int
)
child
;
buffer
->
scratch_flags
|=
HB_BUFFER_SCRATCH_FLAG_HAS_GPOS_CURSIVE
;
if
(
likely
(
HB_DIRECTION_IS_HORIZONTAL
(
c
->
direction
)))
pos
[
child
].
y_offset
=
y_offset
;
...
...
@@ -1518,14 +1529,13 @@ struct GPOS : GSUBGPOS
static
void
reverse_cursive_minor_offset
(
hb_glyph_position_t
*
pos
,
unsigned
int
i
,
hb_direction_t
direction
,
unsigned
int
new_parent
)
{
unsigned
int
j
=
pos
[
i
].
cursive_chain
();
if
(
likely
(
!
j
))
int
chain
=
pos
[
i
].
attach_chain
(),
type
=
pos
[
i
].
attach_type
();
if
(
likely
(
!
chain
||
0
==
(
type
&
ATTACH_TYPE_CURSIVE
)
))
return
;
int
old_chain
=
j
;
pos
[
i
].
cursive_chain
()
=
0
;
pos
[
i
].
attach_chain
()
=
0
;
j
+=
i
;
unsigned
int
j
=
(
int
)
i
+
chain
;
/* Stop if we see new parent in the chain. */
if
(
j
==
new_parent
)
...
...
@@ -1538,17 +1548,19 @@ reverse_cursive_minor_offset (hb_glyph_position_t *pos, unsigned int i, hb_direc
else
pos
[
j
].
x_offset
=
-
pos
[
i
].
x_offset
;
pos
[
j
].
cursive_chain
()
=
-
old_chain
;
pos
[
j
].
attach_chain
()
=
-
chain
;
pos
[
j
].
attach_type
()
=
type
;
}
static
void
fix_cursive_minor_offset
(
hb_glyph_position_t
*
pos
,
unsigned
int
i
,
hb_direction_t
direction
)
{
unsigned
int
j
=
pos
[
i
].
cursive_chain
();
if
(
likely
(
!
j
))
int
chain
=
pos
[
i
].
attach_chain
(),
type
=
pos
[
i
].
attach_type
();
if
(
likely
(
!
chain
||
0
==
(
type
&
ATTACH_TYPE_CURSIVE
)
))
return
;
pos
[
i
].
cursive_chain
()
=
0
;
j
+=
i
;
pos
[
i
].
attach_chain
()
=
0
;
unsigned
int
j
=
(
int
)
i
+
chain
;
fix_cursive_minor_offset
(
pos
,
j
,
direction
);
...
...
@@ -1561,15 +1573,17 @@ fix_cursive_minor_offset (hb_glyph_position_t *pos, unsigned int i, hb_direction
static
void
fix_mark_attachment
(
hb_glyph_position_t
*
pos
,
unsigned
int
i
,
hb_direction_t
direction
)
{
unsigned
int
j
=
pos
[
i
].
attach_chain
();
if
(
likely
(
!
j
))
int
chain
=
pos
[
i
].
attach_chain
(),
type
=
pos
[
i
].
attach_type
();
if
(
likely
(
!
chain
||
0
==
(
type
&
ATTACH_TYPE_MARK
)
))
return
;
j
+=
i
;
unsigned
int
j
=
(
int
)
i
+
chain
;
pos
[
i
].
x_offset
+=
pos
[
j
].
x_offset
;
pos
[
i
].
y_offset
+=
pos
[
j
].
y_offset
;
assert
(
j
<
i
);
if
(
HB_DIRECTION_IS_FORWARD
(
direction
))
for
(
unsigned
int
k
=
j
;
k
<
i
;
k
++
)
{
pos
[
i
].
x_offset
-=
pos
[
k
].
x_advance
;
...
...
@@ -1589,7 +1603,7 @@ GPOS::position_start (hb_font_t *font HB_UNUSED, hb_buffer_t *buffer)
unsigned
int
count
=
buffer
->
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
buffer
->
pos
[
i
].
attach_chain
()
=
buffer
->
pos
[
i
].
cursive_chain
()
=
0
;
buffer
->
pos
[
i
].
attach_chain
()
=
buffer
->
pos
[
i
].
attach_type
()
=
0
;
}
void
...
...
@@ -1639,7 +1653,7 @@ template <typename context_t>
#undef attach_chain
#undef
cursive_chain
#undef
attach_type
}
/* namespace OT */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录