Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
650ac00d
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看板
提交
650ac00d
编写于
4月 23, 2012
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Minor refactoring
上级
f94b0aa6
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
36 addition
and
44 deletion
+36
-44
src/hb-ot-layout-gpos-table.hh
src/hb-ot-layout-gpos-table.hh
+12
-15
src/hb-ot-layout-gsub-table.hh
src/hb-ot-layout-gsub-table.hh
+18
-21
src/hb-ot-layout-gsubgpos-private.hh
src/hb-ot-layout-gsubgpos-private.hh
+2
-6
src/hb-ot-layout.cc
src/hb-ot-layout.cc
+4
-2
未找到文件。
src/hb-ot-layout-gpos-table.hh
浏览文件 @
650ac00d
...
...
@@ -1417,24 +1417,22 @@ struct PosLookup : Lookup
return
false
;
}
inline
bool
apply_string
(
hb_font_t
*
font
,
hb_buffer_t
*
buffer
,
hb_mask_t
mask
)
const
inline
bool
apply_string
(
hb_apply_context_t
*
c
)
const
{
bool
ret
=
false
;
if
(
unlikely
(
!
buffer
->
len
))
if
(
unlikely
(
!
c
->
buffer
->
len
))
return
false
;
hb_apply_context_t
c
(
font
,
font
->
face
,
buffer
,
mask
,
*
this
);
c
->
set_lookup
(
*
this
);
buffer
->
idx
=
0
;
while
(
buffer
->
idx
<
buffer
->
len
)
c
->
buffer
->
idx
=
0
;
while
(
c
->
buffer
->
idx
<
c
->
buffer
->
len
)
{
if
((
buffer
->
info
[
buffer
->
idx
].
mask
&
mask
)
&&
apply_once
(
&
c
))
if
((
c
->
buffer
->
info
[
c
->
buffer
->
idx
].
mask
&
c
->
lookup_mask
)
&&
apply_once
(
c
))
ret
=
true
;
else
buffer
->
idx
++
;
c
->
buffer
->
idx
++
;
}
return
ret
;
...
...
@@ -1461,11 +1459,8 @@ struct GPOS : GSUBGPOS
inline
const
PosLookup
&
get_lookup
(
unsigned
int
i
)
const
{
return
CastR
<
PosLookup
>
(
GSUBGPOS
::
get_lookup
(
i
));
}
inline
bool
position_lookup
(
hb_font_t
*
font
,
hb_buffer_t
*
buffer
,
unsigned
int
lookup_index
,
hb_mask_t
mask
)
const
{
return
get_lookup
(
lookup_index
).
apply_string
(
font
,
buffer
,
mask
);
}
inline
bool
position_lookup
(
hb_apply_context_t
*
c
,
unsigned
int
lookup_index
)
const
{
return
get_lookup
(
lookup_index
).
apply_string
(
c
);
}
static
inline
void
position_start
(
hb_buffer_t
*
buffer
);
static
inline
void
position_finish
(
hb_buffer_t
*
buffer
);
...
...
@@ -1584,7 +1579,9 @@ static inline bool position_lookup (hb_apply_context_t *c, unsigned int lookup_i
if
(
unlikely
(
c
->
context_length
<
1
))
return
false
;
hb_apply_context_t
new_c
(
*
c
,
l
);
hb_apply_context_t
new_c
(
*
c
);
new_c
.
nesting_level_left
--
;
new_c
.
set_lookup
(
l
);
return
l
.
apply_once
(
&
new_c
);
}
...
...
src/hb-ot-layout-gsub-table.hh
浏览文件 @
650ac00d
...
...
@@ -1069,46 +1069,44 @@ struct SubstLookup : Lookup
return
false
;
}
inline
bool
apply_string
(
hb_face_t
*
face
,
hb_buffer_t
*
buffer
,
hb_mask_t
mask
)
const
inline
bool
apply_string
(
hb_apply_context_t
*
c
)
const
{
bool
ret
=
false
;
if
(
unlikely
(
!
buffer
->
len
))
if
(
unlikely
(
!
c
->
buffer
->
len
))
return
false
;
hb_apply_context_t
c
(
NULL
,
face
,
buffer
,
mask
,
*
this
);
c
->
set_lookup
(
*
this
);
if
(
likely
(
!
is_reverse
()))
{
/* in/out forward substitution */
buffer
->
clear_output
();
buffer
->
idx
=
0
;
while
(
buffer
->
idx
<
buffer
->
len
)
c
->
buffer
->
clear_output
();
c
->
buffer
->
idx
=
0
;
while
(
c
->
buffer
->
idx
<
c
->
buffer
->
len
)
{
if
((
buffer
->
info
[
buffer
->
idx
].
mask
&
mask
)
&&
apply_once
(
&
c
))
if
((
c
->
buffer
->
info
[
c
->
buffer
->
idx
].
mask
&
c
->
lookup_mask
)
&&
apply_once
(
c
))
ret
=
true
;
else
buffer
->
next_glyph
();
c
->
buffer
->
next_glyph
();
}
if
(
ret
)
buffer
->
swap_buffers
();
c
->
buffer
->
swap_buffers
();
}
else
{
/* in-place backward substitution */
buffer
->
idx
=
buffer
->
len
-
1
;
c
->
buffer
->
idx
=
c
->
buffer
->
len
-
1
;
do
{
if
((
buffer
->
info
[
buffer
->
idx
].
mask
&
mask
)
&&
apply_once
(
&
c
))
if
((
c
->
buffer
->
info
[
c
->
buffer
->
idx
].
mask
&
c
->
lookup_mask
)
&&
apply_once
(
c
))
ret
=
true
;
else
buffer
->
idx
--
;
c
->
buffer
->
idx
--
;
}
while
((
int
)
buffer
->
idx
>=
0
);
while
((
int
)
c
->
buffer
->
idx
>=
0
);
}
return
ret
;
...
...
@@ -1135,11 +1133,8 @@ struct GSUB : GSUBGPOS
inline
const
SubstLookup
&
get_lookup
(
unsigned
int
i
)
const
{
return
CastR
<
SubstLookup
>
(
GSUBGPOS
::
get_lookup
(
i
));
}
inline
bool
substitute_lookup
(
hb_face_t
*
face
,
hb_buffer_t
*
buffer
,
unsigned
int
lookup_index
,
hb_mask_t
mask
)
const
{
return
get_lookup
(
lookup_index
).
apply_string
(
face
,
buffer
,
mask
);
}
inline
bool
substitute_lookup
(
hb_apply_context_t
*
c
,
unsigned
int
lookup_index
)
const
{
return
get_lookup
(
lookup_index
).
apply_string
(
c
);
}
static
inline
void
substitute_start
(
hb_buffer_t
*
buffer
);
static
inline
void
substitute_finish
(
hb_buffer_t
*
buffer
);
...
...
@@ -1238,7 +1233,9 @@ static inline bool substitute_lookup (hb_apply_context_t *c, unsigned int lookup
if
(
unlikely
(
c
->
context_length
<
1
))
return
false
;
hb_apply_context_t
new_c
(
*
c
,
l
);
hb_apply_context_t
new_c
(
*
c
);
new_c
.
nesting_level_left
--
;
new_c
.
set_lookup
(
l
);
return
l
.
apply_once
(
&
new_c
);
}
...
...
src/hb-ot-layout-gsubgpos-private.hh
浏览文件 @
650ac00d
...
...
@@ -103,7 +103,6 @@ struct hb_apply_context_t
hb_face_t
*
face_
,
hb_buffer_t
*
buffer_
,
hb_mask_t
lookup_mask_
,
const
Lookup
&
l
,
unsigned
int
context_length_
=
NO_CONTEXT
,
unsigned
int
nesting_level_left_
=
MAX_NESTING_LEVEL
)
:
font
(
font_
),
face
(
face_
),
buffer
(
buffer_
),
...
...
@@ -111,12 +110,9 @@ struct hb_apply_context_t
lookup_mask
(
lookup_mask_
),
context_length
(
context_length_
),
nesting_level_left
(
nesting_level_left_
),
lookup_props
(
l
.
get_props
()),
property
(
0
),
debug_depth
(
0
)
{}
lookup_props
(
0
),
property
(
0
),
debug_depth
(
0
)
{}
hb_apply_context_t
(
const
hb_apply_context_t
&
c
,
const
Lookup
&
l
)
{
*
this
=
c
;
nesting_level_left
--
;
void
set_lookup
(
const
Lookup
&
l
)
{
lookup_props
=
l
.
get_props
();
}
...
...
src/hb-ot-layout.cc
浏览文件 @
650ac00d
...
...
@@ -460,7 +460,8 @@ hb_ot_layout_substitute_lookup (hb_face_t *face,
unsigned
int
lookup_index
,
hb_mask_t
mask
)
{
return
_get_gsub
(
face
).
substitute_lookup
(
face
,
buffer
,
lookup_index
,
mask
);
hb_apply_context_t
c
(
NULL
,
face
,
buffer
,
mask
);
return
_get_gsub
(
face
).
substitute_lookup
(
&
c
,
lookup_index
);
}
void
...
...
@@ -500,7 +501,8 @@ hb_ot_layout_position_lookup (hb_font_t *font,
unsigned
int
lookup_index
,
hb_mask_t
mask
)
{
return
_get_gpos
(
font
->
face
).
position_lookup
(
font
,
buffer
,
lookup_index
,
mask
);
hb_apply_context_t
c
(
font
,
font
->
face
,
buffer
,
mask
);
return
_get_gpos
(
font
->
face
).
position_lookup
(
&
c
,
lookup_index
);
}
void
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录