Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
1cdd0fa6
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看板
提交
1cdd0fa6
编写于
6月 26, 2019
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[emoji] Port generator to packtab
上级
5130c90a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
60 addition
and
89 deletion
+60
-89
src/gen-emoji-table.py
src/gen-emoji-table.py
+12
-6
src/hb-unicode-emoji-table.hh
src/hb-unicode-emoji-table.hh
+47
-79
src/hb-unicode.cc
src/hb-unicode.cc
+1
-4
未找到文件。
src/gen-emoji-table.py
浏览文件 @
1cdd0fa6
...
...
@@ -4,6 +4,7 @@ from __future__ import print_function, division, absolute_import
import
sys
import
os.path
from
collections
import
OrderedDict
import
packTab
if
len
(
sys
.
argv
)
!=
2
:
print
(
"usage: ./gen-emoji-table.py emoji-data.txt"
,
file
=
sys
.
stderr
)
...
...
@@ -54,12 +55,17 @@ print ()
for
typ
,
s
in
ranges
.
items
():
if
typ
!=
"Extended_Pictographic"
:
continue
print
()
print
(
"static const struct hb_unicode_range_t _hb_unicode_emoji_%s_table[] ="
%
typ
)
print
(
"{"
)
for
pair
in
sorted
(
s
):
print
(
" {0x%04X, 0x%04X},"
%
pair
)
print
(
"};"
)
arr
=
dict
()
for
start
,
end
in
s
:
for
i
in
range
(
start
,
end
):
arr
[
i
]
=
1
sol
=
packTab
.
pack_table
(
arr
,
0
,
compression
=
3
)
code
=
packTab
.
Code
(
'_hb_emoji'
)
sol
.
genCode
(
code
,
'is_'
+
typ
)
code
.
print_c
(
linkage
=
'static inline'
)
print
()
print
()
print
(
"#endif /* HB_UNICODE_EMOJI_TABLE_HH */"
)
...
...
src/hb-unicode-emoji-table.hh
浏览文件 @
1cdd0fa6
...
...
@@ -23,88 +23,56 @@
#include "hb-unicode.hh"
static
const
struct
hb_unicode_range_t
_hb_unicode_emoji_Extended_Pictographic_table
[
]
=
static
const
uint8_t
_hb_emoji_u8
[
448
]
=
{
{
0x00A9
,
0x00A9
},
{
0x00AE
,
0x00AE
},
{
0x203C
,
0x203C
},
{
0x2049
,
0x2049
},
{
0x2122
,
0x2122
},
{
0x2139
,
0x2139
},
{
0x2194
,
0x2199
},
{
0x21A9
,
0x21AA
},
{
0x231A
,
0x231B
},
{
0x2328
,
0x2328
},
{
0x2388
,
0x2388
},
{
0x23CF
,
0x23CF
},
{
0x23E9
,
0x23F3
},
{
0x23F8
,
0x23FA
},
{
0x24C2
,
0x24C2
},
{
0x25AA
,
0x25AB
},
{
0x25B6
,
0x25B6
},
{
0x25C0
,
0x25C0
},
{
0x25FB
,
0x25FE
},
{
0x2600
,
0x2605
},
{
0x2607
,
0x2612
},
{
0x2614
,
0x2685
},
{
0x2690
,
0x2705
},
{
0x2708
,
0x2712
},
{
0x2714
,
0x2714
},
{
0x2716
,
0x2716
},
{
0x271D
,
0x271D
},
{
0x2721
,
0x2721
},
{
0x2728
,
0x2728
},
{
0x2733
,
0x2734
},
{
0x2744
,
0x2744
},
{
0x2747
,
0x2747
},
{
0x274C
,
0x274C
},
{
0x274E
,
0x274E
},
{
0x2753
,
0x2755
},
{
0x2757
,
0x2757
},
{
0x2763
,
0x2767
},
{
0x2795
,
0x2797
},
{
0x27A1
,
0x27A1
},
{
0x27B0
,
0x27B0
},
{
0x27BF
,
0x27BF
},
{
0x2934
,
0x2935
},
{
0x2B05
,
0x2B07
},
{
0x2B1B
,
0x2B1C
},
{
0x2B50
,
0x2B50
},
{
0x2B55
,
0x2B55
},
{
0x3030
,
0x3030
},
{
0x303D
,
0x303D
},
{
0x3297
,
0x3297
},
{
0x3299
,
0x3299
},
{
0x1F000
,
0x1F0FF
},
{
0x1F10D
,
0x1F10F
},
{
0x1F12F
,
0x1F12F
},
{
0x1F16C
,
0x1F171
},
{
0x1F17E
,
0x1F17F
},
{
0x1F18E
,
0x1F18E
},
{
0x1F191
,
0x1F19A
},
{
0x1F1AD
,
0x1F1E5
},
{
0x1F201
,
0x1F20F
},
{
0x1F21A
,
0x1F21A
},
{
0x1F22F
,
0x1F22F
},
{
0x1F232
,
0x1F23A
},
{
0x1F23C
,
0x1F23F
},
{
0x1F249
,
0x1F3FA
},
{
0x1F400
,
0x1F53D
},
{
0x1F546
,
0x1F64F
},
{
0x1F680
,
0x1F6FF
},
{
0x1F774
,
0x1F77F
},
{
0x1F7D5
,
0x1F7FF
},
{
0x1F80C
,
0x1F80F
},
{
0x1F848
,
0x1F84F
},
{
0x1F85A
,
0x1F85F
},
{
0x1F888
,
0x1F88F
},
{
0x1F8AE
,
0x1F8FF
},
{
0x1F90C
,
0x1F93A
},
{
0x1F93C
,
0x1F945
},
{
0x1F947
,
0x1FFFD
},
0
,
0
,
0
,
0
,
33
,
3
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
84
,
118
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
1
,
0
,
0
,
0
,
0
,
0
,
2
,
0
,
0
,
3
,
0
,
0
,
0
,
0
,
0
,
0
,
4
,
5
,
6
,
7
,
8
,
7
,
9
,
10
,
11
,
0
,
0
,
0
,
0
,
0
,
12
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
13
,
0
,
0
,
0
,
7
,
7
,
7
,
14
,
15
,
16
,
17
,
18
,
19
,
20
,
7
,
7
,
7
,
7
,
7
,
21
,
7
,
7
,
7
,
7
,
22
,
23
,
7
,
7
,
7
,
24
,
7
,
14
,
0
,
25
,
0
,
26
,
27
,
28
,
29
,
14
,
30
,
31
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
7
,
22
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
240
,
1
,
0
,
2
,
0
,
0
,
0
,
0
,
0
,
4
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
254
,
7
,
3
,
0
,
0
,
0
,
0
,
0
,
4
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
56
,
159
,
255
,
243
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
31
,
0
,
255
,
255
,
255
,
255
,
255
,
255
,
31
,
255
,
3
,
0
,
0
,
0
,
8
,
0
,
0
,
0
,
24
,
0
,
120
,
0
,
0
,
0
,
0
,
0
,
96
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
16
,
0
,
96
,
0
,
0
,
8
,
0
,
0
,
0
,
0
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
127
,
0
,
96
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
240
,
1
,
64
,
0
,
0
,
254
,
3
,
0
,
224
,
255
,
255
,
255
,
255
,
255
,
255
,
31
,
0
,
0
,
0
,
254
,
127
,
0
,
0
,
0
,
0
,
252
,
115
,
0
,
254
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
3
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
31
,
192
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
127
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
240
,
127
,
0
,
0
,
224
,
255
,
255
,
255
,
255
,
127
,
0
,
112
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
127
,
0
,
124
,
0
,
0
,
0
,
0
,
0
,
127
,
0
,
0
,
0
,
192
,
255
,
255
,
0
,
240
,
255
,
255
,
255
,
255
,
255
,
243
,
159
,
255
,
255
,
255
,
255
,
255
,
255
,
255
,
};
static
inline
unsigned
_hb_emoji_b4
(
const
uint8_t
*
a
,
unsigned
i
)
{
return
(
a
[
i
>>
1
]
>>
((
i
&
1u
)
<<
2
))
&
15u
;
}
static
inline
unsigned
_hb_emoji_b1
(
const
uint8_t
*
a
,
unsigned
i
)
{
return
(
a
[
i
>>
3
]
>>
((
i
&
7u
)
<<
0
))
&
1u
;
}
static
inline
uint_fast8_t
_hb_emoji_is_Extended_Pictographic
(
unsigned
u
)
{
return
u
<
131069u
?
_hb_emoji_b1
(
192
+
_hb_emoji_u8
,((
_hb_emoji_u8
[
64
+
(((
_hb_emoji_b4
(
_hb_emoji_u8
,
u
>>
6
>>
4
))
<<
4
)
+
((
u
>>
6
)
&
15u
))])
<<
6
)
+
((
u
)
&
63u
))
:
0
;
}
#endif
/* HB_UNICODE_EMOJI_TABLE_HH */
/* == End of generated table == */
src/hb-unicode.cc
浏览文件 @
1cdd0fa6
...
...
@@ -577,9 +577,6 @@ _hb_modified_combining_class[256] =
bool
_hb_unicode_is_emoji_Extended_Pictographic
(
hb_codepoint_t
cp
)
{
return
hb_bsearch
(
&
cp
,
_hb_unicode_emoji_Extended_Pictographic_table
,
ARRAY_LENGTH
(
_hb_unicode_emoji_Extended_Pictographic_table
),
sizeof
(
hb_unicode_range_t
),
hb_unicode_range_t
::
cmp
);
return
_hb_emoji_is_Extended_Pictographic
(
cp
);
}
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录