Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
45412523
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
45412523
编写于
7月 22, 2011
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
More normalization kick
上级
63c0ef4a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
46 addition
and
29 deletion
+46
-29
src/hb-ot-shape-normalize.cc
src/hb-ot-shape-normalize.cc
+36
-18
src/hb-ot-shape-private.hh
src/hb-ot-shape-private.hh
+7
-1
src/hb-ot-shape.cc
src/hb-ot-shape.cc
+3
-10
未找到文件。
src/hb-ot-shape-normalize.cc
浏览文件 @
45412523
...
...
@@ -63,12 +63,34 @@ HB_BEGIN_DECLS
* matra for the Indic shaper.
*/
static
bool
get_glyph
(
hb_ot_shape_context_t
*
c
,
unsigned
int
i
)
decompose
(
hb_ot_shape_context_t
*
c
,
bool
recompose
,
hb_codepoint_t
ab
)
{
hb_codepoint_t
glyph
;
hb_codepoint_t
a
,
b
,
glyph
;
bool
has_this
=
hb_font_get_glyph
(
c
->
font
,
ab
,
0
,
&
glyph
);
/* If recomposing and the single char is supported by the font, we're good. */
if
(
recompose
&&
has_this
)
return
TRUE
;
if
(
hb_unicode_decompose
(
c
->
buffer
->
unicode
,
ab
,
&
a
,
&
b
)
&&
hb_font_get_glyph
(
c
->
font
,
b
,
0
,
&
glyph
)
&&
decompose
(
c
,
recompose
,
a
))
{
/* Successfully decomposed. */
if
(
recompose
)
{
/* Try composing b with base if not blocked */
return
hb_font_get_glyph
(
c
->
font
,
c
->
buffer
->
info
[
i
].
codepoint
,
0
,
&
glyph
);
}
return
TRUE
;
}
return
has_this
;
}
static
bool
...
...
@@ -76,23 +98,23 @@ decompose_single_char_cluster (hb_ot_shape_context_t *c,
bool
recompose
,
unsigned
int
i
)
{
// c->buffer->copy ();
// bool ret = decompose (c, recompose, c->buffer->info[i].codepoint);
// c->buffer->skip ();
// return ret;
return
FALSE
;
}
static
bool
static
void
handle_single_char_cluster
(
hb_ot_shape_context_t
*
c
,
bool
recompose
,
unsigned
int
i
)
{
/* If recomposing and the single char is supported by the font, we're good. */
if
(
recompose
&&
get_glyph
(
c
,
i
))
return
FALSE
;
/* Decompose */
return
decompose_single_char_cluster
(
c
,
recompose
,
i
);
decompose_single_char_cluster
(
c
,
recompose
,
i
);
}
static
bool
static
void
handle_multi_char_cluster
(
hb_ot_shape_context_t
*
c
,
bool
recompose
,
unsigned
int
start
,
...
...
@@ -101,16 +123,14 @@ handle_multi_char_cluster (hb_ot_shape_context_t *c,
/* TODO Currently if there's a variation-selector we give-up, it's just too hard. */
for
(
unsigned
int
i
=
start
;
i
<
end
;
i
++
)
if
(
unlikely
(
is_variation_selector
(
c
->
buffer
->
info
[
i
].
codepoint
)))
return
FALSE
;
return
;
return
FALSE
;
}
bool
void
_hb_ot_shape_normalize
(
hb_ot_shape_context_t
*
c
)
{
hb_buffer_t
*
buffer
=
c
->
buffer
;
bool
changed
=
FALSE
;
bool
recompose
=
!
hb_ot_shape_complex_prefer_decomposed
(
c
->
plan
->
shaper
);
buffer
->
clear_output
();
...
...
@@ -125,16 +145,14 @@ _hb_ot_shape_normalize (hb_ot_shape_context_t *c)
break
;
if
(
buffer
->
i
+
1
==
end
)
changed
|=
handle_single_char_cluster
(
c
,
recompose
,
buffer
->
i
);
handle_single_char_cluster
(
c
,
recompose
,
buffer
->
i
);
else
changed
|=
handle_multi_char_cluster
(
c
,
recompose
,
buffer
->
i
,
end
);
handle_multi_char_cluster
(
c
,
recompose
,
buffer
->
i
,
end
);
while
(
buffer
->
i
<
end
)
c
->
buffer
->
next_glyph
();
}
buffer
->
swap
();
return
changed
;
}
HB_END_DECLS
src/hb-ot-shape-private.hh
浏览文件 @
45412523
...
...
@@ -99,8 +99,14 @@ is_variation_selector (hb_codepoint_t unicode)
(
unicode
>=
0xE0100
&&
unicode
<=
0xE01EF
));
/* VARIATION SELECTOR-17..256 */
}
static
inline
void
hb_glyph_info_set_unicode_props
(
hb_glyph_info_t
*
info
,
hb_unicode_funcs_t
*
unicode
)
{
info
->
general_category
()
=
hb_unicode_general_category
(
unicode
,
info
->
codepoint
);
info
->
combining_class
()
=
hb_unicode_combining_class
(
unicode
,
info
->
codepoint
);
}
HB_INTERNAL
bool
_hb_ot_shape_normalize
(
hb_ot_shape_context_t
*
c
);
HB_INTERNAL
void
_hb_ot_shape_normalize
(
hb_ot_shape_context_t
*
c
);
HB_END_DECLS
...
...
src/hb-ot-shape.cc
浏览文件 @
45412523
...
...
@@ -179,14 +179,9 @@ hb_ot_position_complex (hb_ot_shape_context_t *c)
static
void
hb_set_unicode_props
(
hb_buffer_t
*
buffer
)
{
hb_unicode_funcs_t
*
unicode
=
buffer
->
unicode
;
hb_glyph_info_t
*
info
=
buffer
->
info
;
unsigned
int
count
=
buffer
->
len
;
for
(
unsigned
int
i
=
1
;
i
<
count
;
i
++
)
{
info
[
i
].
general_category
()
=
hb_unicode_general_category
(
unicode
,
info
[
i
].
codepoint
);
info
[
i
].
combining_class
()
=
hb_unicode_combining_class
(
unicode
,
info
[
i
].
codepoint
);
}
for
(
unsigned
int
i
=
1
;
i
<
count
;
i
++
)
hb_glyph_info_set_unicode_props
(
&
buffer
->
info
[
i
],
buffer
->
unicode
);
}
static
void
...
...
@@ -365,9 +360,7 @@ hb_ot_shape_execute_internal (hb_ot_shape_context_t *c)
hb_ensure_native_direction
(
c
->
buffer
);
if
(
_hb_ot_shape_normalize
(
c
))
/* Buffer contents changed, reset unicode_props */
hb_set_unicode_props
(
c
->
buffer
);
/* BUFFER: Set general_category and combining_class in var1 */
_hb_ot_shape_normalize
(
c
);
hb_ot_shape_setup_masks
(
c
);
/* BUFFER: Clobbers var2 */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录