Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
86bcbd65
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看板
提交
86bcbd65
编写于
12月 17, 2015
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[arabic] Use glyph advance width in apply_stch() instead of extents
That seems to be what Windows is doing, and makes more sense.
上级
f11c11a1
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
7 addition
and
17 deletion
+7
-17
src/hb-ot-shape-complex-arabic.cc
src/hb-ot-shape-complex-arabic.cc
+7
-17
未找到文件。
src/hb-ot-shape-complex-arabic.cc
浏览文件 @
86bcbd65
...
...
@@ -463,10 +463,6 @@ apply_stch (const hb_ot_shape_plan_t *plan,
* Second pass applies the stretch, copying things to the end of buffer.
*/
/* 30 = 2048 / 70.
* https://www.microsoft.com/typography/cursivescriptguidelines.mspx */
hb_position_t
overlap
=
font
->
x_scale
/
30
;
DEBUG_MSG
(
ARABIC
,
NULL
,
"overlap for stretching is %d"
,
overlap
);
int
sign
=
font
->
x_scale
<
0
?
-
1
:
+
1
;
unsigned
int
extra_glyphs_needed
=
0
;
// Set during MEASURE, used during CUT
typedef
enum
{
MEASURE
,
CUT
}
step_t
;
...
...
@@ -504,18 +500,15 @@ apply_stch (const hb_ot_shape_plan_t *plan,
hb_in_range
<
unsigned
>
(
info
[
i
-
1
].
arabic_shaping_action
(),
STCH_FIXED
,
STCH_REPEATING
))
{
i
--
;
hb_glyph_extents_t
extents
;
if
(
!
font
->
get_glyph_extents
(
info
[
i
].
codepoint
,
&
extents
))
extents
.
width
=
0
;
extents
.
width
-=
overlap
;
hb_position_t
width
=
font
->
get_glyph_h_advance
(
info
[
i
].
codepoint
);
if
(
info
[
i
].
arabic_shaping_action
()
==
STCH_FIXED
)
{
w_fixed
+=
extents
.
width
;
w_fixed
+=
width
;
n_fixed
++
;
}
else
{
w_repeating
+=
extents
.
width
;
w_repeating
+=
width
;
n_repeating
++
;
}
}
...
...
@@ -540,7 +533,7 @@ apply_stch (const hb_ot_shape_plan_t *plan,
/* Number of additional times to repeat each repeating tile. */
int
n_copies
=
0
;
hb_position_t
w_remaining
=
w_total
-
w_fixed
-
overlap
;
hb_position_t
w_remaining
=
w_total
-
w_fixed
;
if
(
sign
*
w_remaining
>
sign
*
w_repeating
&&
sign
*
w_repeating
>
0
)
n_copies
=
(
sign
*
w_remaining
)
/
(
sign
*
w_repeating
)
-
1
;
...
...
@@ -562,13 +555,10 @@ apply_stch (const hb_ot_shape_plan_t *plan,
}
else
{
hb_position_t
x_offset
=
-
overlap
;
hb_position_t
x_offset
=
0
;
for
(
unsigned
int
k
=
end
;
k
>
start
;
k
--
)
{
hb_glyph_extents_t
extents
;
if
(
!
font
->
get_glyph_extents
(
info
[
k
-
1
].
codepoint
,
&
extents
))
extents
.
width
=
0
;
extents
.
width
-=
overlap
;
hb_position_t
width
=
font
->
get_glyph_h_advance
(
info
[
k
-
1
].
codepoint
);
unsigned
int
repeat
=
1
;
if
(
info
[
k
-
1
].
arabic_shaping_action
()
==
STCH_REPEATING
)
...
...
@@ -578,7 +568,7 @@ apply_stch (const hb_ot_shape_plan_t *plan,
repeat
,
info
[
k
-
1
].
codepoint
,
j
);
for
(
unsigned
int
n
=
0
;
n
<
repeat
;
n
++
)
{
x_offset
-=
extents
.
width
;
x_offset
-=
width
;
if
(
n
>
0
)
x_offset
+=
extra_repeat_overlap
;
pos
[
k
-
1
].
x_offset
=
x_offset
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录