Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
5497a8a2
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看板
提交
5497a8a2
编写于
12月 22, 2013
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Cache various masks on the shape plan
上级
02f90966
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
24 addition
and
23 deletion
+24
-23
src/hb-ot-shape-fallback.cc
src/hb-ot-shape-fallback.cc
+2
-4
src/hb-ot-shape-private.hh
src/hb-ot-shape-private.hh
+15
-0
src/hb-ot-shape.cc
src/hb-ot-shape.cc
+7
-19
未找到文件。
src/hb-ot-shape-fallback.cc
浏览文件 @
5497a8a2
...
...
@@ -430,14 +430,12 @@ _hb_ot_shape_fallback_kern (const hb_ot_shape_plan_t *plan,
hb_font_t
*
font
,
hb_buffer_t
*
buffer
)
{
hb_mask_t
kern_mask
=
plan
->
map
.
get_mask
(
HB_DIRECTION_IS_HORIZONTAL
(
buffer
->
props
.
direction
)
?
HB_TAG
(
'k'
,
'e'
,
'r'
,
'n'
)
:
HB_TAG
(
'v'
,
'k'
,
'r'
,
'n'
));
if
(
!
kern_mask
)
return
;
if
(
!
plan
->
has_kern
)
return
;
unsigned
int
count
=
buffer
->
len
;
OT
::
hb_apply_context_t
c
(
1
,
font
,
buffer
);
c
.
set_lookup_mask
(
kern_mask
);
c
.
set_lookup_mask
(
plan
->
kern_mask
);
c
.
set_lookup_props
(
OT
::
LookupFlag
::
IgnoreMarks
);
hb_glyph_info_t
*
info
=
buffer
->
info
;
...
...
src/hb-ot-shape-private.hh
浏览文件 @
5497a8a2
...
...
@@ -40,6 +40,10 @@ struct hb_ot_shape_plan_t
const
struct
hb_ot_complex_shaper_t
*
shaper
;
hb_ot_map_t
map
;
const
void
*
data
;
hb_mask_t
rtlm_mask
,
frac_mask
,
numr_mask
,
dnom_mask
;
hb_mask_t
kern_mask
;
unsigned
int
has_frac
:
1
;
unsigned
int
has_kern
:
1
;
inline
void
collect_lookups
(
hb_tag_t
table_tag
,
hb_set_t
*
lookups
)
const
{
...
...
@@ -77,6 +81,17 @@ struct hb_ot_shape_planner_t
plan
.
props
=
props
;
plan
.
shaper
=
shaper
;
map
.
compile
(
plan
.
map
);
plan
.
rtlm_mask
=
plan
.
map
.
get_1_mask
(
HB_TAG
(
'r'
,
't'
,
'l'
,
'm'
));
plan
.
frac_mask
=
plan
.
map
.
get_1_mask
(
HB_TAG
(
'f'
,
'r'
,
'a'
,
'c'
));
plan
.
numr_mask
=
plan
.
map
.
get_1_mask
(
HB_TAG
(
'n'
,
'u'
,
'm'
,
'r'
));
plan
.
dnom_mask
=
plan
.
map
.
get_1_mask
(
HB_TAG
(
'd'
,
'n'
,
'o'
,
'm'
));
plan
.
kern_mask
=
plan
.
map
.
get_mask
(
HB_DIRECTION_IS_HORIZONTAL
(
plan
.
props
.
direction
)
?
HB_TAG
(
'k'
,
'e'
,
'r'
,
'n'
)
:
HB_TAG
(
'v'
,
'k'
,
'r'
,
'n'
));
plan
.
has_frac
=
plan
.
frac_mask
||
(
plan
.
numr_mask
&&
plan
.
dnom_mask
);
plan
.
has_kern
=
!!
plan
.
kern_mask
;
}
private:
...
...
src/hb-ot-shape.cc
浏览文件 @
5497a8a2
...
...
@@ -296,7 +296,7 @@ hb_ot_mirror_chars (hb_ot_shape_context_t *c)
hb_buffer_t
*
buffer
=
c
->
buffer
;
hb_unicode_funcs_t
*
unicode
=
buffer
->
unicode
;
hb_mask_t
rtlm_mask
=
c
->
plan
->
map
.
get_1_mask
(
HB_TAG
(
'r'
,
't'
,
'l'
,
'm'
))
;
hb_mask_t
rtlm_mask
=
c
->
plan
->
rtlm_mask
;
unsigned
int
count
=
buffer
->
len
;
hb_glyph_info_t
*
info
=
buffer
->
info
;
...
...
@@ -312,9 +312,10 @@ hb_ot_mirror_chars (hb_ot_shape_context_t *c)
static
inline
void
hb_ot_shape_setup_masks_fraction
(
hb_ot_shape_context_t
*
c
)
{
if
(
!
c
->
plan
->
has_frac
)
return
;
hb_buffer_t
*
buffer
=
c
->
buffer
;
bool
initialized
=
false
;
hb_mask_t
frac_mask
=
0
,
numr_mask
=
0
,
dnom_mask
=
0
;
/* TODO look in pre/post context text also. */
unsigned
int
count
=
buffer
->
len
;
...
...
@@ -323,19 +324,6 @@ hb_ot_shape_setup_masks_fraction (hb_ot_shape_context_t *c)
{
if
(
info
[
i
].
codepoint
==
0x2044
)
/* FRACTION SLASH */
{
if
(
!
initialized
)
{
initialized
=
true
;
frac_mask
=
c
->
plan
->
map
.
get_1_mask
(
HB_TAG
(
'f'
,
'r'
,
'a'
,
'c'
));
numr_mask
=
c
->
plan
->
map
.
get_1_mask
(
HB_TAG
(
'n'
,
'u'
,
'm'
,
'r'
));
dnom_mask
=
c
->
plan
->
map
.
get_1_mask
(
HB_TAG
(
'd'
,
'n'
,
'o'
,
'm'
));
/* Only proceed if frac exists, or both numr and dnom exist. */
if
(
!
frac_mask
&&
(
!
numr_mask
||
!
dnom_mask
))
return
;
}
unsigned
int
start
=
i
,
end
=
i
+
1
;
while
(
start
&&
_hb_glyph_info_get_general_category
(
&
info
[
start
-
1
])
==
...
...
@@ -347,10 +335,10 @@ hb_ot_shape_setup_masks_fraction (hb_ot_shape_context_t *c)
end
++
;
for
(
unsigned
int
j
=
start
;
j
<
i
;
j
++
)
info
[
j
].
mask
|=
numr_mask
|
frac_mask
;
info
[
i
].
mask
|=
frac_mask
;
info
[
j
].
mask
|=
c
->
plan
->
numr_mask
|
c
->
plan
->
frac_mask
;
info
[
i
].
mask
|=
c
->
plan
->
frac_mask
;
for
(
unsigned
int
j
=
i
+
1
;
j
<
end
;
j
++
)
info
[
j
].
mask
|=
frac_mask
|
dnom_mask
;
info
[
j
].
mask
|=
c
->
plan
->
frac_mask
|
c
->
plan
->
dnom_mask
;
i
=
end
-
1
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录