Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
c48ff288
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看板
提交
c48ff288
编写于
7月 20, 2015
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[USE] Build Universal Shaping Engine data table from Unicode 8 files
上级
e2c95116
变更
2
展开全部
隐藏空白更改
内联
并排
Showing
2 changed file
with
1032 addition
and
19 deletion
+1032
-19
src/gen-use-table.py
src/gen-use-table.py
+16
-19
src/hb-ot-shape-complex-use-table.cc
src/hb-ot-shape-complex-use-table.cc
+1016
-0
未找到文件。
src/gen-use-table.py
浏览文件 @
c48ff288
...
...
@@ -3,7 +3,7 @@
import
sys
if
len
(
sys
.
argv
)
!=
4
:
print
>>
sys
.
stderr
,
"usage: ./gen-
indic-table.py IndicSyllabicCategory.txt IndicMatra
Category.txt Blocks.txt"
print
>>
sys
.
stderr
,
"usage: ./gen-
use-table.py IndicSyllabicCategory.txt IndicPositional
Category.txt Blocks.txt"
sys
.
exit
(
1
)
BLACKLISTED_BLOCKS
=
[
"Thai"
,
"Lao"
,
"Tibetan"
]
...
...
@@ -55,13 +55,9 @@ data = combined
del
combined
num
=
len
(
data
)
for
u
in
[
0x17CD
,
0x17CE
,
0x17CF
,
0x17D0
,
0x17D3
]:
if
data
[
u
][
0
]
==
'Other'
:
data
[
u
][
0
]
=
"Vowel_Dependent"
# Move the outliers NO-BREAK SPACE and DOTTED CIRCLE out
# Remove the outliers
singles
=
{}
for
u
in
[
0x00A0
,
0x25CC
]:
for
u
in
[
]:
# TODO [0x00A0, 0x200C, 0x200D, 0x25CC, 0x1107F
]:
singles
[
u
]
=
data
[
u
]
del
data
[
u
]
...
...
@@ -69,7 +65,7 @@ print "/* == Start of generated table == */"
print
"/*"
print
" * The following table is generated by running:"
print
" *"
print
" * ./gen-
indic-table.py IndicSyllabicCategory.txt IndicMatra
Category.txt Blocks.txt"
print
" * ./gen-
use-table.py IndicSyllabicCategory.txt IndicPositional
Category.txt Blocks.txt"
print
" *"
print
" * on files with these headers:"
print
" *"
...
...
@@ -78,7 +74,7 @@ for h in headers:
print
" * %s"
%
(
l
.
strip
())
print
" */"
print
print
'#include "hb-ot-shape-complex-
indic
-private.hh"'
print
'#include "hb-ot-shape-complex-
use
-private.hh"'
print
# Shorten values
...
...
@@ -92,6 +88,7 @@ short = [{
"Vowel"
:
'Vo'
,
"Vowel_Dependent"
:
'M'
,
"Other"
:
'x'
,
"Consonant_Placeholder"
:
'GB'
,
},{
"Not_Applicable"
:
'x'
,
}]
...
...
@@ -104,8 +101,8 @@ for i in range (2):
for
v
,
s
in
short
[
i
].
items
():
all_shorts
[
i
][
s
]
=
v
what
=
[
"INDIC_SYLLABIC_CATEGORY"
,
"INDIC_
MATRA
_CATEGORY"
]
what_short
=
[
"
ISC"
,
"IM
C"
]
what
=
[
"INDIC_SYLLABIC_CATEGORY"
,
"INDIC_
POSITIONAL
_CATEGORY"
]
what_short
=
[
"
SC"
,
"P
C"
]
for
i
in
range
(
2
):
print
vv
=
values
[
i
].
keys
()
...
...
@@ -122,10 +119,10 @@ for i in range (2):
short
[
i
][
v
]
=
s
print
"#define %s_%s %s_%s %s/* %3d chars; %s */"
%
\
(
what_short
[
i
],
s
,
what
[
i
],
v
.
upper
(),
\
' '
*
((
48
-
1
-
len
(
what
[
i
])
-
1
-
len
(
v
))
/
8
),
\
' '
*
((
56
-
1
-
len
(
what
[
i
])
-
1
-
len
(
v
))
/
8
),
\
values
[
i
][
v
],
v
)
print
print
"#define _(S,M)
INDIC_COMBINE_CATEGORIES (ISC_##S, IM
C_##M)"
print
"#define _(S,M)
USE_COMBINE_CATEGORIES (SC_##S, P
C_##M)"
print
print
...
...
@@ -163,7 +160,7 @@ num = 0
offset
=
0
starts
=
[]
ends
=
[]
print
"static const
INDIC_TABLE_ELEMENT_TYPE indic
_table[] = {"
print
"static const
USE_TABLE_ELEMENT_TYPE use
_table[] = {"
for
u
in
uu
:
if
u
<=
last
:
continue
...
...
@@ -185,7 +182,7 @@ for u in uu:
offset
+=
ends
[
-
1
]
-
starts
[
-
1
]
print
print
print
"#define
indic
_offset_0x%04xu %d"
%
(
start
,
offset
)
print
"#define
use
_offset_0x%04xu %d"
%
(
start
,
offset
)
starts
.
append
(
start
)
print_block
(
block
,
start
,
end
,
data
)
...
...
@@ -198,8 +195,8 @@ occupancy = used * 100. / total
page_bits
=
12
print
"}; /* Table items: %d; occupancy: %d%% */"
%
(
offset
,
occupancy
)
print
print
"
INDIC
_TABLE_ELEMENT_TYPE"
print
"hb_
indic
_get_categories (hb_codepoint_t u)"
print
"
USE
_TABLE_ELEMENT_TYPE"
print
"hb_
use
_get_categories (hb_codepoint_t u)"
print
"{"
print
" switch (u >> %d)"
%
page_bits
print
" {"
...
...
@@ -208,8 +205,8 @@ for p in sorted(pages):
print
" case 0x%0Xu:"
%
p
for
(
start
,
end
)
in
zip
(
starts
,
ends
):
if
p
not
in
[
start
>>
page_bits
,
end
>>
page_bits
]:
continue
offset
=
"
indic
_offset_0x%04xu"
%
start
print
" if (hb_in_range (u, 0x%04Xu, 0x%04Xu)) return
indic
_table[u - 0x%04Xu + %s];"
%
(
start
,
end
-
1
,
start
,
offset
)
offset
=
"
use
_offset_0x%04xu"
%
start
print
" if (hb_in_range (u, 0x%04Xu, 0x%04Xu)) return
use
_table[u - 0x%04Xu + %s];"
%
(
start
,
end
-
1
,
start
,
offset
)
for
u
,
d
in
singles
.
items
():
if
p
!=
u
>>
page_bits
:
continue
print
" if (unlikely (u == 0x%04Xu)) return _(%s,%s);"
%
(
u
,
short
[
0
][
d
[
0
]],
short
[
1
][
d
[
1
]])
...
...
src/hb-ot-shape-complex-use-table.cc
浏览文件 @
c48ff288
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录