Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
3c3df9cb
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看板
提交
3c3df9cb
编写于
10月 17, 2013
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[otlayout] Minor
上级
6cc136f7
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
33 addition
and
29 deletion
+33
-29
src/hb-ot-layout-gsubgpos-private.hh
src/hb-ot-layout-gsubgpos-private.hh
+33
-29
未找到文件。
src/hb-ot-layout-gsubgpos-private.hh
浏览文件 @
3c3df9cb
...
...
@@ -761,7 +761,9 @@ static inline bool match_input (hb_apply_context_t *c,
if
(
unlikely
(
count
>
MAX_CONTEXT_LENGTH
))
TRACE_RETURN
(
false
);
hb_apply_context_t
::
skipping_forward_iterator_t
skippy_iter
(
c
,
c
->
buffer
->
idx
,
count
-
1
);
hb_buffer_t
*
buffer
=
c
->
buffer
;
hb_apply_context_t
::
skipping_forward_iterator_t
skippy_iter
(
c
,
buffer
->
idx
,
count
-
1
);
skippy_iter
.
set_match_func
(
match_func
,
match_data
,
input
);
if
(
skippy_iter
.
has_no_chance
())
return
TRACE_RETURN
(
false
);
...
...
@@ -783,23 +785,23 @@ static inline bool match_input (hb_apply_context_t *c,
* ligate with a conjunct...)
*/
bool
is_mark_ligature
=
!!
(
c
->
buffer
->
cur
().
glyph_props
()
&
HB_OT_LAYOUT_GLYPH_PROPS_MARK
);
bool
is_mark_ligature
=
!!
(
buffer
->
cur
().
glyph_props
()
&
HB_OT_LAYOUT_GLYPH_PROPS_MARK
);
unsigned
int
total_component_count
=
0
;
total_component_count
+=
get_lig_num_comps
(
c
->
buffer
->
cur
());
total_component_count
+=
get_lig_num_comps
(
buffer
->
cur
());
unsigned
int
first_lig_id
=
get_lig_id
(
c
->
buffer
->
cur
());
unsigned
int
first_lig_comp
=
get_lig_comp
(
c
->
buffer
->
cur
());
unsigned
int
first_lig_id
=
get_lig_id
(
buffer
->
cur
());
unsigned
int
first_lig_comp
=
get_lig_comp
(
buffer
->
cur
());
match_positions
[
0
]
=
c
->
buffer
->
idx
;
match_positions
[
0
]
=
buffer
->
idx
;
for
(
unsigned
int
i
=
1
;
i
<
count
;
i
++
)
{
if
(
!
skippy_iter
.
next
())
return
TRACE_RETURN
(
false
);
match_positions
[
i
]
=
skippy_iter
.
idx
;
unsigned
int
this_lig_id
=
get_lig_id
(
c
->
buffer
->
info
[
skippy_iter
.
idx
]);
unsigned
int
this_lig_comp
=
get_lig_comp
(
c
->
buffer
->
info
[
skippy_iter
.
idx
]);
unsigned
int
this_lig_id
=
get_lig_id
(
buffer
->
info
[
skippy_iter
.
idx
]);
unsigned
int
this_lig_comp
=
get_lig_comp
(
buffer
->
info
[
skippy_iter
.
idx
]);
if
(
first_lig_id
&&
first_lig_comp
)
{
/* If first component was attached to a previous ligature component,
...
...
@@ -815,11 +817,11 @@ static inline bool match_input (hb_apply_context_t *c,
return
TRACE_RETURN
(
false
);
}
is_mark_ligature
=
is_mark_ligature
&&
(
c
->
buffer
->
info
[
skippy_iter
.
idx
].
glyph_props
()
&
HB_OT_LAYOUT_GLYPH_PROPS_MARK
);
total_component_count
+=
get_lig_num_comps
(
c
->
buffer
->
info
[
skippy_iter
.
idx
]);
is_mark_ligature
=
is_mark_ligature
&&
(
buffer
->
info
[
skippy_iter
.
idx
].
glyph_props
()
&
HB_OT_LAYOUT_GLYPH_PROPS_MARK
);
total_component_count
+=
get_lig_num_comps
(
buffer
->
info
[
skippy_iter
.
idx
]);
}
*
end_offset
=
skippy_iter
.
idx
-
c
->
buffer
->
idx
+
1
;
*
end_offset
=
skippy_iter
.
idx
-
buffer
->
idx
+
1
;
if
(
p_is_mark_ligature
)
*
p_is_mark_ligature
=
is_mark_ligature
;
...
...
@@ -839,7 +841,9 @@ static inline void ligate_input (hb_apply_context_t *c,
{
TRACE_APPLY
(
NULL
);
c
->
buffer
->
merge_clusters
(
c
->
buffer
->
idx
,
c
->
buffer
->
idx
+
match_length
);
hb_buffer_t
*
buffer
=
c
->
buffer
;
buffer
->
merge_clusters
(
buffer
->
idx
,
buffer
->
idx
+
match_length
);
/*
* - If it *is* a mark ligature, we don't allocate a new ligature id, and leave
...
...
@@ -870,46 +874,46 @@ static inline void ligate_input (hb_apply_context_t *c,
*/
unsigned
int
klass
=
is_mark_ligature
?
0
:
HB_OT_LAYOUT_GLYPH_PROPS_LIGATURE
;
unsigned
int
lig_id
=
is_mark_ligature
?
0
:
allocate_lig_id
(
c
->
buffer
);
unsigned
int
last_lig_id
=
get_lig_id
(
c
->
buffer
->
cur
());
unsigned
int
last_num_components
=
get_lig_num_comps
(
c
->
buffer
->
cur
());
unsigned
int
lig_id
=
is_mark_ligature
?
0
:
allocate_lig_id
(
buffer
);
unsigned
int
last_lig_id
=
get_lig_id
(
buffer
->
cur
());
unsigned
int
last_num_components
=
get_lig_num_comps
(
buffer
->
cur
());
unsigned
int
components_so_far
=
last_num_components
;
if
(
!
is_mark_ligature
)
{
set_lig_props_for_ligature
(
c
->
buffer
->
cur
(),
lig_id
,
total_component_count
);
if
(
_hb_glyph_info_get_general_category
(
&
c
->
buffer
->
cur
())
==
HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK
)
_hb_glyph_info_set_general_category
(
&
c
->
buffer
->
cur
(),
HB_UNICODE_GENERAL_CATEGORY_OTHER_LETTER
);
set_lig_props_for_ligature
(
buffer
->
cur
(),
lig_id
,
total_component_count
);
if
(
_hb_glyph_info_get_general_category
(
&
buffer
->
cur
())
==
HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK
)
_hb_glyph_info_set_general_category
(
&
buffer
->
cur
(),
HB_UNICODE_GENERAL_CATEGORY_OTHER_LETTER
);
}
c
->
replace_glyph
(
lig_glyph
,
klass
);
for
(
unsigned
int
i
=
1
;
i
<
count
;
i
++
)
{
while
(
c
->
buffer
->
idx
<
match_positions
[
i
])
while
(
buffer
->
idx
<
match_positions
[
i
])
{
if
(
!
is_mark_ligature
)
{
unsigned
int
new_lig_comp
=
components_so_far
-
last_num_components
+
MIN
(
MAX
(
get_lig_comp
(
c
->
buffer
->
cur
()),
1u
),
last_num_components
);
set_lig_props_for_mark
(
c
->
buffer
->
cur
(),
lig_id
,
new_lig_comp
);
MIN
(
MAX
(
get_lig_comp
(
buffer
->
cur
()),
1u
),
last_num_components
);
set_lig_props_for_mark
(
buffer
->
cur
(),
lig_id
,
new_lig_comp
);
}
c
->
buffer
->
next_glyph
();
buffer
->
next_glyph
();
}
last_lig_id
=
get_lig_id
(
c
->
buffer
->
cur
());
last_num_components
=
get_lig_num_comps
(
c
->
buffer
->
cur
());
last_lig_id
=
get_lig_id
(
buffer
->
cur
());
last_num_components
=
get_lig_num_comps
(
buffer
->
cur
());
components_so_far
+=
last_num_components
;
/* Skip the base glyph */
c
->
buffer
->
idx
++
;
buffer
->
idx
++
;
}
if
(
!
is_mark_ligature
&&
last_lig_id
)
{
/* Re-adjust components for any marks following. */
for
(
unsigned
int
i
=
c
->
buffer
->
idx
;
i
<
c
->
buffer
->
len
;
i
++
)
{
if
(
last_lig_id
==
get_lig_id
(
c
->
buffer
->
info
[
i
]))
{
for
(
unsigned
int
i
=
buffer
->
idx
;
i
<
buffer
->
len
;
i
++
)
{
if
(
last_lig_id
==
get_lig_id
(
buffer
->
info
[
i
]))
{
unsigned
int
new_lig_comp
=
components_so_far
-
last_num_components
+
MIN
(
MAX
(
get_lig_comp
(
c
->
buffer
->
info
[
i
]),
1u
),
last_num_components
);
set_lig_props_for_mark
(
c
->
buffer
->
info
[
i
],
lig_id
,
new_lig_comp
);
MIN
(
MAX
(
get_lig_comp
(
buffer
->
info
[
i
]),
1u
),
last_num_components
);
set_lig_props_for_mark
(
buffer
->
info
[
i
],
lig_id
,
new_lig_comp
);
}
else
break
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录