Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
9db8ad75
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看板
提交
9db8ad75
编写于
11月 06, 2009
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add hb_ot_layout_position_finish()
We expect buffer to be setup with default positions before GPOS.
上级
edb54e9a
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
69 addition
and
24 deletion
+69
-24
src/hb-buffer-private.h
src/hb-buffer-private.h
+1
-5
src/hb-buffer.h
src/hb-buffer.h
+1
-10
src/hb-ot-layout-gpos-private.hh
src/hb-ot-layout-gpos-private.hh
+4
-4
src/hb-ot-layout.cc
src/hb-ot-layout.cc
+52
-0
src/hb-ot-layout.h
src/hb-ot-layout.h
+11
-5
未找到文件。
src/hb-buffer-private.h
浏览文件 @
9db8ad75
...
...
@@ -51,11 +51,7 @@ typedef struct _hb_internal_glyph_position_t {
hb_position_t
y_advance
;
hb_position_t
x_offset
;
hb_position_t
y_offset
;
uint32_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 */
uint32_t
back
:
15
;
/* number of glyphs to go back
uint32_t
back
:
16
;
/* number of glyphs to go back
for drawing current glyph */
int32_t
cursive_chain
:
16
;
/* character to which this connects,
may be positive or negative; used
...
...
src/hb-buffer.h
浏览文件 @
9db8ad75
...
...
@@ -56,16 +56,7 @@ typedef struct _hb_glyph_position_t {
hb_position_t
y_advance
;
hb_position_t
x_offset
;
hb_position_t
y_offset
;
/* XXX these should all be replaced by "uint32_t internal" */
uint32_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 */
uint32_t
back
:
15
;
/* number of glyphs to go back
for drawing current glyph */
int32_t
cursive_chain
:
16
;
/* character to which this connects,
may be positive or negative; used
only internally */
uint32_t
internal
;
}
hb_glyph_position_t
;
...
...
src/hb-ot-layout-gpos-private.hh
浏览文件 @
9db8ad75
...
...
@@ -840,13 +840,13 @@ struct CursivePosFormat1
if
(
buffer
->
direction
==
HB_DIRECTION_RTL
)
{
POSITION
(
buffer
->
in_pos
)
->
x_advance
=
entry_x
-
gpi
->
anchor_x
;
POSITION
(
buffer
->
in_pos
)
->
new_advance
=
true
;
/* advance is absolute, not relative */
POSITION
(
buffer
->
in_pos
)
->
x_advance
=
entry_x
-
gpi
->
anchor_x
;
}
else
{
POSITION
(
last_pos
)
->
x_advance
=
gpi
->
anchor_x
-
entry_x
;
POSITION
(
last_pos
)
->
new_advance
=
true
;
/* advance is absolute, not relative */
POSITION
(
last_pos
)
->
x_advance
=
gpi
->
anchor_x
-
entry_x
;
}
if
(
lookup_flag
&
LookupFlag
::
RightToLeft
)
...
...
src/hb-ot-layout.cc
浏览文件 @
9db8ad75
...
...
@@ -564,3 +564,55 @@ hb_ot_layout_position_lookup (hb_face_t *face,
context
.
face
=
face
;
return
_get_gpos
(
face
).
position_lookup
(
&
context
,
buffer
,
lookup_index
,
mask
);
}
#include <stdio.h>
void
hb_ot_layout_position_finish
(
hb_face_t
*
face
,
hb_font_t
*
font
,
hb_buffer_t
*
buffer
)
{
unsigned
int
i
,
j
;
unsigned
int
len
=
hb_buffer_get_length
(
buffer
);
hb_internal_glyph_position_t
*
positions
=
(
hb_internal_glyph_position_t
*
)
hb_buffer_get_glyph_positions
(
buffer
);
/* TODO: Vertical */
/* Handle cursive connections */
/* First handle all left-to-right connections */
for
(
j
=
0
;
j
<
len
;
j
++
)
{
if
(
positions
[
j
].
cursive_chain
>
0
)
{
printf
(
"0000000000000
\n
"
);
positions
[
j
].
y_offset
+=
positions
[
j
-
positions
[
j
].
cursive_chain
].
y_offset
;
positions
[
j
].
cursive_chain
=
0
;
}
}
/* Then handle all right-to-left connections */
for
(
i
=
len
;
i
>
0
;
i
--
)
{
j
=
i
-
1
;
if
(
positions
[
j
].
cursive_chain
<
0
)
{
positions
[
j
].
y_offset
+=
positions
[
j
-
positions
[
j
].
cursive_chain
].
y_offset
;
positions
[
j
].
cursive_chain
=
0
;
}
}
/* Handle attachments */
for
(
i
=
0
;
i
<
len
;
i
++
)
if
(
positions
[
i
].
back
)
{
unsigned
int
back
=
i
-
positions
[
i
].
back
;
positions
[
i
].
back
=
0
;
positions
[
i
].
x_offset
+=
positions
[
back
].
x_offset
;
positions
[
i
].
y_offset
+=
positions
[
back
].
y_offset
;
if
(
buffer
->
direction
==
HB_DIRECTION_RTL
)
for
(
j
=
back
+
1
;
j
<
i
+
1
;
j
++
)
{
positions
[
i
].
x_offset
+=
positions
[
j
].
x_advance
;
positions
[
i
].
y_offset
+=
positions
[
j
].
y_advance
;
}
else
for
(
j
=
back
;
j
<
i
;
j
++
)
{
positions
[
i
].
x_offset
-=
positions
[
j
].
x_advance
;
positions
[
i
].
y_offset
-=
positions
[
j
].
y_advance
;
}
}
}
src/hb-ot-layout.h
浏览文件 @
9db8ad75
...
...
@@ -198,11 +198,17 @@ hb_bool_t
hb_ot_layout_has_positioning
(
hb_face_t
*
face
);
hb_bool_t
hb_ot_layout_position_lookup
(
hb_face_t
*
face
,
hb_font_t
*
font
,
hb_buffer_t
*
buffer
,
unsigned
int
lookup_index
,
hb_mask_t
mask
);
hb_ot_layout_position_lookup
(
hb_face_t
*
face
,
hb_font_t
*
font
,
hb_buffer_t
*
buffer
,
unsigned
int
lookup_index
,
hb_mask_t
mask
);
/* Should be called after all the position_lookup's are done */
void
hb_ot_layout_position_finish
(
hb_face_t
*
face
,
hb_font_t
*
font
,
hb_buffer_t
*
buffer
);
HB_END_DECLS
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录