Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
1e7c1fcb
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1e7c1fcb
编写于
10月 27, 2010
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move code around
上级
bf94b3ad
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
63 addition
and
61 deletion
+63
-61
src/hb-ot-layout-gpos-private.hh
src/hb-ot-layout-gpos-private.hh
+59
-0
src/hb-ot-layout.cc
src/hb-ot-layout.cc
+2
-57
src/hb-ot-layout.h
src/hb-ot-layout.h
+1
-3
src/hb-ot-shape.cc
src/hb-ot-shape.cc
+1
-1
未找到文件。
src/hb-ot-layout-gpos-private.hh
浏览文件 @
1e7c1fcb
...
@@ -1472,6 +1472,8 @@ struct GPOS : GSUBGPOS
...
@@ -1472,6 +1472,8 @@ struct GPOS : GSUBGPOS
hb_mask_t
mask
)
const
hb_mask_t
mask
)
const
{
return
get_lookup
(
lookup_index
).
apply_string
(
layout
,
buffer
,
mask
);
}
{
return
get_lookup
(
lookup_index
).
apply_string
(
layout
,
buffer
,
mask
);
}
static
inline
void
position_finish
(
hb_buffer_t
*
buffer
);
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
{
TRACE_SANITIZE
();
TRACE_SANITIZE
();
if
(
unlikely
(
!
GSUBGPOS
::
sanitize
(
c
)))
return
false
;
if
(
unlikely
(
!
GSUBGPOS
::
sanitize
(
c
)))
return
false
;
...
@@ -1482,6 +1484,63 @@ struct GPOS : GSUBGPOS
...
@@ -1482,6 +1484,63 @@ struct GPOS : GSUBGPOS
DEFINE_SIZE_STATIC
(
10
);
DEFINE_SIZE_STATIC
(
10
);
};
};
void
GPOS
::
position_finish
(
hb_buffer_t
*
buffer
)
{
unsigned
int
i
,
j
;
unsigned
int
len
=
hb_buffer_get_length
(
buffer
);
hb_glyph_position_t
*
pos
=
hb_buffer_get_glyph_positions
(
buffer
);
hb_direction_t
direction
=
buffer
->
props
.
direction
;
/* Handle cursive connections:
* First handle all chain-back connections, then handle all chain-forward connections. */
if
(
likely
(
HB_DIRECTION_IS_HORIZONTAL
(
direction
)))
{
for
(
j
=
0
;
j
<
len
;
j
++
)
{
if
(
pos
[
j
].
cursive_chain
()
<
0
)
pos
[
j
].
y_offset
+=
pos
[
j
+
pos
[
j
].
cursive_chain
()].
y_offset
;
}
for
(
i
=
len
;
i
>
0
;
i
--
)
{
j
=
i
-
1
;
if
(
pos
[
j
].
cursive_chain
()
>
0
)
pos
[
j
].
y_offset
+=
pos
[
j
+
pos
[
j
].
cursive_chain
()].
y_offset
;
}
}
else
{
for
(
j
=
0
;
j
<
len
;
j
++
)
{
if
(
pos
[
j
].
cursive_chain
()
<
0
)
pos
[
j
].
x_offset
+=
pos
[
j
+
pos
[
j
].
cursive_chain
()].
x_offset
;
}
for
(
i
=
len
;
i
>
0
;
i
--
)
{
j
=
i
-
1
;
if
(
pos
[
j
].
cursive_chain
()
>
0
)
pos
[
j
].
x_offset
+=
pos
[
j
+
pos
[
j
].
cursive_chain
()].
x_offset
;
}
}
/* Handle attachments */
for
(
i
=
0
;
i
<
len
;
i
++
)
if
(
pos
[
i
].
back
())
{
unsigned
int
back
=
i
-
pos
[
i
].
back
();
pos
[
i
].
x_offset
+=
pos
[
back
].
x_offset
;
pos
[
i
].
y_offset
+=
pos
[
back
].
y_offset
;
if
(
HB_DIRECTION_IS_BACKWARD
(
buffer
->
props
.
direction
))
for
(
j
=
back
+
1
;
j
<
i
+
1
;
j
++
)
{
pos
[
i
].
x_offset
+=
pos
[
j
].
x_advance
;
pos
[
i
].
y_offset
+=
pos
[
j
].
y_advance
;
}
else
for
(
j
=
back
;
j
<
i
;
j
++
)
{
pos
[
i
].
x_offset
-=
pos
[
j
].
x_advance
;
pos
[
i
].
y_offset
-=
pos
[
j
].
y_advance
;
}
}
}
/* Out-of-class implementation for methods recursing */
/* Out-of-class implementation for methods recursing */
...
...
src/hb-ot-layout.cc
浏览文件 @
1e7c1fcb
...
@@ -447,64 +447,9 @@ hb_ot_layout_position_lookup (hb_font_t *font,
...
@@ -447,64 +447,9 @@ hb_ot_layout_position_lookup (hb_font_t *font,
}
}
void
void
hb_ot_layout_position_finish
(
hb_font_t
*
font
HB_UNUSED
,
hb_ot_layout_position_finish
(
hb_buffer_t
*
buffer
)
hb_face_t
*
face
HB_UNUSED
,
hb_buffer_t
*
buffer
)
{
{
unsigned
int
i
,
j
;
GPOS
::
position_finish
(
buffer
);
unsigned
int
len
=
hb_buffer_get_length
(
buffer
);
hb_glyph_position_t
*
pos
=
hb_buffer_get_glyph_positions
(
buffer
);
hb_direction_t
direction
=
buffer
->
props
.
direction
;
/* TODO: Vertical */
/* Handle cursive connections:
* First handle all chain-back connections, then handle all chain-forward connections. */
if
(
likely
(
HB_DIRECTION_IS_HORIZONTAL
(
direction
)))
{
for
(
j
=
0
;
j
<
len
;
j
++
)
{
if
(
pos
[
j
].
cursive_chain
()
<
0
)
pos
[
j
].
y_offset
+=
pos
[
j
+
pos
[
j
].
cursive_chain
()].
y_offset
;
}
for
(
i
=
len
;
i
>
0
;
i
--
)
{
j
=
i
-
1
;
if
(
pos
[
j
].
cursive_chain
()
>
0
)
pos
[
j
].
y_offset
+=
pos
[
j
+
pos
[
j
].
cursive_chain
()].
y_offset
;
}
}
else
{
for
(
j
=
0
;
j
<
len
;
j
++
)
{
if
(
pos
[
j
].
cursive_chain
()
<
0
)
pos
[
j
].
x_offset
+=
pos
[
j
+
pos
[
j
].
cursive_chain
()].
x_offset
;
}
for
(
i
=
len
;
i
>
0
;
i
--
)
{
j
=
i
-
1
;
if
(
pos
[
j
].
cursive_chain
()
>
0
)
pos
[
j
].
x_offset
+=
pos
[
j
+
pos
[
j
].
cursive_chain
()].
x_offset
;
}
}
/* Handle attachments */
for
(
i
=
0
;
i
<
len
;
i
++
)
if
(
pos
[
i
].
back
())
{
unsigned
int
back
=
i
-
pos
[
i
].
back
();
pos
[
i
].
x_offset
+=
pos
[
back
].
x_offset
;
pos
[
i
].
y_offset
+=
pos
[
back
].
y_offset
;
if
(
HB_DIRECTION_IS_BACKWARD
(
buffer
->
props
.
direction
))
for
(
j
=
back
+
1
;
j
<
i
+
1
;
j
++
)
{
pos
[
i
].
x_offset
+=
pos
[
j
].
x_advance
;
pos
[
i
].
y_offset
+=
pos
[
j
].
y_advance
;
}
else
for
(
j
=
back
;
j
<
i
;
j
++
)
{
pos
[
i
].
x_offset
-=
pos
[
j
].
x_advance
;
pos
[
i
].
y_offset
-=
pos
[
j
].
y_advance
;
}
}
}
}
...
...
src/hb-ot-layout.h
浏览文件 @
1e7c1fcb
...
@@ -188,9 +188,7 @@ hb_ot_layout_position_lookup (hb_font_t *font,
...
@@ -188,9 +188,7 @@ hb_ot_layout_position_lookup (hb_font_t *font,
/* Should be called after all the position_lookup's are done */
/* Should be called after all the position_lookup's are done */
void
void
hb_ot_layout_position_finish
(
hb_font_t
*
font
,
hb_ot_layout_position_finish
(
hb_buffer_t
*
buffer
);
hb_face_t
*
face
,
hb_buffer_t
*
buffer
);
HB_END_DECLS
HB_END_DECLS
...
...
src/hb-ot-shape.cc
浏览文件 @
1e7c1fcb
...
@@ -121,7 +121,7 @@ hb_ot_position_complex (hb_ot_shape_context_t *c)
...
@@ -121,7 +121,7 @@ hb_ot_position_complex (hb_ot_shape_context_t *c)
c
->
plan
->
map
.
position
(
c
->
font
,
c
->
face
,
c
->
buffer
);
c
->
plan
->
map
.
position
(
c
->
font
,
c
->
face
,
c
->
buffer
);
hb_ot_layout_position_finish
(
c
->
font
,
c
->
face
,
c
->
buffer
);
hb_ot_layout_position_finish
(
c
->
buffer
);
c
->
applied_position_complex
=
TRUE
;
c
->
applied_position_complex
=
TRUE
;
return
;
return
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录