Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
97d7c3a1
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
接近 2 年 前同步成功
通知
1
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看板
提交
97d7c3a1
编写于
7月 22, 2015
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[graphite2] Fix bunch of stuff
Based on patch from Martin Hosken, with review from Jonathan and I.
上级
ea7f8414
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
54 addition
and
28 deletion
+54
-28
src/hb-graphite2.cc
src/hb-graphite2.cc
+54
-28
未找到文件。
src/hb-graphite2.cc
浏览文件 @
97d7c3a1
...
...
@@ -228,12 +228,11 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan,
int
lang_len
=
lang_end
?
lang_end
-
lang
:
-
1
;
gr_feature_val
*
feats
=
gr_face_featureval_for_lang
(
grface
,
lang
?
hb_tag_from_string
(
lang
,
lang_len
)
:
0
);
while
(
num_features
--
)
for
(
unsigned
int
i
=
0
;
i
<
num_features
;
i
++
)
{
const
gr_feature_ref
*
fref
=
gr_face_find_fref
(
grface
,
features
->
tag
);
const
gr_feature_ref
*
fref
=
gr_face_find_fref
(
grface
,
features
[
i
].
tag
);
if
(
fref
)
gr_fref_set_feature_value
(
fref
,
features
->
value
,
feats
);
features
++
;
gr_fref_set_feature_value
(
fref
,
features
[
i
].
value
,
feats
);
}
gr_segment
*
seg
=
NULL
;
...
...
@@ -249,6 +248,8 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan,
for
(
unsigned
int
i
=
0
;
i
<
buffer
->
len
;
++
i
)
chars
[
i
]
=
buffer
->
info
[
i
].
codepoint
;
/* TODO ensure_native_direction. */
hb_tag_t
script_tag
[
2
];
hb_ot_tags_from_script
(
hb_buffer_get_script
(
buffer
),
&
script_tag
[
0
],
&
script_tag
[
1
]);
...
...
@@ -267,10 +268,11 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan,
if
(
unlikely
(
!
glyph_count
))
{
if
(
feats
)
gr_featureval_destroy
(
feats
);
gr_seg_destroy
(
seg
);
return
false
;
buffer
->
len
=
0
;
return
true
;
}
buffer
->
ensure
(
glyph_count
);
buffer
->
ensure
(
glyph_count
);
scratch
=
buffer
->
get_scratch_buffer
(
&
scratch_size
);
while
((
DIV_CEIL
(
sizeof
(
hb_graphite2_cluster_t
)
*
buffer
->
len
,
sizeof
(
*
scratch
))
+
DIV_CEIL
(
sizeof
(
hb_codepoint_t
)
*
glyph_count
,
sizeof
(
*
scratch
)))
>
scratch_size
)
...
...
@@ -332,7 +334,6 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan,
}
ci
++
;
//buffer->clear_output ();
for
(
unsigned
int
i
=
0
;
i
<
ci
;
++
i
)
{
for
(
unsigned
int
j
=
0
;
j
<
clusters
[
i
].
num_glyphs
;
++
j
)
...
...
@@ -343,32 +344,57 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan,
}
}
buffer
->
len
=
glyph_count
;
//buffer->swap_buffers ();
if
(
HB_DIRECTION_IS_BACKWARD
(
buffer
->
props
.
direction
))
curradvx
=
gr_seg_advance_X
(
seg
);
hb_glyph_position_t
*
pPos
;
for
(
pPos
=
hb_buffer_get_glyph_positions
(
buffer
,
NULL
),
is
=
gr_seg_first_slot
(
seg
);
is
;
pPos
++
,
is
=
gr_slot_next_in_segment
(
is
))
/* Positioning. */
if
(
!
HB_DIRECTION_IS_BACKWARD
(
buffer
->
props
.
direction
))
{
pPos
->
x_offset
=
gr_slot_origin_X
(
is
)
-
curradvx
;
pPos
->
y_offset
=
gr_slot_origin_Y
(
is
)
-
curradvy
;
pPos
->
x_advance
=
gr_slot_advance_X
(
is
,
grface
,
grfont
);
pPos
->
y_advance
=
gr_slot_advance_Y
(
is
,
grface
,
grfont
);
if
(
HB_DIRECTION_IS_BACKWARD
(
buffer
->
props
.
direction
))
curradvx
-=
pPos
->
x_advance
;
pPos
->
x_offset
=
gr_slot_origin_X
(
is
)
-
curradvx
;
if
(
!
HB_DIRECTION_IS_BACKWARD
(
buffer
->
props
.
direction
))
hb_glyph_position_t
*
pPos
;
for
(
pPos
=
hb_buffer_get_glyph_positions
(
buffer
,
NULL
),
is
=
gr_seg_first_slot
(
seg
)
;
is
;
pPos
++
,
is
=
gr_slot_next_in_segment
(
is
))
{
pPos
->
x_offset
=
gr_slot_origin_X
(
is
)
-
curradvx
;
pPos
->
y_offset
=
gr_slot_origin_Y
(
is
)
-
curradvy
;
pPos
->
x_advance
=
gr_slot_advance_X
(
is
,
grface
,
grfont
)
;
pPos
->
y_advance
=
gr_slot_advance_Y
(
is
,
grface
,
grfont
);
curradvx
+=
pPos
->
x_advance
;
pPos
->
y_offset
=
gr_slot_origin_Y
(
is
)
-
curradvy
;
curradvy
+=
pPos
->
y_advance
;
}
if
(
!
HB_DIRECTION_IS_BACKWARD
(
buffer
->
props
.
direction
))
curradvy
+=
pPos
->
y_advance
;
}
pPos
[
-
1
].
x_advance
+=
gr_seg_advance_X
(
seg
)
-
curradvx
;
if
(
HB_DIRECTION_IS_BACKWARD
(
buffer
->
props
.
direction
))
}
else
{
hb_glyph_position_t
*
pPos
=
hb_buffer_get_glyph_positions
(
buffer
,
NULL
)
+
buffer
->
len
-
1
;
const
hb_glyph_info_t
*
info
=
buffer
->
info
+
buffer
->
len
-
1
;
const
hb_glyph_info_t
*
tinfo
;
const
gr_slot
*
tis
;
int
currclus
=
-
1
;
float
clusx
=
0.
,
clusy
=
0.
;
for
(
is
=
gr_seg_last_slot
(
seg
);
is
;
pPos
--
,
info
--
,
is
=
gr_slot_prev_in_segment
(
is
))
{
if
(
info
->
cluster
!=
currclus
)
{
curradvx
+=
clusx
;
curradvy
+=
clusy
;
currclus
=
info
->
cluster
;
clusx
=
0.
;
clusy
=
0.
;
for
(
tis
=
is
,
tinfo
=
info
;
tis
&&
tinfo
->
cluster
==
currclus
;
tis
=
gr_slot_prev_in_segment
(
tis
),
tinfo
--
)
{
clusx
+=
gr_slot_advance_X
(
tis
,
grface
,
grfont
);
clusy
+=
gr_slot_advance_Y
(
tis
,
grface
,
grfont
);
}
curradvx
+=
clusx
;
curradvy
+=
clusy
;
}
pPos
->
x_advance
=
gr_slot_advance_X
(
is
,
grface
,
grfont
);
pPos
->
y_advance
=
gr_slot_advance_Y
(
is
,
grface
,
grfont
);
curradvx
-=
pPos
->
x_advance
;
curradvy
-=
pPos
->
y_advance
;
pPos
->
x_offset
=
gr_slot_origin_X
(
is
)
-
curradvx
;
pPos
->
y_offset
=
gr_slot_origin_Y
(
is
)
-
curradvy
;
}
hb_buffer_reverse_clusters
(
buffer
);
}
if
(
feats
)
gr_featureval_destroy
(
feats
);
gr_seg_destroy
(
seg
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录