Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
625ae08f
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看板
提交
625ae08f
编写于
11月 04, 2017
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[kern] Towards implementing format-2
上级
74e82ada
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
42 addition
and
31 deletion
+42
-31
src/hb-open-type-private.hh
src/hb-open-type-private.hh
+1
-3
src/hb-ot-kern-table.hh
src/hb-ot-kern-table.hh
+41
-28
未找到文件。
src/hb-open-type-private.hh
浏览文件 @
625ae08f
...
...
@@ -1078,9 +1078,7 @@ struct BinSearchHeader
};
template
<
typename
Type
>
struct
BinSearchArrayOf
:
SortedArrayOf
<
Type
,
BinSearchHeader
>
{
};
struct
BinSearchArrayOf
:
SortedArrayOf
<
Type
,
BinSearchHeader
>
{};
/* Lazy struct and blob loaders. */
...
...
src/hb-ot-kern-table.hh
浏览文件 @
625ae08f
...
...
@@ -81,9 +81,6 @@ struct KernSubTableFormat0
return
pairs
[
i
].
get_kerning
();
}
inline
unsigned
int
get_size
(
void
)
const
{
return
pairs
.
get_size
();
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
...
...
@@ -96,46 +93,63 @@ struct KernSubTableFormat0
DEFINE_SIZE_ARRAY
(
8
,
pairs
);
};
struct
Kern
SubTableFormat2
struct
Kern
ClassTable
{
inline
int
get_kerning
(
hb_codepoint_t
left
,
hb_codepoint_t
right
)
const
inline
unsigned
int
get_class
(
hb_codepoint_t
g
)
const
{
return
classes
[
g
-
firstGlyph
];
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
/* XXX */
return
0
;
TRACE_SANITIZE
(
this
);
return
_trace
(
firstGlyph
.
sanitize
(
c
)
&&
classes
.
sanitize
(
c
))
;
}
inline
unsigned
int
get_size
(
void
)
const
protected:
USHORT
firstGlyph
;
/* First glyph in class range. */
ArrayOf
<
USHORT
>
classes
;
/* Glyph classes. */
public:
DEFINE_SIZE_ARRAY
(
4
,
classes
);
};
struct
KernSubTableFormat2
{
inline
int
get_kerning
(
hb_codepoint_t
left
,
hb_codepoint_t
right
,
unsigned
int
length
)
const
{
/* XXX */
return
0
;
unsigned
int
l
=
(
this
+
leftClassTable
).
get_class
(
left
);
unsigned
int
r
=
(
this
+
leftClassTable
).
get_class
(
left
);
return
0
;
//(&(this+array))[0/*XXX*/];
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
/* XXX */
return_trace
(
true
);
return_trace
(
rowWidth
.
sanitize
(
c
)
&&
leftClassTable
.
sanitize
(
c
,
this
)
&&
rightClassTable
.
sanitize
(
c
,
this
)
&&
array
.
sanitize
(
c
,
this
)
);
}
protected:
USHORT
rowWidth
;
/* The width, in bytes, of a row in the table. */
OffsetTo
<
KernClassTable
>
leftClassTable
;
/* Offset from beginning of this subtable to
* left-hand class table. */
OffsetTo
<
KernClassTable
>
rightClassTable
;
/* Offset from beginning of this subtable to
* right-hand class table. */
OffsetTo
<
FWORD
>
array
;
/* Offset from beginning of this subtable to
* the start of the kerning array. */
public:
DEFINE_SIZE_MIN
(
8
);
};
struct
KernSubTable
{
inline
int
get_kerning
(
hb_codepoint_t
left
,
hb_codepoint_t
right
,
unsigned
int
format
)
const
inline
int
get_kerning
(
hb_codepoint_t
left
,
hb_codepoint_t
right
,
unsigned
int
length
,
unsigned
int
format
)
const
{
switch
(
format
)
{
case
0
:
return
u
.
format0
.
get_kerning
(
left
,
right
);
case
2
:
return
u
.
format2
.
get_kerning
(
left
,
right
);
default:
return
0
;
}
}
inline
unsigned
int
get_size
(
unsigned
int
format
)
const
{
switch
(
format
)
{
case
0
:
return
u
.
format0
.
get_size
();
case
2
:
return
u
.
format2
.
get_size
();
case
2
:
return
u
.
format2
.
get_kerning
(
left
,
right
,
length
);
default:
return
0
;
}
}
...
...
@@ -173,7 +187,7 @@ struct KernSubTableWrapper
{
return
bool
(
thiz
()
->
coverage
&
T
::
COVERAGE_OVERRIDE_FLAG
);
}
inline
int
get_kerning
(
hb_codepoint_t
left
,
hb_codepoint_t
right
)
const
{
return
thiz
()
->
subtable
.
get_kerning
(
left
,
right
,
thiz
()
->
format
);
}
{
return
thiz
()
->
subtable
.
get_kerning
(
left
,
right
,
thiz
()
->
length
-
thiz
()
->
min_size
,
thiz
()
->
format
);
}
inline
int
get_h_kerning
(
hb_codepoint_t
left
,
hb_codepoint_t
right
)
const
{
return
is_horizontal
()
?
get_kerning
(
left
,
right
)
:
0
;
}
...
...
@@ -186,8 +200,7 @@ struct KernSubTableWrapper
return_trace
(
c
->
check_struct
(
thiz
())
&&
thiz
()
->
length
>=
thiz
()
->
min_size
&&
c
->
check_array
(
thiz
(),
1
,
thiz
()
->
length
)
&&
thiz
()
->
subtable
.
sanitize
(
c
,
thiz
()
->
format
)
&&
thiz
()
->
subtable
.
get_size
(
thiz
()
->
format
)
<=
thiz
()
->
length
-
thiz
()
->
min_size
);
thiz
()
->
subtable
.
sanitize
(
c
,
thiz
()
->
format
));
}
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录