Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
5c6f5982
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看板
提交
5c6f5982
编写于
7月 21, 2011
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Towards normalization
上级
ad903e66
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
27 addition
and
13 deletion
+27
-13
src/hb-ot-shape-normalize.cc
src/hb-ot-shape-normalize.cc
+22
-11
src/hb-ot-shape-private.hh
src/hb-ot-shape-private.hh
+2
-1
src/hb-ot-shape.cc
src/hb-ot-shape.cc
+3
-1
未找到文件。
src/hb-ot-shape-normalize.cc
浏览文件 @
5c6f5982
...
@@ -28,32 +28,41 @@
...
@@ -28,32 +28,41 @@
HB_BEGIN_DECLS
HB_BEGIN_DECLS
static
void
static
bool
handle_single_char_cluster
(
hb_ot_shape_context_t
*
c
,
get_glyph
(
hb_ot_shape_context_t
*
c
,
unsigned
int
i
)
unsigned
int
i
)
{
{
hb_buffer_t
*
b
=
c
->
buffer
;
hb_buffer_t
*
b
=
c
->
buffer
;
hb_codepoint_t
glyph
;
if
(
hb_font_get_glyph
(
c
->
font
,
b
->
info
[
i
].
codepoint
,
0
,
&
glyph
))
return
hb_font_get_glyph
(
c
->
font
,
b
->
info
[
i
].
codepoint
,
0
,
&
b
->
info
[
i
].
intermittent_glyph
());
return
;
}
static
bool
handle_single_char_cluster
(
hb_ot_shape_context_t
*
c
,
unsigned
int
i
)
{
if
(
get_glyph
(
c
,
i
))
return
FALSE
;
/* Decompose */
/* Decompose */
return
FALSE
;
}
}
static
void
static
bool
handle_multi_char_cluster
(
hb_ot_shape_context_t
*
c
,
handle_multi_char_cluster
(
hb_ot_shape_context_t
*
c
,
unsigned
int
i
,
unsigned
int
i
,
unsigned
int
end
)
unsigned
int
end
)
{
{
/* If there's a variation-selector, give-up, it's just too hard. */
/* If there's a variation-selector, give-up, it's just too hard. */
return
FALSE
;
}
}
void
bool
_hb_normalize
(
hb_ot_shape_context_t
*
c
)
_hb_normalize
(
hb_ot_shape_context_t
*
c
)
{
{
hb_buffer_t
*
b
=
c
->
buffer
;
hb_buffer_t
*
b
=
c
->
buffer
;
bool
changed
=
FALSE
;
unsigned
int
count
=
b
->
len
;
unsigned
int
count
=
b
->
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;)
{
for
(
unsigned
int
i
=
0
;
i
<
count
;)
{
unsigned
int
end
;
unsigned
int
end
;
...
@@ -61,11 +70,13 @@ _hb_normalize (hb_ot_shape_context_t *c)
...
@@ -61,11 +70,13 @@ _hb_normalize (hb_ot_shape_context_t *c)
if
(
b
->
info
[
i
].
cluster
!=
b
->
info
[
end
].
cluster
)
if
(
b
->
info
[
i
].
cluster
!=
b
->
info
[
end
].
cluster
)
break
;
break
;
if
(
i
+
1
==
end
)
if
(
i
+
1
==
end
)
handle_single_char_cluster
(
c
,
i
);
changed
|=
handle_single_char_cluster
(
c
,
i
);
else
else
handle_multi_char_cluster
(
c
,
i
,
end
);
changed
|=
handle_multi_char_cluster
(
c
,
i
,
end
);
i
=
end
;
i
=
end
;
}
}
return
changed
;
}
}
HB_END_DECLS
HB_END_DECLS
src/hb-ot-shape-private.hh
浏览文件 @
5c6f5982
...
@@ -100,8 +100,9 @@ is_variation_selector (hb_codepoint_t unicode)
...
@@ -100,8 +100,9 @@ is_variation_selector (hb_codepoint_t unicode)
}
}
HB_INTERNAL
void
_hb_normalize
(
hb_ot_shape_context_t
*
c
);
HB_INTERNAL
bool
_hb_normalize
(
hb_ot_shape_context_t
*
c
);
#define intermittent_glyph() var2.u32
HB_END_DECLS
HB_END_DECLS
...
...
src/hb-ot-shape.cc
浏览文件 @
5c6f5982
...
@@ -365,7 +365,9 @@ hb_ot_shape_execute_internal (hb_ot_shape_context_t *c)
...
@@ -365,7 +365,9 @@ hb_ot_shape_execute_internal (hb_ot_shape_context_t *c)
hb_ensure_native_direction
(
c
);
hb_ensure_native_direction
(
c
);
_hb_normalize
(
c
);
if
(
_hb_normalize
(
c
))
/* Buffer contents changed, reset unicode_props */
hb_set_unicode_props
(
c
);
/* BUFFER: Set general_category and combining_class in var1 */
hb_ot_shape_setup_masks
(
c
);
/* BUFFER: Clobbers var2 */
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录