Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
731b13e4
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看板
提交
731b13e4
编写于
3月 04, 2019
作者:
M
Martin Hosken
提交者:
Behdad Esfahbod
3月 03, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix offset drift in graphite integration
上级
8a25868e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
19 addition
and
16 deletion
+19
-16
src/hb-graphite2.cc
src/hb-graphite2.cc
+19
-16
未找到文件。
src/hb-graphite2.cc
浏览文件 @
731b13e4
...
...
@@ -225,7 +225,7 @@ struct hb_graphite2_cluster_t {
unsigned
int
base_glyph
;
unsigned
int
num_glyphs
;
unsigned
int
cluster
;
floa
t
advance
;
unsigned
in
t
advance
;
};
hb_bool_t
...
...
@@ -253,7 +253,7 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan HB_UNUSED,
gr_segment
*
seg
=
nullptr
;
const
gr_slot
*
is
;
unsigned
int
ci
=
0
,
ic
=
0
;
float
curradvx
=
0.
,
curradvy
=
0.
;
unsigned
int
curradvx
=
0
,
curradvy
=
0
;
unsigned
int
scratch_size
;
hb_buffer_t
::
scratch_buffer_t
*
scratch
=
buffer
->
get_scratch_buffer
(
&
scratch_size
);
...
...
@@ -324,11 +324,15 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan HB_UNUSED,
hb_codepoint_t
*
pg
=
gids
;
clusters
[
0
].
cluster
=
buffer
->
info
[
0
].
cluster
;
float
curradv
=
0.
;
unsigned
int
upem
=
hb_face_get_upem
(
face
);
float
xscale
=
(
float
)
font
->
x_scale
/
upem
;
float
yscale
=
(
float
)
font
->
y_scale
/
upem
;
yscale
*=
yscale
/
xscale
;
unsigned
int
curradv
=
0
;
if
(
HB_DIRECTION_IS_BACKWARD
(
buffer
->
props
.
direction
))
{
curradv
=
gr_slot_origin_X
(
gr_seg_first_slot
(
seg
));
clusters
[
0
].
advance
=
gr_seg_advance_X
(
seg
)
-
curradv
;
curradv
=
gr_slot_origin_X
(
gr_seg_first_slot
(
seg
))
*
xscale
;
clusters
[
0
].
advance
=
gr_seg_advance_X
(
seg
)
*
xscale
-
curradv
;
}
else
clusters
[
0
].
advance
=
0
;
...
...
@@ -355,14 +359,17 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan HB_UNUSED,
c
->
base_glyph
=
ic
;
c
->
num_glyphs
=
0
;
if
(
HB_DIRECTION_IS_BACKWARD
(
buffer
->
props
.
direction
))
c
->
advance
=
curradv
-
gr_slot_origin_X
(
is
);
{
c
->
advance
=
curradv
-
gr_slot_origin_X
(
is
)
*
xscale
;
curradv
-=
c
->
advance
;
}
else
{
c
->
advance
=
0
;
clusters
[
ci
].
advance
+=
gr_slot_origin_X
(
is
)
-
curradv
;
clusters
[
ci
].
advance
+=
gr_slot_origin_X
(
is
)
*
xscale
-
curradv
;
curradv
+=
clusters
[
ci
].
advance
;
}
ci
++
;
curradv
=
gr_slot_origin_X
(
is
);
}
clusters
[
ci
].
num_glyphs
++
;
...
...
@@ -373,7 +380,7 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan HB_UNUSED,
if
(
HB_DIRECTION_IS_BACKWARD
(
buffer
->
props
.
direction
))
clusters
[
ci
].
advance
+=
curradv
;
else
clusters
[
ci
].
advance
+=
gr_seg_advance_X
(
seg
)
-
curradv
;
clusters
[
ci
].
advance
+=
gr_seg_advance_X
(
seg
)
*
xscale
-
curradv
;
ci
++
;
for
(
unsigned
int
i
=
0
;
i
<
ci
;
++
i
)
...
...
@@ -388,10 +395,6 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan HB_UNUSED,
}
buffer
->
len
=
glyph_count
;
unsigned
int
upem
=
hb_face_get_upem
(
face
);
float
xscale
=
(
float
)
font
->
x_scale
/
upem
;
float
yscale
=
(
float
)
font
->
y_scale
/
upem
;
yscale
*=
yscale
/
xscale
;
/* Positioning. */
unsigned
int
currclus
=
(
unsigned
int
)
-
1
;
const
hb_glyph_info_t
*
info
=
buffer
->
info
;
...
...
@@ -404,7 +407,7 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan HB_UNUSED,
pPos
->
x_offset
=
gr_slot_origin_X
(
is
)
*
xscale
-
curradvx
;
pPos
->
y_offset
=
gr_slot_origin_Y
(
is
)
*
yscale
-
curradvy
;
if
(
info
->
cluster
!=
currclus
)
{
pPos
->
x_advance
=
info
->
var1
.
i32
*
xscale
;
pPos
->
x_advance
=
info
->
var1
.
i32
;
curradvx
+=
pPos
->
x_advance
;
currclus
=
info
->
cluster
;
}
else
...
...
@@ -421,7 +424,7 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan HB_UNUSED,
{
if
(
info
->
cluster
!=
currclus
)
{
pPos
->
x_advance
=
info
->
var1
.
i32
*
xscale
;
pPos
->
x_advance
=
info
->
var1
.
i32
;
curradvx
-=
pPos
->
x_advance
;
currclus
=
info
->
cluster
;
}
else
...
...
@@ -429,7 +432,7 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan HB_UNUSED,
pPos
->
y_advance
=
gr_slot_advance_Y
(
is
,
grface
,
nullptr
)
*
yscale
;
curradvy
-=
pPos
->
y_advance
;
pPos
->
x_offset
=
(
gr_slot_origin_X
(
is
)
-
info
->
var1
.
i32
)
*
xscale
-
curradvx
+
pPos
->
x_advance
;
pPos
->
x_offset
=
gr_slot_origin_X
(
is
)
*
xscale
-
info
->
var1
.
i32
-
curradvx
+
pPos
->
x_advance
;
pPos
->
y_offset
=
gr_slot_origin_Y
(
is
)
*
yscale
-
curradvy
;
}
hb_buffer_reverse_clusters
(
buffer
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录