Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
b2f687c2
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看板
提交
b2f687c2
编写于
11月 07, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[kerx] Use GPOS attachment facilities for CrossStream kerning
上级
e10a856e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
35 addition
and
16 deletion
+35
-16
src/hb-aat-layout-kerx-table.hh
src/hb-aat-layout-kerx-table.hh
+35
-16
未找到文件。
src/hb-aat-layout-kerx-table.hh
浏览文件 @
b2f687c2
...
@@ -236,9 +236,7 @@ struct KerxSubTableFormat1
...
@@ -236,9 +236,7 @@ struct KerxSubTableFormat1
* other subtables in kerx. Discovered via testing. */
* other subtables in kerx. Discovered via testing. */
kernAction
(
&
table
->
machine
+
table
->
kernAction
),
kernAction
(
&
table
->
machine
+
table
->
kernAction
),
depth
(
0
),
depth
(
0
),
crossStream
(
table
->
header
.
coverage
&
table
->
header
.
CrossStream
),
crossStream
(
table
->
header
.
coverage
&
table
->
header
.
CrossStream
)
{}
crossOffset
(
0
)
{}
/* TODO
/* TODO
* 'kern' table has this pecularity, we don't currently implement.
* 'kern' table has this pecularity, we don't currently implement.
...
@@ -307,21 +305,25 @@ struct KerxSubTableFormat1
...
@@ -307,21 +305,25 @@ struct KerxSubTableFormat1
/* "The end of the list is marked by an odd value..." Ignore it. */
/* "The end of the list is marked by an odd value..." Ignore it. */
v
&=
~
1
;
v
&=
~
1
;
hb_glyph_position_t
&
o
=
buffer
->
pos
[
idx
];
/* The following flag is undocumented in the spec, but described
/* The following flag is undocumented in the spec, but described
* in the 'kern' table example. */
* in the 'kern' table example. */
if
(
v
==
-
0x8000
)
if
(
v
==
-
0x8000
)
{
{
crossOffset
=
0
;
o
.
attach_type
()
=
ATTACH_TYPE_NONE
;
v
=
0
;
o
.
attach_chain
()
=
0
;
o
.
x_offset
=
o
.
y_offset
=
0
;
}
}
else
if
(
HB_DIRECTION_IS_HORIZONTAL
(
buffer
->
props
.
direction
))
if
(
HB_DIRECTION_IS_HORIZONTAL
(
buffer
->
props
.
direction
))
{
{
if
(
crossStream
)
if
(
crossStream
)
{
{
crossOffset
+=
v
;
if
(
buffer
->
pos
[
idx
].
attach_type
()
&&
!
buffer
->
pos
[
idx
].
y_offset
)
if
(
!
buffer
->
pos
[
idx
].
y_offset
)
{
buffer
->
pos
[
idx
].
y_offset
+=
c
->
font
->
em_scale_y
(
crossOffset
);
o
.
y_offset
=
c
->
font
->
em_scale_y
(
v
);
buffer
->
scratch_flags
|=
HB_BUFFER_SCRATCH_FLAG_HAS_GPOS_ATTACHMENT
;
}
}
}
else
if
(
buffer
->
info
[
idx
].
mask
&
kern_mask
)
else
if
(
buffer
->
info
[
idx
].
mask
&
kern_mask
)
{
{
...
@@ -337,9 +339,11 @@ struct KerxSubTableFormat1
...
@@ -337,9 +339,11 @@ struct KerxSubTableFormat1
if
(
crossStream
)
if
(
crossStream
)
{
{
/* CoreText doesn't do crossStream kerning in vertical. We do. */
/* CoreText doesn't do crossStream kerning in vertical. We do. */
crossOffset
+=
v
;
if
(
buffer
->
pos
[
idx
].
attach_type
()
&&
!
buffer
->
pos
[
idx
].
x_offset
)
if
(
!
buffer
->
pos
[
idx
].
x_offset
)
{
buffer
->
pos
[
idx
].
x_offset
=
c
->
font
->
em_scale_x
(
crossOffset
);
o
.
x_offset
=
c
->
font
->
em_scale_x
(
v
);
buffer
->
scratch_flags
|=
HB_BUFFER_SCRATCH_FLAG_HAS_GPOS_ATTACHMENT
;
}
}
}
else
if
(
buffer
->
info
[
idx
].
mask
&
kern_mask
)
else
if
(
buffer
->
info
[
idx
].
mask
&
kern_mask
)
{
{
...
@@ -353,8 +357,6 @@ struct KerxSubTableFormat1
...
@@ -353,8 +357,6 @@ struct KerxSubTableFormat1
}
}
depth
=
0
;
depth
=
0
;
}
}
else
buffer
->
pos
[
buffer
->
idx
].
y_offset
+=
c
->
font
->
em_scale_y
(
crossOffset
);
return
true
;
return
true
;
}
}
...
@@ -366,7 +368,6 @@ struct KerxSubTableFormat1
...
@@ -366,7 +368,6 @@ struct KerxSubTableFormat1
unsigned
int
stack
[
8
];
unsigned
int
stack
[
8
];
unsigned
int
depth
;
unsigned
int
depth
;
bool
crossStream
;
bool
crossStream
;
int
crossOffset
;
};
};
inline
bool
apply
(
hb_aat_apply_context_t
*
c
)
const
inline
bool
apply
(
hb_aat_apply_context_t
*
c
)
const
...
@@ -875,6 +876,7 @@ struct KerxTable
...
@@ -875,6 +876,7 @@ struct KerxTable
{
{
typedef
typename
T
::
SubTable
SubTable
;
typedef
typename
T
::
SubTable
SubTable
;
bool
seenCrossStream
=
false
;
c
->
set_lookup_index
(
0
);
c
->
set_lookup_index
(
0
);
const
SubTable
*
st
=
&
thiz
()
->
firstSubTable
;
const
SubTable
*
st
=
&
thiz
()
->
firstSubTable
;
unsigned
int
count
=
thiz
()
->
tableCount
;
unsigned
int
count
=
thiz
()
->
tableCount
;
...
@@ -894,6 +896,23 @@ struct KerxTable
...
@@ -894,6 +896,23 @@ struct KerxTable
if
(
!
c
->
buffer
->
message
(
c
->
font
,
"start %c%c%c%c subtable %d"
,
HB_UNTAG
(
thiz
()
->
tableTag
),
c
->
lookup_index
))
if
(
!
c
->
buffer
->
message
(
c
->
font
,
"start %c%c%c%c subtable %d"
,
HB_UNTAG
(
thiz
()
->
tableTag
),
c
->
lookup_index
))
goto
skip
;
goto
skip
;
if
(
!
seenCrossStream
&&
(
st
->
u
.
header
.
coverage
&
st
->
u
.
header
.
CrossStream
))
{
/* Attach all glyphs into a chain. */
seenCrossStream
=
true
;
hb_glyph_position_t
*
pos
=
c
->
buffer
->
pos
;
unsigned
int
count
=
c
->
buffer
->
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
{
pos
[
i
].
attach_type
()
=
ATTACH_TYPE_CURSIVE
;
pos
[
i
].
attach_chain
()
=
HB_DIRECTION_IS_FORWARD
(
c
->
buffer
->
props
.
direction
)
?
-
1
:
+
1
;
/* We intentionally don't set HB_BUFFER_SCRATCH_FLAG_HAS_GPOS_ATTACHMENT,
* since there needs to be a non-zero attachment for post-positioning to
* be needed. */
}
}
if
(
reverse
)
if
(
reverse
)
c
->
buffer
->
reverse
();
c
->
buffer
->
reverse
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录