Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
b11830c0
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看板
提交
b11830c0
编写于
11月 06, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[kern] Improve Format 2
Still disabled.
上级
c0383c6b
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
15 addition
and
40 deletion
+15
-40
src/hb-aat-layout-common.hh
src/hb-aat-layout-common.hh
+9
-11
src/hb-ot-kern-table.hh
src/hb-ot-kern-table.hh
+6
-29
未找到文件。
src/hb-aat-layout-common.hh
浏览文件 @
b11830c0
...
...
@@ -528,24 +528,22 @@ struct StateTable
struct
ClassTable
{
inline
unsigned
int
get_class
(
hb_codepoint_t
glyph_id
)
const
inline
unsigned
int
get_class
(
hb_codepoint_t
glyph_id
,
unsigned
int
outOfRange
=
0
)
const
{
return
firstGlyph
<=
glyph_id
&&
glyph_id
-
firstGlyph
<
glyphCount
?
classArrayZ
[
glyph_id
-
firstGlyph
]
:
1
;
unsigned
int
i
=
glyph_id
-
firstGlyph
;
return
i
>=
classArray
.
len
?
outOfRange
:
classArray
.
arrayZ
[
i
];
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return_trace
(
c
->
check_struct
(
this
)
&&
classArray
Z
.
sanitize
(
c
,
glyphCount
));
return_trace
(
c
->
check_struct
(
this
)
&&
classArray
.
sanitize
(
c
));
}
protected:
GlyphID
firstGlyph
;
/* First glyph index included in the trimmed array. */
HBUINT16
glyphCount
;
/* Total number of glyphs (equivalent to the last
* glyph minus the value of firstGlyph plus 1). */
UnsizedArrayOf
<
HBUINT8
>
classArrayZ
;
/* The class codes (indexed by glyph index minus
* firstGlyph). */
GlyphID
firstGlyph
;
/* First glyph index included in the trimmed array. */
ArrayOf
<
HBUINT8
>
classArray
;
/* The class codes (indexed by glyph index minus
* firstGlyph). */
public:
DEFINE_SIZE_ARRAY
(
4
,
classArray
Z
);
DEFINE_SIZE_ARRAY
(
4
,
classArray
);
};
struct
MortTypes
...
...
@@ -557,7 +555,7 @@ struct MortTypes
{
inline
unsigned
int
get_class
(
hb_codepoint_t
glyph_id
,
unsigned
int
num_glyphs
HB_UNUSED
)
const
{
return
ClassTable
::
get_class
(
glyph_id
);
return
ClassTable
::
get_class
(
glyph_id
,
1
);
}
};
template
<
typename
T
>
...
...
src/hb-ot-kern-table.hh
浏览文件 @
b11830c0
...
...
@@ -319,44 +319,21 @@ struct KernSubTableFormat1
DEFINE_SIZE_STATIC
(
KernSubTableHeader
::
static_size
+
10
);
};
struct
KernClassTable
{
inline
unsigned
int
get_class
(
hb_codepoint_t
g
)
const
{
return
classes
[
g
-
firstGlyph
];
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return_trace
(
c
->
check_struct
(
this
)
&&
classes
.
sanitize
(
c
));
}
protected:
HBUINT16
firstGlyph
;
/* First glyph in class range. */
ArrayOf
<
HBUINT16
>
classes
;
/* Glyph classes. */
public:
DEFINE_SIZE_ARRAY
(
4
,
classes
);
};
template
<
typename
KernSubTableHeader
>
struct
KernSubTableFormat2
{
inline
int
get_kerning
(
hb_codepoint_t
left
,
hb_codepoint_t
right
,
AAT
::
hb_aat_apply_context_t
*
c
)
const
{
/* This subtable is disabled. It's not cleaer to me *exactly* where the offests are
* based from. I *think* they should be based from beginning of kern subtable wrapper,
* *NOT* "this". Since we know of no fonts that use this subtable, we are disabling
* it. Someday fix it and re-enable. */
/* Disabled until we find a font to test this. Note that OT vs AAT specify
* different ClassTable. OT's has 16bit entries, while AAT has 8bit entries.
* I've not seen any in the wild. */
return
0
;
unsigned
int
l
=
(
this
+
leftClassTable
).
get_class
(
left
);
unsigned
int
r
=
(
this
+
rightClassTable
).
get_class
(
right
);
unsigned
int
offset
=
l
+
r
;
const
FWORD
*
v
=
&
StructAtOffset
<
FWORD
>
(
&
(
this
+
array
),
offset
);
#if 0
if (unlikely ((const char *) v < (const char *) &array ||
(const char *) v > (const char *) end - 2))
#endif
return
0
;
if
(
unlikely
(
!
v
->
sanitize
(
&
c
->
sanitizer
)))
return
0
;
return
*
v
;
}
...
...
@@ -400,9 +377,9 @@ struct KernSubTableFormat2
protected:
KernSubTableHeader
header
;
HBUINT16
rowWidth
;
/* The width, in bytes, of a row in the table. */
OffsetTo
<
Kern
ClassTable
>
leftClassTable
;
/* Offset from beginning of this subtable to
OffsetTo
<
AAT
::
ClassTable
>
leftClassTable
;
/* Offset from beginning of this subtable to
* left-hand class table. */
OffsetTo
<
Kern
ClassTable
>
rightClassTable
;
/* Offset from beginning of this subtable to
OffsetTo
<
AAT
::
ClassTable
>
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. */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录