Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
71e6adf1
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看板
提交
71e6adf1
编写于
12月 16, 2017
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[collect_glyphs] handle ClassDef better
上级
87cc5a65
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
56 addition
and
16 deletion
+56
-16
src/hb-ot-layout-common-private.hh
src/hb-ot-layout-common-private.hh
+53
-10
src/hb-ot-layout-gdef-table.hh
src/hb-ot-layout-gdef-table.hh
+1
-1
src/hb-ot-layout-gpos-table.hh
src/hb-ot-layout-gpos-table.hh
+1
-4
src/hb-ot-layout-gsubgpos-private.hh
src/hb-ot-layout-gsubgpos-private.hh
+1
-1
未找到文件。
src/hb-ot-layout-common-private.hh
浏览文件 @
71e6adf1
...
...
@@ -1020,12 +1020,33 @@ struct ClassDefFormat1
}
template
<
typename
set_t
>
inline
bool
add_class
(
set_t
*
glyphs
,
unsigned
int
min_klass
,
unsigned
int
max_klass
)
const
{
inline
bool
add_coverage
(
set_t
*
glyphs
)
const
{
unsigned
int
start
=
0
;
unsigned
int
count
=
classValue
.
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
{
if
(
classValue
[
i
])
continue
;
if
(
start
!=
i
)
if
(
unlikely
(
!
glyphs
->
add_range
(
startGlyph
+
start
,
startGlyph
+
i
)))
return
true
;
//XXXXXXXXfalse
start
=
i
+
1
;
}
if
(
start
!=
count
)
if
(
unlikely
(
!
glyphs
->
add_range
(
startGlyph
+
start
,
startGlyph
+
count
)))
return
true
;
//XXXXXXXXfalse
return
true
;
}
template
<
typename
set_t
>
inline
bool
add_class
(
set_t
*
glyphs
,
unsigned
int
klass
)
const
{
unsigned
int
count
=
classValue
.
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
{
unsigned
int
klass
=
classValue
[
i
];
if
(
min_klass
<=
klass
&&
klass
<=
max_klass
)
if
(
classValue
[
i
]
==
klass
)
glyphs
->
add
(
startGlyph
+
i
);
}
return
true
;
...
...
@@ -1081,14 +1102,23 @@ struct ClassDefFormat2
}
template
<
typename
set_t
>
inline
bool
add_class
(
set_t
*
glyphs
,
unsigned
int
min_klass
,
unsigned
int
max_klass
)
const
{
inline
bool
add_coverage
(
set_t
*
glyphs
)
const
{
unsigned
int
count
=
rangeRecord
.
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
if
(
rangeRecord
[
i
].
value
)
if
(
unlikely
(
!
rangeRecord
[
i
].
add_coverage
(
glyphs
)))
return
true
;
//XXXXXXXXXXXXfalse;
return
true
;
}
template
<
typename
set_t
>
inline
bool
add_class
(
set_t
*
glyphs
,
unsigned
int
klass
)
const
{
unsigned
int
count
=
rangeRecord
.
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
{
unsigned
int
klass
=
rangeRecord
[
i
].
value
;
if
(
min_klass
<=
klass
&&
klass
<=
max_klass
)
if
(
rangeRecord
[
i
].
value
==
klass
)
if
(
unlikely
(
!
rangeRecord
[
i
].
add_coverage
(
glyphs
)))
return
false
;
return
true
;
//XXXXXXXXXXXX
false;
}
return
true
;
}
...
...
@@ -1148,11 +1178,24 @@ struct ClassDef
}
}
/* Might return false if array looks unsorted.
* Used for faster rejection of corrupt data. */
template
<
typename
set_t
>
inline
bool
add_coverage
(
set_t
*
glyphs
)
const
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
.
add_coverage
(
glyphs
);
case
2
:
return
u
.
format2
.
add_coverage
(
glyphs
);
default:
return
true
;
//XXXXXXXXXXXfalse;
}
}
/* Might return false if array looks unsorted.
* Used for faster rejection of corrupt data. */
template
<
typename
set_t
>
inline
bool
add_class
(
set_t
*
glyphs
,
unsigned
int
min_klass
,
unsigned
int
max_
klass
)
const
{
inline
bool
add_class
(
set_t
*
glyphs
,
unsigned
int
klass
)
const
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
.
add_class
(
glyphs
,
min_klass
,
max_
klass
);
case
2
:
return
u
.
format2
.
add_class
(
glyphs
,
min_klass
,
max_
klass
);
case
1
:
return
u
.
format1
.
add_class
(
glyphs
,
klass
);
case
2
:
return
u
.
format2
.
add_class
(
glyphs
,
klass
);
default:
return
false
;
}
}
...
...
src/hb-ot-layout-gdef-table.hh
浏览文件 @
71e6adf1
...
...
@@ -352,7 +352,7 @@ struct GDEF
inline
unsigned
int
get_glyph_class
(
hb_codepoint_t
glyph
)
const
{
return
(
this
+
glyphClassDef
).
get_class
(
glyph
);
}
inline
void
get_glyphs_in_class
(
unsigned
int
klass
,
hb_set_t
*
glyphs
)
const
{
(
this
+
glyphClassDef
).
add_class
(
glyphs
,
klass
,
klass
);
}
{
(
this
+
glyphClassDef
).
add_class
(
glyphs
,
klass
);
}
inline
bool
has_mark_attachment_types
(
void
)
const
{
return
markAttachClassDef
!=
0
;
}
inline
unsigned
int
get_mark_attachment_type
(
hb_codepoint_t
glyph
)
const
...
...
src/hb-ot-layout-gpos-table.hh
浏览文件 @
71e6adf1
...
...
@@ -751,10 +751,7 @@ struct PairPosFormat2
{
TRACE_COLLECT_GLYPHS
(
this
);
if
(
unlikely
(
!
(
this
+
coverage
).
add_coverage
(
c
->
input
)))
return
;
unsigned
int
count2
=
class2Count
;
if
(
count2
)
(
this
+
classDef2
).
add_class
(
c
->
input
,
0
,
count2
-
1
);
if
(
unlikely
(
!
(
this
+
classDef2
).
add_coverage
(
c
->
input
)))
return
;
}
inline
const
Coverage
&
get_coverage
(
void
)
const
...
...
src/hb-ot-layout-gsubgpos-private.hh
浏览文件 @
71e6adf1
...
...
@@ -621,7 +621,7 @@ static inline void collect_glyph (hb_set_t *glyphs, const UINT16 &value, const v
static
inline
void
collect_class
(
hb_set_t
*
glyphs
,
const
UINT16
&
value
,
const
void
*
data
)
{
const
ClassDef
&
class_def
=
*
reinterpret_cast
<
const
ClassDef
*>
(
data
);
class_def
.
add_class
(
glyphs
,
value
,
value
);
class_def
.
add_class
(
glyphs
,
value
);
}
static
inline
void
collect_coverage
(
hb_set_t
*
glyphs
,
const
UINT16
&
value
,
const
void
*
data
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录