Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
8ac3c9c0
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看板
体验新版 GitCode,发现更多精彩内容 >>
You need to sign in or sign up before continuing.
提交
8ac3c9c0
编写于
4月 21, 2013
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rename "pause" to "stage"
The compile() function is starting to become illegible...
上级
dd0641a4
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
31 addition
and
31 deletion
+31
-31
src/hb-ot-map-private.hh
src/hb-ot-map-private.hh
+12
-12
src/hb-ot-map.cc
src/hb-ot-map.cc
+19
-19
未找到文件。
src/hb-ot-map-private.hh
浏览文件 @
8ac3c9c0
...
...
@@ -67,7 +67,7 @@ struct hb_ot_map_t
typedef
void
(
*
pause_func_t
)
(
const
struct
hb_ot_shape_plan_t
*
plan
,
hb_font_t
*
font
,
hb_buffer_t
*
buffer
);
struct
paus
e_map_t
{
struct
stag
e_map_t
{
unsigned
int
num_lookups
;
/* Cumulative */
pause_func_t
callback
;
};
...
...
@@ -110,9 +110,9 @@ struct hb_ot_map_t
*
lookup_count
=
0
;
return
;
}
assert
(
stage
<=
paus
es
[
table_index
].
len
);
unsigned
int
start
=
stage
?
paus
es
[
table_index
][
stage
-
1
].
num_lookups
:
0
;
unsigned
int
end
=
stage
<
pauses
[
table_index
].
len
?
paus
es
[
table_index
][
stage
].
num_lookups
:
lookups
[
table_index
].
len
;
assert
(
stage
<=
stag
es
[
table_index
].
len
);
unsigned
int
start
=
stage
?
stag
es
[
table_index
][
stage
-
1
].
num_lookups
:
0
;
unsigned
int
end
=
stage
<
stages
[
table_index
].
len
?
stag
es
[
table_index
][
stage
].
num_lookups
:
lookups
[
table_index
].
len
;
*
plookups
=
&
lookups
[
table_index
][
start
];
*
lookup_count
=
end
-
start
;
}
...
...
@@ -125,8 +125,8 @@ struct hb_ot_map_t
features
.
finish
();
lookups
[
0
].
finish
();
lookups
[
1
].
finish
();
paus
es
[
0
].
finish
();
paus
es
[
1
].
finish
();
stag
es
[
0
].
finish
();
stag
es
[
1
].
finish
();
}
public:
...
...
@@ -145,7 +145,7 @@ struct hb_ot_map_t
hb_prealloced_array_t
<
feature_map_t
,
8
>
features
;
hb_prealloced_array_t
<
lookup_map_t
,
32
>
lookups
[
2
];
/* GSUB/GPOS */
hb_prealloced_array_t
<
pause_map_t
,
1
>
paus
es
[
2
];
/* GSUB/GPOS */
hb_prealloced_array_t
<
stage_map_t
,
1
>
stag
es
[
2
];
/* GSUB/GPOS */
};
enum
hb_ot_map_feature_flags_t
{
...
...
@@ -195,8 +195,8 @@ struct hb_ot_map_builder_t
inline
void
finish
(
void
)
{
feature_infos
.
finish
();
paus
es
[
0
].
finish
();
paus
es
[
1
].
finish
();
stag
es
[
0
].
finish
();
stag
es
[
1
].
finish
();
}
private:
...
...
@@ -213,8 +213,8 @@ struct hb_ot_map_builder_t
{
return
(
a
->
tag
!=
b
->
tag
)
?
(
a
->
tag
<
b
->
tag
?
-
1
:
1
)
:
(
a
->
seq
<
b
->
seq
?
-
1
:
1
);
}
};
struct
paus
e_info_t
{
unsigned
int
stage
;
struct
stag
e_info_t
{
unsigned
int
index
;
hb_ot_map_t
::
pause_func_t
callback
;
};
...
...
@@ -233,7 +233,7 @@ struct hb_ot_map_builder_t
unsigned
int
current_stage
[
2
];
/* GSUB/GPOS */
hb_prealloced_array_t
<
feature_info_t
,
16
>
feature_infos
;
hb_prealloced_array_t
<
pause_info_t
,
1
>
paus
es
[
2
];
/* GSUB/GPOS */
hb_prealloced_array_t
<
stage_info_t
,
1
>
stag
es
[
2
];
/* GSUB/GPOS */
};
...
...
src/hb-ot-map.cc
浏览文件 @
8ac3c9c0
...
...
@@ -107,18 +107,18 @@ void hb_ot_map_t::substitute (const hb_ot_shape_plan_t *plan, hb_font_t *font, h
const
unsigned
int
table_index
=
0
;
unsigned
int
i
=
0
;
for
(
unsigned
int
pause_index
=
0
;
pause_index
<
pauses
[
table_index
].
len
;
paus
e_index
++
)
{
const
pause_map_t
*
pause
=
&
pauses
[
table_index
][
paus
e_index
];
for
(;
i
<
paus
e
->
num_lookups
;
i
++
)
for
(
unsigned
int
stage_index
=
0
;
stage_index
<
stages
[
table_index
].
len
;
stag
e_index
++
)
{
const
stage_map_t
*
stage
=
&
stages
[
table_index
][
stag
e_index
];
for
(;
i
<
stag
e
->
num_lookups
;
i
++
)
hb_ot_layout_substitute_lookup
(
font
,
buffer
,
lookups
[
table_index
][
i
].
index
,
lookups
[
table_index
][
i
].
mask
,
lookups
[
table_index
][
i
].
auto_zwj
);
if
(
paus
e
->
callback
)
if
(
stag
e
->
callback
)
{
buffer
->
clear_output
();
paus
e
->
callback
(
plan
,
font
,
buffer
);
stag
e
->
callback
(
plan
,
font
,
buffer
);
}
}
}
...
...
@@ -128,15 +128,15 @@ void hb_ot_map_t::position (const hb_ot_shape_plan_t *plan, hb_font_t *font, hb_
const
unsigned
int
table_index
=
1
;
unsigned
int
i
=
0
;
for
(
unsigned
int
pause_index
=
0
;
pause_index
<
pauses
[
table_index
].
len
;
paus
e_index
++
)
{
const
pause_map_t
*
pause
=
&
pauses
[
table_index
][
paus
e_index
];
for
(;
i
<
paus
e
->
num_lookups
;
i
++
)
for
(
unsigned
int
stage_index
=
0
;
stage_index
<
stages
[
table_index
].
len
;
stag
e_index
++
)
{
const
stage_map_t
*
stage
=
&
stages
[
table_index
][
stag
e_index
];
for
(;
i
<
stag
e
->
num_lookups
;
i
++
)
hb_ot_layout_position_lookup
(
font
,
buffer
,
lookups
[
table_index
][
i
].
index
,
lookups
[
table_index
][
i
].
mask
,
lookups
[
table_index
][
i
].
auto_zwj
);
if
(
paus
e
->
callback
)
paus
e
->
callback
(
plan
,
font
,
buffer
);
if
(
stag
e
->
callback
)
stag
e
->
callback
(
plan
,
font
,
buffer
);
}
}
...
...
@@ -148,10 +148,10 @@ void hb_ot_map_t::collect_lookups (unsigned int table_index, hb_set_t *lookups_o
void
hb_ot_map_builder_t
::
add_pause
(
unsigned
int
table_index
,
hb_ot_map_t
::
pause_func_t
pause_func
)
{
pause_info_t
*
p
=
paus
es
[
table_index
].
push
();
if
(
likely
(
p
))
{
p
->
stage
=
current_stage
[
table_index
];
p
->
callback
=
pause_func
;
stage_info_t
*
s
=
stag
es
[
table_index
].
push
();
if
(
likely
(
s
))
{
s
->
index
=
current_stage
[
table_index
];
s
->
callback
=
pause_func
;
}
current_stage
[
table_index
]
++
;
...
...
@@ -268,7 +268,7 @@ hb_ot_map_builder_t::compile (hb_ot_map_t &m)
&
required_feature_index
))
m
.
add_lookups
(
face
,
table_index
,
required_feature_index
,
1
,
true
);
unsigned
int
paus
e_index
=
0
;
unsigned
int
stag
e_index
=
0
;
unsigned
int
last_num_lookups
=
0
;
for
(
unsigned
stage
=
0
;
stage
<
current_stage
[
table_index
];
stage
++
)
{
...
...
@@ -298,14 +298,14 @@ hb_ot_map_builder_t::compile (hb_ot_map_t &m)
last_num_lookups
=
m
.
lookups
[
table_index
].
len
;
if
(
pause_index
<
pauses
[
table_index
].
len
&&
pauses
[
table_index
][
pause_index
].
stage
==
stage
)
{
hb_ot_map_t
::
pause_map_t
*
pause_map
=
m
.
paus
es
[
table_index
].
push
();
if
(
stage_index
<
stages
[
table_index
].
len
&&
stages
[
table_index
][
stage_index
].
index
==
stage
)
{
hb_ot_map_t
::
stage_map_t
*
pause_map
=
m
.
stag
es
[
table_index
].
push
();
if
(
likely
(
pause_map
))
{
pause_map
->
num_lookups
=
last_num_lookups
;
pause_map
->
callback
=
pauses
[
table_index
][
paus
e_index
].
callback
;
pause_map
->
callback
=
stages
[
table_index
][
stag
e_index
].
callback
;
}
paus
e_index
++
;
stag
e_index
++
;
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录