Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
8d1eef3f
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看板
提交
8d1eef3f
编写于
8月 09, 2012
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Minor
上级
56c9e7c0
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
31 addition
and
19 deletion
+31
-19
src/hb-ot-shape-normalize.cc
src/hb-ot-shape-normalize.cc
+31
-19
未找到文件。
src/hb-ot-shape-normalize.cc
浏览文件 @
8d1eef3f
...
...
@@ -258,13 +258,25 @@ compose_func (hb_unicode_funcs_t *unicode,
return
found
;
}
static
void
output_
glyph
(
hb_buffer_t
*
buffer
,
hb_codepoint_t
glyph
)
static
inline
void
output_
char
(
hb_buffer_t
*
buffer
,
hb_codepoint_t
unichar
)
{
buffer
->
output_glyph
(
glyph
);
buffer
->
output_glyph
(
unichar
);
_hb_glyph_info_set_unicode_props
(
&
buffer
->
prev
(),
buffer
->
unicode
);
}
static
inline
void
next_char
(
hb_buffer_t
*
buffer
)
{
buffer
->
next_glyph
();
}
static
inline
void
skip_char
(
hb_buffer_t
*
buffer
)
{
buffer
->
skip_glyph
();
}
static
bool
decompose
(
hb_font_t
*
font
,
hb_buffer_t
*
buffer
,
bool
shortest
,
...
...
@@ -279,22 +291,22 @@ decompose (hb_font_t *font, hb_buffer_t *buffer,
bool
has_a
=
font
->
get_glyph
(
a
,
0
,
&
glyph
);
if
(
shortest
&&
has_a
)
{
/* Output a and b */
output_
glyph
(
buffer
,
a
);
output_
char
(
buffer
,
a
);
if
(
b
)
output_
glyph
(
buffer
,
b
);
output_
char
(
buffer
,
b
);
return
true
;
}
if
(
decompose
(
font
,
buffer
,
shortest
,
a
))
{
if
(
b
)
output_
glyph
(
buffer
,
b
);
output_
char
(
buffer
,
b
);
return
true
;
}
if
(
has_a
)
{
output_
glyph
(
buffer
,
a
);
output_
char
(
buffer
,
a
);
if
(
b
)
output_
glyph
(
buffer
,
b
);
output_
char
(
buffer
,
b
);
return
true
;
}
...
...
@@ -318,7 +330,7 @@ decompose_compatibility (hb_font_t *font, hb_buffer_t *buffer,
return
false
;
for
(
i
=
0
;
i
<
len
;
i
++
)
output_
glyph
(
buffer
,
decomposed
[
i
]);
output_
char
(
buffer
,
decomposed
[
i
]);
return
true
;
}
...
...
@@ -331,15 +343,15 @@ decompose_current_character (hb_font_t *font, hb_buffer_t *buffer,
/* Kind of a cute waterfall here... */
if
(
shortest
&&
font
->
get_glyph
(
buffer
->
cur
().
codepoint
,
0
,
&
glyph
))
buffer
->
next_glyph
(
);
next_char
(
buffer
);
else
if
(
decompose
(
font
,
buffer
,
shortest
,
buffer
->
cur
().
codepoint
))
buffer
->
skip_glyph
(
);
skip_char
(
buffer
);
else
if
(
!
shortest
&&
font
->
get_glyph
(
buffer
->
cur
().
codepoint
,
0
,
&
glyph
))
buffer
->
next_glyph
(
);
next_char
(
buffer
);
else
if
(
decompose_compatibility
(
font
,
buffer
,
buffer
->
cur
().
codepoint
))
buffer
->
skip_glyph
(
);
skip_char
(
buffer
);
else
buffer
->
next_glyph
(
);
next_char
(
buffer
);
}
static
void
...
...
@@ -350,7 +362,7 @@ decompose_multi_char_cluster (hb_font_t *font, hb_buffer_t *buffer,
for
(
unsigned
int
i
=
buffer
->
idx
;
i
<
end
;
i
++
)
if
(
unlikely
(
buffer
->
unicode
->
is_variation_selector
(
buffer
->
info
[
i
].
codepoint
)))
{
while
(
buffer
->
idx
<
end
)
buffer
->
next_glyph
(
);
next_char
(
buffer
);
return
;
}
...
...
@@ -445,7 +457,7 @@ _hb_ot_shape_normalize (hb_font_t *font, hb_buffer_t *buffer,
buffer
->
clear_output
();
count
=
buffer
->
len
;
unsigned
int
starter
=
0
;
buffer
->
next_glyph
(
);
next_char
(
buffer
);
while
(
buffer
->
idx
<
count
)
{
hb_codepoint_t
composed
,
glyph
;
...
...
@@ -466,11 +478,11 @@ _hb_ot_shape_normalize (hb_font_t *font, hb_buffer_t *buffer,
font
->
get_glyph
(
composed
,
0
,
&
glyph
))
{
/* Composes. */
buffer
->
next_glyph
(
);
/* Copy to out-buffer. */
next_char
(
buffer
);
/* Copy to out-buffer. */
if
(
unlikely
(
buffer
->
in_error
))
return
;
buffer
->
merge_out_clusters
(
starter
,
buffer
->
out_len
);
buffer
->
out_len
--
;
/* Remove the second composble. */
buffer
->
out_len
--
;
/* Remove the second compos
a
ble. */
buffer
->
out_info
[
starter
].
codepoint
=
composed
;
/* Modify starter and carry on. */
_hb_glyph_info_set_unicode_props
(
&
buffer
->
out_info
[
starter
],
buffer
->
unicode
);
...
...
@@ -478,7 +490,7 @@ _hb_ot_shape_normalize (hb_font_t *font, hb_buffer_t *buffer,
}
/* Blocked, or doesn't compose. */
buffer
->
next_glyph
(
);
next_char
(
buffer
);
if
(
_hb_glyph_info_get_modified_combining_class
(
&
buffer
->
prev
())
==
0
)
starter
=
buffer
->
out_len
-
1
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录