Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
5b178535
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看板
提交
5b178535
编写于
11月 07, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[kern/kerx] Share Format0
上级
c97dde5d
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
23 addition
and
49 deletion
+23
-49
src/hb-aat-layout-kerx-table.hh
src/hb-aat-layout-kerx-table.hh
+16
-6
src/hb-ot-kern-table.hh
src/hb-ot-kern-table.hh
+7
-43
未找到文件。
src/hb-aat-layout-kerx-table.hh
浏览文件 @
5b178535
...
...
@@ -93,6 +93,14 @@ struct KernPair
template
<
typename
KernSubTableHeader
>
struct
KerxSubTableFormat0
{
inline
int
get_kerning
(
hb_codepoint_t
left
,
hb_codepoint_t
right
)
const
{
hb_glyph_pair_t
pair
=
{
left
,
right
};
int
i
=
pairs
.
bsearch
(
pair
);
if
(
i
==
-
1
)
return
0
;
return
pairs
[
i
].
get_kerning
();
}
inline
int
get_kerning
(
hb_codepoint_t
left
,
hb_codepoint_t
right
,
hb_aat_apply_context_t
*
c
)
const
{
...
...
@@ -100,7 +108,7 @@ struct KerxSubTableFormat0
int
i
=
pairs
.
bsearch
(
pair
);
if
(
i
==
-
1
)
return
0
;
int
v
=
pairs
[
i
].
get_kerning
();
return
kerxTupleKern
(
v
,
header
.
tuple
Count
,
this
,
c
);
return
kerxTupleKern
(
v
,
header
.
tuple
_count
()
,
this
,
c
);
}
inline
bool
apply
(
hb_aat_apply_context_t
*
c
)
const
...
...
@@ -310,7 +318,7 @@ struct KerxSubTableFormat1
if
(
header
.
coverage
&
header
.
CrossStream
)
return
false
;
if
(
header
.
tuple
Count
)
if
(
header
.
tuple
_count
()
)
return_trace
(
false
);
/* TODO kerxTupleKern */
driver_context_t
dc
(
this
,
c
);
...
...
@@ -349,7 +357,7 @@ struct KerxSubTableFormat2
unsigned
int
offset
=
l
+
r
;
const
FWORD
*
v
=
&
StructAtOffset
<
FWORD
>
(
&
(
this
+
array
),
offset
);
if
(
unlikely
(
!
v
->
sanitize
(
&
c
->
sanitizer
)))
return
0
;
return
kerxTupleKern
(
*
v
,
header
.
tuple
Count
,
this
,
c
);
return
kerxTupleKern
(
*
v
,
header
.
tuple
_count
()
,
this
,
c
);
}
inline
bool
apply
(
hb_aat_apply_context_t
*
c
)
const
...
...
@@ -601,7 +609,7 @@ struct KerxSubTableFormat6
if
(
unlikely
(
hb_unsigned_mul_overflows
(
offset
,
sizeof
(
FWORD32
))))
return
0
;
const
FWORD32
*
v
=
&
StructAtOffset
<
FWORD32
>
(
&
(
this
+
t
.
array
),
offset
*
sizeof
(
FWORD32
));
if
(
unlikely
(
!
v
->
sanitize
(
&
c
->
sanitizer
)))
return
0
;
return
kerxTupleKern
(
*
v
,
header
.
tuple
Count
,
&
(
this
+
vector
),
c
);
return
kerxTupleKern
(
*
v
,
header
.
tuple
_count
()
,
&
(
this
+
vector
),
c
);
}
else
{
...
...
@@ -611,7 +619,7 @@ struct KerxSubTableFormat6
unsigned
int
offset
=
l
+
r
;
const
FWORD
*
v
=
&
StructAtOffset
<
FWORD
>
(
&
(
this
+
t
.
array
),
offset
*
sizeof
(
FWORD
));
if
(
unlikely
(
!
v
->
sanitize
(
&
c
->
sanitizer
)))
return
0
;
return
kerxTupleKern
(
*
v
,
header
.
tuple
Count
,
&
(
this
+
vector
),
c
);
return
kerxTupleKern
(
*
v
,
header
.
tuple
_count
()
,
&
(
this
+
vector
),
c
);
}
}
...
...
@@ -646,7 +654,7 @@ struct KerxSubTableFormat6
u
.
s
.
columnIndexTable
.
sanitize
(
c
,
this
)
&&
c
->
check_range
(
this
,
u
.
s
.
array
)
))
&&
(
header
.
tuple
Count
==
0
||
(
header
.
tuple
_count
()
==
0
||
c
->
check_range
(
this
,
vector
))));
}
...
...
@@ -693,6 +701,8 @@ struct KerxSubTableHeader
{
typedef
MorxTypes
Types
;
unsigned
int
tuple_count
(
void
)
const
{
return
tupleCount
;
}
enum
Coverage
{
Vertical
=
0x80000000
,
/* Set if table has vertical kerning values. */
...
...
src/hb-ot-kern-table.hh
浏览文件 @
5b178535
...
...
@@ -41,47 +41,6 @@
namespace
OT
{
template
<
typename
KernSubTableHeader
>
struct
KernSubTableFormat0
{
inline
int
get_kerning
(
hb_codepoint_t
left
,
hb_codepoint_t
right
)
const
{
AAT
::
hb_glyph_pair_t
pair
=
{
left
,
right
};
int
i
=
pairs
.
bsearch
(
pair
);
if
(
i
==
-
1
)
return
0
;
return
pairs
[
i
].
get_kerning
();
}
inline
bool
apply
(
AAT
::
hb_aat_apply_context_t
*
c
)
const
{
TRACE_APPLY
(
this
);
if
(
!
c
->
plan
->
requested_kerning
)
return
false
;
if
(
header
.
coverage
&
header
.
CrossStream
)
return
false
;
hb_kern_machine_t
<
KernSubTableFormat0
>
machine
(
*
this
);
machine
.
kern
(
c
->
font
,
c
->
buffer
,
c
->
plan
->
kern_mask
);
return_trace
(
true
);
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return_trace
(
pairs
.
sanitize
(
c
));
}
protected:
KernSubTableHeader
header
;
BinSearchArrayOf
<
AAT
::
KernPair
,
typename
KernSubTableHeader
::
Types
::
HBUINT
>
pairs
;
/* Array of kerning pairs. */
public:
DEFINE_SIZE_ARRAY
(
KernSubTableHeader
::
static_size
+
8
,
pairs
);
};
template
<
typename
KernSubTableHeader
>
struct
KernSubTableFormat1
{
...
...
@@ -445,7 +404,7 @@ struct KernSubTable
public:
union
{
KernSubTableHeader
header
;
Kern
SubTableFormat0
<
KernSubTableHeader
>
format0
;
AAT
::
Kerx
SubTableFormat0
<
KernSubTableHeader
>
format0
;
KernSubTableFormat1
<
KernSubTableHeader
>
format1
;
KernSubTableFormat2
<
KernSubTableHeader
>
format2
;
KernSubTableFormat3
<
KernSubTableHeader
>
format3
;
...
...
@@ -544,6 +503,8 @@ struct KernOT : KernTable<KernOT>
{
typedef
AAT
::
MortTypes
Types
;
unsigned
int
tuple_count
(
void
)
const
{
return
0
;
}
enum
Coverage
{
Direction
=
0x01u
,
...
...
@@ -589,6 +550,8 @@ struct KernAAT : KernTable<KernAAT>
{
typedef
AAT
::
MortTypes
Types
;
unsigned
int
tuple_count
(
void
)
const
{
return
0
;
}
enum
Coverage
{
Direction
=
0x80u
,
...
...
@@ -609,7 +572,8 @@ struct KernAAT : KernTable<KernAAT>
HBUINT8
coverage
;
/* Coverage bits. */
HBUINT8
format
;
/* Subtable format. */
HBUINT16
tupleIndex
;
/* The tuple index (used for variations fonts).
* This value specifies which tuple this subtable covers. */
* This value specifies which tuple this subtable covers.
* Note: We don't implement. */
public:
DEFINE_SIZE_STATIC
(
8
);
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录