Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
70fe9e73
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看板
提交
70fe9e73
编写于
5月 13, 2019
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix moreeeeeeeeeee
上级
68e12e68
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
16 addition
and
14 deletion
+16
-14
src/hb-icu.cc
src/hb-icu.cc
+15
-13
src/hb-subset-plan.cc
src/hb-subset-plan.cc
+1
-1
未找到文件。
src/hb-icu.cc
浏览文件 @
70fe9e73
...
@@ -49,6 +49,8 @@
...
@@ -49,6 +49,8 @@
* Functions for using HarfBuzz with the ICU library to provide Unicode data.
* Functions for using HarfBuzz with the ICU library to provide Unicode data.
**/
**/
/* ICU doesn't do-while(0) around their statements. Ouch! */
#define HB_ICU_STMT(S) do { S } while (0)
hb_script_t
hb_script_t
hb_icu_script_to_script
(
UScriptCode
script
)
hb_icu_script_to_script
(
UScriptCode
script
)
...
@@ -183,9 +185,9 @@ hb_icu_unicode_compose (hb_unicode_funcs_t *ufuncs HB_UNUSED,
...
@@ -183,9 +185,9 @@ hb_icu_unicode_compose (hb_unicode_funcs_t *ufuncs HB_UNUSED,
len
=
0
;
len
=
0
;
err
=
false
;
err
=
false
;
U16_APPEND
(
utf16
,
len
,
ARRAY_LENGTH
(
utf16
),
a
,
err
);
HB_ICU_STMT
(
U16_APPEND
(
utf16
,
len
,
ARRAY_LENGTH
(
utf16
),
a
,
err
)
);
if
(
err
)
return
false
;
if
(
err
)
return
false
;
U16_APPEND
(
utf16
,
len
,
ARRAY_LENGTH
(
utf16
),
b
,
err
);
HB_ICU_STMT
(
U16_APPEND
(
utf16
,
len
,
ARRAY_LENGTH
(
utf16
),
b
,
err
)
);
if
(
err
)
return
false
;
if
(
err
)
return
false
;
icu_err
=
U_ZERO_ERROR
;
icu_err
=
U_ZERO_ERROR
;
...
@@ -193,7 +195,7 @@ hb_icu_unicode_compose (hb_unicode_funcs_t *ufuncs HB_UNUSED,
...
@@ -193,7 +195,7 @@ hb_icu_unicode_compose (hb_unicode_funcs_t *ufuncs HB_UNUSED,
if
(
U_FAILURE
(
icu_err
))
if
(
U_FAILURE
(
icu_err
))
return
false
;
return
false
;
if
(
u_countChar32
(
normalized
,
len
)
==
1
)
{
if
(
u_countChar32
(
normalized
,
len
)
==
1
)
{
U16_GET_UNSAFE
(
normalized
,
0
,
*
ab
);
HB_ICU_STMT
(
U16_GET_UNSAFE
(
normalized
,
0
,
*
ab
)
);
ret
=
true
;
ret
=
true
;
}
else
{
}
else
{
ret
=
false
;
ret
=
false
;
...
@@ -221,13 +223,13 @@ hb_icu_unicode_decompose (hb_unicode_funcs_t *ufuncs HB_UNUSED,
...
@@ -221,13 +223,13 @@ hb_icu_unicode_decompose (hb_unicode_funcs_t *ufuncs HB_UNUSED,
len
=
u_countChar32
(
decomposed
,
len
);
len
=
u_countChar32
(
decomposed
,
len
);
if
(
len
==
1
)
{
if
(
len
==
1
)
{
U16_GET_UNSAFE
(
decomposed
,
0
,
*
a
);
HB_ICU_STMT
(
U16_GET_UNSAFE
(
decomposed
,
0
,
*
a
)
);
*
b
=
0
;
*
b
=
0
;
return
*
a
!=
ab
;
return
*
a
!=
ab
;
}
else
if
(
len
==
2
)
{
}
else
if
(
len
==
2
)
{
len
=
0
;
len
=
0
;
U16_NEXT_UNSAFE
(
decomposed
,
len
,
*
a
);
HB_ICU_STMT
(
U16_NEXT_UNSAFE
(
decomposed
,
len
,
*
a
)
);
U16_NEXT_UNSAFE
(
decomposed
,
len
,
*
b
);
HB_ICU_STMT
(
U16_NEXT_UNSAFE
(
decomposed
,
len
,
*
b
)
);
}
}
return
true
;
return
true
;
}
}
...
@@ -247,7 +249,7 @@ hb_icu_unicode_decompose (hb_unicode_funcs_t *ufuncs HB_UNUSED,
...
@@ -247,7 +249,7 @@ hb_icu_unicode_decompose (hb_unicode_funcs_t *ufuncs HB_UNUSED,
len
=
0
;
len
=
0
;
err
=
false
;
err
=
false
;
U16_APPEND
(
utf16
,
len
,
ARRAY_LENGTH
(
utf16
),
ab
,
err
);
HB_ICU_STMT
(
U16_APPEND
(
utf16
,
len
,
ARRAY_LENGTH
(
utf16
),
ab
,
err
)
);
if
(
err
)
return
false
;
if
(
err
)
return
false
;
icu_err
=
U_ZERO_ERROR
;
icu_err
=
U_ZERO_ERROR
;
...
@@ -258,13 +260,13 @@ hb_icu_unicode_decompose (hb_unicode_funcs_t *ufuncs HB_UNUSED,
...
@@ -258,13 +260,13 @@ hb_icu_unicode_decompose (hb_unicode_funcs_t *ufuncs HB_UNUSED,
len
=
u_countChar32
(
normalized
,
len
);
len
=
u_countChar32
(
normalized
,
len
);
if
(
len
==
1
)
{
if
(
len
==
1
)
{
U16_GET_UNSAFE
(
normalized
,
0
,
*
a
);
HB_ICU_STMT
(
U16_GET_UNSAFE
(
normalized
,
0
,
*
a
)
);
*
b
=
0
;
*
b
=
0
;
ret
=
*
a
!=
ab
;
ret
=
*
a
!=
ab
;
}
else
if
(
len
==
2
)
{
}
else
if
(
len
==
2
)
{
len
=
0
;
len
=
0
;
U16_NEXT_UNSAFE
(
normalized
,
len
,
*
a
);
HB_ICU_STMT
(
U16_NEXT_UNSAFE
(
normalized
,
len
,
*
a
)
);
U16_NEXT_UNSAFE
(
normalized
,
len
,
*
b
);
HB_ICU_STMT
(
U16_NEXT_UNSAFE
(
normalized
,
len
,
*
b
)
);
/* Here's the ugly part: if ab decomposes to a single character and
/* Here's the ugly part: if ab decomposes to a single character and
* that character decomposes again, we have to detect that and undo
* that character decomposes again, we have to detect that and undo
...
@@ -275,7 +277,7 @@ hb_icu_unicode_decompose (hb_unicode_funcs_t *ufuncs HB_UNUSED,
...
@@ -275,7 +277,7 @@ hb_icu_unicode_decompose (hb_unicode_funcs_t *ufuncs HB_UNUSED,
if
(
U_FAILURE
(
icu_err
))
if
(
U_FAILURE
(
icu_err
))
return
false
;
return
false
;
hb_codepoint_t
c
;
hb_codepoint_t
c
;
U16_GET_UNSAFE
(
recomposed
,
0
,
c
);
HB_ICU_STMT
(
U16_GET_UNSAFE
(
recomposed
,
0
,
c
)
);
if
(
c
!=
*
a
&&
c
!=
ab
)
{
if
(
c
!=
*
a
&&
c
!=
ab
)
{
*
a
=
c
;
*
a
=
c
;
*
b
=
0
;
*
b
=
0
;
...
@@ -284,7 +286,7 @@ hb_icu_unicode_decompose (hb_unicode_funcs_t *ufuncs HB_UNUSED,
...
@@ -284,7 +286,7 @@ hb_icu_unicode_decompose (hb_unicode_funcs_t *ufuncs HB_UNUSED,
}
else
{
}
else
{
/* If decomposed to more than two characters, take the last one,
/* If decomposed to more than two characters, take the last one,
* and recompose the rest to get the first component. */
* and recompose the rest to get the first component. */
U16_PREV_UNSAFE
(
normalized
,
len
,
*
b
);
/* Changes len in-place. */
HB_ICU_STMT
(
U16_PREV_UNSAFE
(
normalized
,
len
,
*
b
)
);
/* Changes len in-place. */
UChar
recomposed
[
18
*
2
];
UChar
recomposed
[
18
*
2
];
icu_err
=
U_ZERO_ERROR
;
icu_err
=
U_ZERO_ERROR
;
len
=
unorm2_normalize
(
unorm2_getNFCInstance
(
&
icu_err
),
normalized
,
len
,
recomposed
,
ARRAY_LENGTH
(
recomposed
),
&
icu_err
);
len
=
unorm2_normalize
(
unorm2_getNFCInstance
(
&
icu_err
),
normalized
,
len
,
recomposed
,
ARRAY_LENGTH
(
recomposed
),
&
icu_err
);
...
@@ -293,7 +295,7 @@ hb_icu_unicode_decompose (hb_unicode_funcs_t *ufuncs HB_UNUSED,
...
@@ -293,7 +295,7 @@ hb_icu_unicode_decompose (hb_unicode_funcs_t *ufuncs HB_UNUSED,
/* We expect that recomposed has exactly one character now. */
/* We expect that recomposed has exactly one character now. */
if
(
unlikely
(
u_countChar32
(
recomposed
,
len
)
!=
1
))
if
(
unlikely
(
u_countChar32
(
recomposed
,
len
)
!=
1
))
return
false
;
return
false
;
U16_GET_UNSAFE
(
recomposed
,
0
,
*
a
);
HB_ICU_STMT
(
U16_GET_UNSAFE
(
recomposed
,
0
,
*
a
)
);
ret
=
true
;
ret
=
true
;
}
}
...
...
src/hb-subset-plan.cc
浏览文件 @
70fe9e73
...
@@ -176,7 +176,7 @@ _create_old_gid_to_new_gid_map (const hb_face_t *face,
...
@@ -176,7 +176,7 @@ _create_old_gid_to_new_gid_map (const hb_face_t *face,
|
hb_map
([
=
]
(
hb_codepoint_t
_
)
{
|
hb_map
([
=
]
(
hb_codepoint_t
_
)
{
return
hb_pair_t
<
hb_codepoint_t
,
hb_codepoint_t
>
(
_
,
_
);
return
hb_pair_t
<
hb_codepoint_t
,
hb_codepoint_t
>
(
_
,
_
);
})
})
|
hb_sink
(
reverse_glyph_map
)
;
|
hb_sink
(
reverse_glyph_map
)
;
;
// TODO(grieger): Should we discard glyphs past the max glyph to keep?
// TODO(grieger): Should we discard glyphs past the max glyph to keep?
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录