Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
cf59c758
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看板
提交
cf59c758
编写于
7月 21, 2015
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[USE] Use use_category() for rphf/pref memory
上级
595936ec
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
22 addition
and
41 deletion
+22
-41
src/hb-ot-shape-complex-use.cc
src/hb-ot-shape-complex-use.cc
+22
-41
未找到文件。
src/hb-ot-shape-complex-use.cc
浏览文件 @
cf59c758
...
...
@@ -109,7 +109,7 @@ collect_features_use (hb_ot_shape_planner_t *plan)
map
->
add_gsub_pause
(
clear_substitution_flags
);
map
->
add_feature
(
HB_TAG
(
'r'
,
'p'
,
'h'
,
'f'
),
1
,
F_MANUAL_ZWJ
);
map
->
add_gsub_pause
(
record_rphf
);
map
->
add_feature
(
HB_TAG
(
'p'
,
'r'
,
'e'
,
'f'
),
1
,
F_MANUAL_ZWJ
);
map
->
add_feature
(
HB_TAG
(
'p'
,
'r'
,
'e'
,
'f'
),
1
,
F_
GLOBAL
|
F_
MANUAL_ZWJ
);
map
->
add_gsub_pause
(
record_pref
);
/* "Orthographic unit shaping group" */
...
...
@@ -131,7 +131,6 @@ struct use_shape_plan_t
ASSERT_POD
();
hb_mask_t
rphf_mask
;
hb_mask_t
pref_mask
;
};
static
void
*
...
...
@@ -142,7 +141,6 @@ data_create_use (const hb_ot_shape_plan_t *plan)
return
NULL
;
use_plan
->
rphf_mask
=
plan
->
map
.
get_1_mask
(
HB_TAG
(
'r'
,
'p'
,
'h'
,
'f'
));
use_plan
->
pref_mask
=
plan
->
map
.
get_1_mask
(
HB_TAG
(
'p'
,
'r'
,
'e'
,
'f'
));
return
use_plan
;
}
...
...
@@ -197,9 +195,7 @@ setup_syllable (const use_shape_plan_t *use_plan,
{
unsigned
int
limit
=
info
[
start
].
use_category
()
==
USE_R
?
1
:
MIN
(
3u
,
end
-
start
);
for
(
unsigned
int
i
=
start
;
i
<
start
+
limit
;
i
++
)
info
[
i
].
mask
|=
use_plan
->
rphf_mask
|
use_plan
->
pref_mask
;
for
(
unsigned
int
i
=
start
+
limit
;
i
<
end
;
i
++
)
info
[
i
].
mask
|=
use_plan
->
pref_mask
;
info
[
i
].
mask
|=
use_plan
->
rphf_mask
;
}
static
void
...
...
@@ -211,7 +207,7 @@ setup_syllables (const hb_ot_shape_plan_t *plan,
/* Setup masks for 'rphf' and 'pref'. */
const
use_shape_plan_t
*
use_plan
=
(
const
use_shape_plan_t
*
)
plan
->
data
;
if
(
!
(
use_plan
->
rphf_mask
|
use_plan
->
pref_mask
)
)
return
;
if
(
!
use_plan
->
rphf_mask
)
return
;
hb_glyph_info_t
*
info
=
buffer
->
info
;
unsigned
int
count
=
buffer
->
len
;
...
...
@@ -243,21 +239,14 @@ record_rphf_syllable (hb_glyph_info_t *info,
unsigned
int
start
,
unsigned
int
end
,
hb_mask_t
mask
)
{
unsigned
int
i
=
start
;
if
(
info
[
i
].
use_category
()
!=
USE_R
)
for
(;
i
<
end
&&
!
_hb_glyph_info_substituted
(
&
info
[
i
]);
i
++
)
info
[
i
].
mask
&=
~
mask
;
if
(
i
==
end
)
return
;
/* Found the one. Don't clear its mask. */
i
++
;
/* Clear the mask on the rest. */
for
(;
i
<
end
;
i
++
)
info
[
i
].
mask
&=
~
mask
;
/* Mark a substituted repha as USE_R. */
for
(
unsigned
int
i
=
start
;
i
<
end
&&
(
info
[
i
].
mask
&
mask
);
i
++
)
if
(
_hb_glyph_info_substituted
(
&
info
[
i
]))
{
/* Found the one. Mark it as Repha. */
info
[
i
].
use_category
()
=
USE_R
;
return
;
}
}
static
void
...
...
@@ -285,22 +274,16 @@ record_rphf (const hb_ot_shape_plan_t *plan,
static
void
record_pref_syllable
(
hb_glyph_info_t
*
info
,
unsigned
int
start
,
unsigned
int
end
,
hb_mask_t
mask
)
unsigned
int
start
,
unsigned
int
end
)
{
unsigned
int
i
=
start
;
for
(;
i
<
end
&&
!
_hb_glyph_info_substituted
(
&
info
[
i
]);
i
++
)
info
[
i
].
mask
&=
~
mask
;
if
(
i
==
end
)
return
;
/* Found the one. Don't clear its mask. */
i
++
;
/* Clear the mask on the rest. */
for
(;
i
<
end
;
i
++
)
info
[
i
].
mask
&=
~
mask
;
/* Mark a substituted pref as VPre, as they behave the same way. */
for
(
unsigned
int
i
=
start
;
i
<
end
;
i
++
)
if
(
_hb_glyph_info_substituted
(
&
info
[
i
]))
{
/* Found the one. Mark it as Repha. */
info
[
i
].
use_category
()
=
USE_VPre
;
return
;
}
}
static
void
...
...
@@ -309,9 +292,7 @@ record_pref (const hb_ot_shape_plan_t *plan,
hb_buffer_t
*
buffer
)
{
const
use_shape_plan_t
*
use_plan
=
(
const
use_shape_plan_t
*
)
plan
->
data
;
hb_mask_t
mask
=
use_plan
->
pref_mask
;
if
(
!
mask
)
return
;
hb_glyph_info_t
*
info
=
buffer
->
info
;
unsigned
int
count
=
buffer
->
len
;
if
(
unlikely
(
!
count
))
return
;
...
...
@@ -319,11 +300,11 @@ record_pref (const hb_ot_shape_plan_t *plan,
unsigned
int
last_syllable
=
info
[
0
].
syllable
();
for
(
unsigned
int
i
=
1
;
i
<
count
;
i
++
)
if
(
last_syllable
!=
info
[
i
].
syllable
())
{
record_pref_syllable
(
info
,
last
,
i
,
mask
);
record_pref_syllable
(
info
,
last
,
i
);
last
=
i
;
last_syllable
=
info
[
last
].
syllable
();
}
record_pref_syllable
(
info
,
last
,
count
,
mask
);
record_pref_syllable
(
info
,
last
,
count
);
}
static
void
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录