Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
c074ebc4
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看板
提交
c074ebc4
编写于
2月 13, 2013
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[OTLayout] Minor refactoring
上级
407fc124
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
23 addition
and
16 deletion
+23
-16
src/hb-ot-layout-gpos-table.hh
src/hb-ot-layout-gpos-table.hh
+6
-3
src/hb-ot-layout-gsubgpos-private.hh
src/hb-ot-layout-gsubgpos-private.hh
+17
-13
未找到文件。
src/hb-ot-layout-gpos-table.hh
浏览文件 @
c074ebc4
...
@@ -1029,8 +1029,9 @@ struct MarkBasePosFormat1
...
@@ -1029,8 +1029,9 @@ struct MarkBasePosFormat1
/* now we search backwards for a non-mark glyph */
/* now we search backwards for a non-mark glyph */
hb_apply_context_t
::
skipping_backward_iterator_t
skippy_iter
(
c
,
c
->
buffer
->
idx
,
1
);
hb_apply_context_t
::
skipping_backward_iterator_t
skippy_iter
(
c
,
c
->
buffer
->
idx
,
1
);
skippy_iter
.
set_lookup_props
(
LookupFlag
::
IgnoreMarks
);
do
{
do
{
if
(
!
skippy_iter
.
prev
(
LookupFlag
::
IgnoreMarks
))
return
TRACE_RETURN
(
false
);
if
(
!
skippy_iter
.
prev
())
return
TRACE_RETURN
(
false
);
/* We only want to attach to the first of a MultipleSubst sequence. Reject others. */
/* We only want to attach to the first of a MultipleSubst sequence. Reject others. */
if
(
0
==
get_lig_comp
(
c
->
buffer
->
info
[
skippy_iter
.
idx
]))
break
;
if
(
0
==
get_lig_comp
(
c
->
buffer
->
info
[
skippy_iter
.
idx
]))
break
;
skippy_iter
.
reject
();
skippy_iter
.
reject
();
...
@@ -1132,7 +1133,8 @@ struct MarkLigPosFormat1
...
@@ -1132,7 +1133,8 @@ struct MarkLigPosFormat1
/* now we search backwards for a non-mark glyph */
/* now we search backwards for a non-mark glyph */
hb_apply_context_t
::
skipping_backward_iterator_t
skippy_iter
(
c
,
c
->
buffer
->
idx
,
1
);
hb_apply_context_t
::
skipping_backward_iterator_t
skippy_iter
(
c
,
c
->
buffer
->
idx
,
1
);
if
(
!
skippy_iter
.
prev
(
LookupFlag
::
IgnoreMarks
))
return
TRACE_RETURN
(
false
);
skippy_iter
.
set_lookup_props
(
LookupFlag
::
IgnoreMarks
);
if
(
!
skippy_iter
.
prev
())
return
TRACE_RETURN
(
false
);
/* The following assertion is too strong, so we've disabled it. */
/* The following assertion is too strong, so we've disabled it. */
if
(
!
(
c
->
buffer
->
info
[
skippy_iter
.
idx
].
glyph_props
()
&
HB_OT_LAYOUT_GLYPH_PROPS_LIGATURE
))
{
/*return TRACE_RETURN (false);*/
}
if
(
!
(
c
->
buffer
->
info
[
skippy_iter
.
idx
].
glyph_props
()
&
HB_OT_LAYOUT_GLYPH_PROPS_LIGATURE
))
{
/*return TRACE_RETURN (false);*/
}
...
@@ -1247,7 +1249,8 @@ struct MarkMarkPosFormat1
...
@@ -1247,7 +1249,8 @@ struct MarkMarkPosFormat1
/* now we search backwards for a suitable mark glyph until a non-mark glyph */
/* now we search backwards for a suitable mark glyph until a non-mark glyph */
hb_apply_context_t
::
skipping_backward_iterator_t
skippy_iter
(
c
,
c
->
buffer
->
idx
,
1
);
hb_apply_context_t
::
skipping_backward_iterator_t
skippy_iter
(
c
,
c
->
buffer
->
idx
,
1
);
if
(
!
skippy_iter
.
prev
(
c
->
lookup_props
&
~
LookupFlag
::
IgnoreFlags
))
return
TRACE_RETURN
(
false
);
skippy_iter
.
set_lookup_props
(
c
->
lookup_props
&
~
LookupFlag
::
IgnoreFlags
);
if
(
!
skippy_iter
.
prev
())
return
TRACE_RETURN
(
false
);
if
(
!
(
c
->
buffer
->
info
[
skippy_iter
.
idx
].
glyph_props
()
&
HB_OT_LAYOUT_GLYPH_PROPS_MARK
))
{
return
TRACE_RETURN
(
false
);
}
if
(
!
(
c
->
buffer
->
info
[
skippy_iter
.
idx
].
glyph_props
()
&
HB_OT_LAYOUT_GLYPH_PROPS_MARK
))
{
return
TRACE_RETURN
(
false
);
}
...
...
src/hb-ot-layout-gsubgpos-private.hh
浏览文件 @
c074ebc4
...
@@ -281,9 +281,9 @@ struct hb_apply_context_t
...
@@ -281,9 +281,9 @@ struct hb_apply_context_t
has_glyph_classes
(
gdef
.
has_glyph_classes
()),
has_glyph_classes
(
gdef
.
has_glyph_classes
()),
debug_depth
(
0
)
{}
debug_depth
(
0
)
{}
void
set_recurse_func
(
recurse_func_t
func
)
{
recurse_func
=
func
;
}
inline
void
set_recurse_func
(
recurse_func_t
func
)
{
recurse_func
=
func
;
}
void
set_lookup_props
(
unsigned
int
lookup_props_
)
{
lookup_props
=
lookup_props_
;
}
inline
void
set_lookup_props
(
unsigned
int
lookup_props_
)
{
lookup_props
=
lookup_props_
;
}
void
set_lookup
(
const
Lookup
&
l
)
{
lookup_props
=
l
.
get_props
();
}
inline
void
set_lookup
(
const
Lookup
&
l
)
{
lookup_props
=
l
.
get_props
();
}
struct
skipping_forward_iterator_t
struct
skipping_forward_iterator_t
{
{
...
@@ -293,12 +293,17 @@ struct hb_apply_context_t
...
@@ -293,12 +293,17 @@ struct hb_apply_context_t
bool
context_match
=
false
)
bool
context_match
=
false
)
{
{
c
=
c_
;
c
=
c_
;
lookup_props
=
c
->
lookup_props
;
idx
=
start_index_
;
idx
=
start_index_
;
num_items
=
num_items_
;
num_items
=
num_items_
;
mask
=
context_match
?
-
1
:
c
->
lookup_mask
;
mask
=
context_match
?
-
1
:
c
->
lookup_mask
;
syllable
=
context_match
?
0
:
c
->
buffer
->
cur
().
syllable
();
syllable
=
context_match
?
0
:
c
->
buffer
->
cur
().
syllable
();
end
=
c
->
buffer
->
len
;
end
=
c
->
buffer
->
len
;
}
}
inline
void
set_lookup_props
(
unsigned
int
lookup_props_
)
{
lookup_props
=
lookup_props_
;
}
inline
bool
has_no_chance
(
void
)
const
inline
bool
has_no_chance
(
void
)
const
{
{
return
unlikely
(
num_items
&&
idx
+
num_items
>=
end
);
return
unlikely
(
num_items
&&
idx
+
num_items
>=
end
);
...
@@ -307,7 +312,7 @@ struct hb_apply_context_t
...
@@ -307,7 +312,7 @@ struct hb_apply_context_t
{
{
num_items
++
;
num_items
++
;
}
}
inline
bool
next
(
unsigned
int
lookup_props
)
inline
bool
next
(
void
)
{
{
assert
(
num_items
>
0
);
assert
(
num_items
>
0
);
do
do
...
@@ -319,14 +324,11 @@ struct hb_apply_context_t
...
@@ -319,14 +324,11 @@ struct hb_apply_context_t
num_items
--
;
num_items
--
;
return
(
c
->
buffer
->
info
[
idx
].
mask
&
mask
)
&&
(
!
syllable
||
syllable
==
c
->
buffer
->
info
[
idx
].
syllable
());
return
(
c
->
buffer
->
info
[
idx
].
mask
&
mask
)
&&
(
!
syllable
||
syllable
==
c
->
buffer
->
info
[
idx
].
syllable
());
}
}
inline
bool
next
(
void
)
{
return
next
(
c
->
lookup_props
);
}
unsigned
int
idx
;
unsigned
int
idx
;
protected:
protected:
hb_apply_context_t
*
c
;
hb_apply_context_t
*
c
;
unsigned
int
lookup_props
;
unsigned
int
num_items
;
unsigned
int
num_items
;
hb_mask_t
mask
;
hb_mask_t
mask
;
uint8_t
syllable
;
uint8_t
syllable
;
...
@@ -342,11 +344,16 @@ struct hb_apply_context_t
...
@@ -342,11 +344,16 @@ struct hb_apply_context_t
bool
match_syllable_
=
true
)
bool
match_syllable_
=
true
)
{
{
c
=
c_
;
c
=
c_
;
lookup_props
=
c
->
lookup_props
;
idx
=
start_index_
;
idx
=
start_index_
;
num_items
=
num_items_
;
num_items
=
num_items_
;
mask
=
mask_
?
mask_
:
c
->
lookup_mask
;
mask
=
mask_
?
mask_
:
c
->
lookup_mask
;
syllable
=
match_syllable_
?
c
->
buffer
->
cur
().
syllable
()
:
0
;
syllable
=
match_syllable_
?
c
->
buffer
->
cur
().
syllable
()
:
0
;
}
}
inline
void
set_lookup_props
(
unsigned
int
lookup_props_
)
{
lookup_props
=
lookup_props_
;
}
inline
bool
has_no_chance
(
void
)
const
inline
bool
has_no_chance
(
void
)
const
{
{
return
unlikely
(
idx
<
num_items
);
return
unlikely
(
idx
<
num_items
);
...
@@ -355,7 +362,7 @@ struct hb_apply_context_t
...
@@ -355,7 +362,7 @@ struct hb_apply_context_t
{
{
num_items
++
;
num_items
++
;
}
}
inline
bool
prev
(
unsigned
int
lookup_props
)
inline
bool
prev
(
void
)
{
{
assert
(
num_items
>
0
);
assert
(
num_items
>
0
);
do
do
...
@@ -367,14 +374,11 @@ struct hb_apply_context_t
...
@@ -367,14 +374,11 @@ struct hb_apply_context_t
num_items
--
;
num_items
--
;
return
(
c
->
buffer
->
out_info
[
idx
].
mask
&
mask
)
&&
(
!
syllable
||
syllable
==
c
->
buffer
->
out_info
[
idx
].
syllable
());
return
(
c
->
buffer
->
out_info
[
idx
].
mask
&
mask
)
&&
(
!
syllable
||
syllable
==
c
->
buffer
->
out_info
[
idx
].
syllable
());
}
}
inline
bool
prev
(
void
)
{
return
prev
(
c
->
lookup_props
);
}
unsigned
int
idx
;
unsigned
int
idx
;
protected:
protected:
hb_apply_context_t
*
c
;
hb_apply_context_t
*
c
;
unsigned
int
lookup_props
;
unsigned
int
num_items
;
unsigned
int
num_items
;
hb_mask_t
mask
;
hb_mask_t
mask
;
uint8_t
syllable
;
uint8_t
syllable
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录