Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
0123976a
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看板
提交
0123976a
编写于
11月 06, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[kerx] Adjust CrossStream kern to match 'kern' table
上级
80a33b9a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
48 addition
and
14 deletion
+48
-14
src/hb-aat-layout-kerx-table.hh
src/hb-aat-layout-kerx-table.hh
+48
-14
未找到文件。
src/hb-aat-layout-kerx-table.hh
浏览文件 @
0123976a
...
...
@@ -179,7 +179,8 @@ struct KerxSubTableFormat1
* other subtables in kerx. Discovered via testing. */
kernAction
(
&
table
->
machine
+
table
->
kernAction
),
depth
(
0
),
crossStream
(
table
->
header
.
coverage
&
table
->
header
.
CrossStream
)
{}
crossStream
(
table
->
header
.
coverage
&
table
->
header
.
CrossStream
),
crossOffset
(
0
)
{}
inline
bool
is_actionable
(
StateTableDriver
<
MorxTypes
,
EntryData
>
*
driver
HB_UNUSED
,
const
Entry
<
EntryData
>
*
entry
)
...
...
@@ -215,36 +216,68 @@ struct KerxSubTableFormat1
}
hb_mask_t
kern_mask
=
c
->
plan
->
kern_mask
;
for
(
unsigned
int
i
=
0
;
i
<
depth
;
i
++
)
/* From Apple 'kern' spec:
* "Each pops one glyph from the kerning stack and applies the kerning value to it.
* The end of the list is marked by an odd value... */
unsigned
int
i
;
for
(
i
=
0
;
i
<
depth
;
i
++
)
if
(
actions
[
i
]
&
1
)
{
i
++
;
break
;
}
for
(;
i
;
i
--
)
{
/* Apparently, when spec says "Each pops one glyph from the kerning stack
* and applies the kerning value to it.", it doesn't mean it in that order.
* The deepest item in the stack corresponds to the first item in the action
* list. Discovered by testing. */
unsigned
int
idx
=
stack
[
i
];
int
v
=
*
actions
++
;
unsigned
int
idx
=
stack
[
depth
-
i
];
int
v
=
actions
[
i
-
1
];
/* "The end of the list is marked by an odd value..."
* Ignore it. */
v
&=
~
1
;
/* The following flag is undocumented in the spec, but described
* in the 'kern' table example. */
if
(
v
==
0x8000
)
{
crossOffset
=
0
;
v
=
0
;
}
if
(
idx
<
buffer
->
len
&&
buffer
->
info
[
idx
].
mask
&
kern_mask
)
{
if
(
HB_DIRECTION_IS_HORIZONTAL
(
buffer
->
props
.
direction
))
{
if
(
crossStream
)
buffer
->
pos
[
idx
].
y_offset
+=
c
->
font
->
em_scale_y
(
v
);
{
crossOffset
+=
v
;
if
(
!
buffer
->
pos
[
idx
].
y_offset
)
buffer
->
pos
[
idx
].
y_offset
+=
c
->
font
->
em_scale_y
(
crossOffset
);
}
else
{
buffer
->
pos
[
idx
].
x_advance
+=
c
->
font
->
em_scale_x
(
v
);
if
(
HB_DIRECTION_IS_BACKWARD
(
buffer
->
props
.
direction
))
if
(
!
buffer
->
pos
[
idx
].
x_offset
)
{
buffer
->
pos
[
idx
].
x_advance
+=
c
->
font
->
em_scale_x
(
v
);
buffer
->
pos
[
idx
].
x_offset
+=
c
->
font
->
em_scale_x
(
v
);
}
}
}
else
{
if
(
crossStream
)
buffer
->
pos
[
idx
].
x_offset
+=
c
->
font
->
em_scale_x
(
v
);
{
/* CoreText doesn't do crossStream kerning in vertical. */
//crossOffset += v;
//if (!buffer->pos[idx].x_offset)
// buffer->pos[idx].x_offset = c->font->em_scale_x (crossOffset);
}
else
{
buffer
->
pos
[
idx
].
y_advance
+=
c
->
font
->
em_scale_y
(
v
);
if
(
HB_DIRECTION_IS_BACKWARD
(
buffer
->
props
.
direction
))
if
(
!
buffer
->
pos
[
idx
].
y_offset
)
{
buffer
->
pos
[
idx
].
y_advance
+=
c
->
font
->
em_scale_y
(
v
);
buffer
->
pos
[
idx
].
y_offset
+=
c
->
font
->
em_scale_y
(
v
);
}
}
}
}
...
...
@@ -261,6 +294,7 @@ struct KerxSubTableFormat1
unsigned
int
stack
[
8
];
unsigned
int
depth
;
bool
crossStream
;
int
crossOffset
;
};
inline
bool
apply
(
hb_aat_apply_context_t
*
c
)
const
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录