Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
c97dde5d
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看板
提交
c97dde5d
编写于
11月 07, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[kern/kerx] Towards merge more
上级
540ccc38
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
58 addition
and
57 deletion
+58
-57
src/hb-aat-layout-kerx-table.hh
src/hb-aat-layout-kerx-table.hh
+55
-20
src/hb-kern.hh
src/hb-kern.hh
+0
-33
src/hb-ot-kern-table.hh
src/hb-ot-kern-table.hh
+3
-4
未找到文件。
src/hb-aat-layout-kerx-table.hh
浏览文件 @
c97dde5d
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
#define HB_AAT_LAYOUT_KERX_TABLE_HH
#define HB_AAT_LAYOUT_KERX_TABLE_HH
#include "hb-kern.hh"
#include "hb-kern.hh"
#include "hb-aat-layout-ankr-table.hh"
/*
/*
* kerx -- Extended Kerning
* kerx -- Extended Kerning
...
@@ -57,36 +58,36 @@ kerxTupleKern (int value,
...
@@ -57,36 +58,36 @@ kerxTupleKern (int value,
}
}
struct
KerxSubTableHeader
struct
hb_glyph_pair_t
{
{
typedef
MorxTypes
Types
;
hb_codepoint_t
left
;
hb_codepoint_t
right
;
};
enum
Coverage
struct
KernPair
{
inline
int
get_kerning
(
void
)
const
{
return
value
;
}
inline
int
cmp
(
const
hb_glyph_pair_t
&
o
)
const
{
{
Vertical
=
0x80000000
,
/* Set if table has vertical kerning values. */
int
ret
=
left
.
cmp
(
o
.
left
);
CrossStream
=
0x40000000
,
/* Set if table has cross-stream kerning values. */
if
(
ret
)
return
ret
;
Variation
=
0x20000000
,
/* Set if table has variation kerning values. */
return
right
.
cmp
(
o
.
right
);
Backwards
=
0x10000000
,
/* If clear, process the glyphs forwards, that
}
* is, from first to last in the glyph stream.
* If we, process them from last to first.
* This flag only applies to state-table based
* 'kerx' subtables (types 1 and 4). */
Reserved
=
0x0FFFFF00
,
/* Reserved, set to zero. */
SubtableType
=
0x000000FF
,
/* Subtable type. */
};
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
{
TRACE_SANITIZE
(
this
);
TRACE_SANITIZE
(
this
);
return_trace
(
likely
(
c
->
check_struct
(
this
)
));
return_trace
(
c
->
check_struct
(
this
));
}
}
protected:
GlyphID
left
;
GlyphID
right
;
FWORD
value
;
public:
public:
HBUINT32
length
;
DEFINE_SIZE_STATIC
(
6
);
HBUINT32
coverage
;
HBUINT32
tupleCount
;
public:
DEFINE_SIZE_STATIC
(
12
);
};
};
template
<
typename
KernSubTableHeader
>
template
<
typename
KernSubTableHeader
>
...
@@ -687,6 +688,39 @@ struct KerxSubTableFormat6
...
@@ -687,6 +688,39 @@ struct KerxSubTableFormat6
DEFINE_SIZE_STATIC
(
KernSubTableHeader
::
static_size
+
24
);
DEFINE_SIZE_STATIC
(
KernSubTableHeader
::
static_size
+
24
);
};
};
struct
KerxSubTableHeader
{
typedef
MorxTypes
Types
;
enum
Coverage
{
Vertical
=
0x80000000
,
/* Set if table has vertical kerning values. */
CrossStream
=
0x40000000
,
/* Set if table has cross-stream kerning values. */
Variation
=
0x20000000
,
/* Set if table has variation kerning values. */
Backwards
=
0x10000000
,
/* If clear, process the glyphs forwards, that
* is, from first to last in the glyph stream.
* If we, process them from last to first.
* This flag only applies to state-table based
* 'kerx' subtables (types 1 and 4). */
Reserved
=
0x0FFFFF00
,
/* Reserved, set to zero. */
SubtableType
=
0x000000FF
,
/* Subtable type. */
};
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return_trace
(
likely
(
c
->
check_struct
(
this
)));
}
public:
HBUINT32
length
;
HBUINT32
coverage
;
HBUINT32
tupleCount
;
public:
DEFINE_SIZE_STATIC
(
12
);
};
struct
KerxTable
struct
KerxTable
{
{
friend
struct
kerx
;
friend
struct
kerx
;
...
@@ -816,6 +850,7 @@ struct kerx
...
@@ -816,6 +850,7 @@ struct kerx
DEFINE_SIZE_MIN
(
8
);
DEFINE_SIZE_MIN
(
8
);
};
};
}
/* namespace AAT */
}
/* namespace AAT */
...
...
src/hb-kern.hh
浏览文件 @
c97dde5d
...
@@ -114,39 +114,6 @@ struct hb_kern_machine_t
...
@@ -114,39 +114,6 @@ struct hb_kern_machine_t
};
};
struct
hb_glyph_pair_t
{
hb_codepoint_t
left
;
hb_codepoint_t
right
;
};
struct
KernPair
{
inline
int
get_kerning
(
void
)
const
{
return
value
;
}
inline
int
cmp
(
const
hb_glyph_pair_t
&
o
)
const
{
int
ret
=
left
.
cmp
(
o
.
left
);
if
(
ret
)
return
ret
;
return
right
.
cmp
(
o
.
right
);
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return_trace
(
c
->
check_struct
(
this
));
}
protected:
GlyphID
left
;
GlyphID
right
;
FWORD
value
;
public:
DEFINE_SIZE_STATIC
(
6
);
};
}
/* namespace OT */
}
/* namespace OT */
...
...
src/hb-ot-kern-table.hh
浏览文件 @
c97dde5d
...
@@ -27,8 +27,7 @@
...
@@ -27,8 +27,7 @@
#ifndef HB_OT_KERN_TABLE_HH
#ifndef HB_OT_KERN_TABLE_HH
#define HB_OT_KERN_TABLE_HH
#define HB_OT_KERN_TABLE_HH
#include "hb-kern.hh"
#include "hb-aat-layout-kerx-table.hh"
#include "hb-ot-shape.hh"
/*
/*
...
@@ -47,7 +46,7 @@ struct KernSubTableFormat0
...
@@ -47,7 +46,7 @@ struct KernSubTableFormat0
{
{
inline
int
get_kerning
(
hb_codepoint_t
left
,
hb_codepoint_t
right
)
const
inline
int
get_kerning
(
hb_codepoint_t
left
,
hb_codepoint_t
right
)
const
{
{
hb_glyph_pair_t
pair
=
{
left
,
right
};
AAT
::
hb_glyph_pair_t
pair
=
{
left
,
right
};
int
i
=
pairs
.
bsearch
(
pair
);
int
i
=
pairs
.
bsearch
(
pair
);
if
(
i
==
-
1
)
return
0
;
if
(
i
==
-
1
)
return
0
;
return
pairs
[
i
].
get_kerning
();
return
pairs
[
i
].
get_kerning
();
...
@@ -77,7 +76,7 @@ struct KernSubTableFormat0
...
@@ -77,7 +76,7 @@ struct KernSubTableFormat0
protected:
protected:
KernSubTableHeader
header
;
KernSubTableHeader
header
;
BinSearchArrayOf
<
KernPair
,
typename
KernSubTableHeader
::
Types
::
HBUINT
>
BinSearchArrayOf
<
AAT
::
KernPair
,
typename
KernSubTableHeader
::
Types
::
HBUINT
>
pairs
;
/* Array of kerning pairs. */
pairs
;
/* Array of kerning pairs. */
public:
public:
DEFINE_SIZE_ARRAY
(
KernSubTableHeader
::
static_size
+
8
,
pairs
);
DEFINE_SIZE_ARRAY
(
KernSubTableHeader
::
static_size
+
8
,
pairs
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录