Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
4d559cdd
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看板
提交
4d559cdd
编写于
4月 21, 2011
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[icu] Remove big script switch(), rely on reverse-lookup
上级
d18431b4
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
9 addition
and
128 deletion
+9
-128
src/hb-icu.cc
src/hb-icu.cc
+9
-128
未找到文件。
src/hb-icu.cc
浏览文件 @
4d559cdd
...
...
@@ -40,140 +40,21 @@ HB_BEGIN_DECLS
hb_script_t
hb_icu_script_to_script
(
UScriptCode
script
)
{
if
(
unlikely
(
script
==
USCRIPT_INVALID_CODE
))
return
HB_SCRIPT_INVALID
;
return
hb_script_from_string
(
uscript_getShortName
(
script
));
}
UScriptCode
hb_icu_script_from_script
(
hb_script_t
script
)
{
switch
((
int
)
script
)
{
#define CHECK_ICU_VERSION(major, minor) \
U_ICU_VERSION_MAJOR_NUM > (major) || (U_ICU_VERSION_MAJOR_NUM == (major) && U_ICU_VERSION_MINOR_NUM >= (minor))
#define MATCH_SCRIPT(C) case HB_SCRIPT_##C: return USCRIPT_##C
#define MATCH_SCRIPT2(C1, C2) case HB_SCRIPT_##C2: return USCRIPT_##C1
MATCH_SCRIPT2
(
INVALID_CODE
,
INVALID
);
MATCH_SCRIPT
(
COMMON
);
MATCH_SCRIPT
(
INHERITED
);
MATCH_SCRIPT
(
ARABIC
);
MATCH_SCRIPT
(
ARMENIAN
);
MATCH_SCRIPT
(
BENGALI
);
MATCH_SCRIPT
(
BOPOMOFO
);
MATCH_SCRIPT
(
CHEROKEE
);
MATCH_SCRIPT
(
COPTIC
);
MATCH_SCRIPT
(
CYRILLIC
);
MATCH_SCRIPT
(
DESERET
);
MATCH_SCRIPT
(
DEVANAGARI
);
MATCH_SCRIPT
(
ETHIOPIC
);
MATCH_SCRIPT
(
GEORGIAN
);
MATCH_SCRIPT
(
GOTHIC
);
MATCH_SCRIPT
(
GREEK
);
MATCH_SCRIPT
(
GUJARATI
);
MATCH_SCRIPT
(
GURMUKHI
);
MATCH_SCRIPT
(
HAN
);
MATCH_SCRIPT
(
HANGUL
);
MATCH_SCRIPT
(
HEBREW
);
MATCH_SCRIPT
(
HIRAGANA
);
MATCH_SCRIPT
(
KANNADA
);
MATCH_SCRIPT
(
KATAKANA
);
MATCH_SCRIPT
(
KHMER
);
MATCH_SCRIPT
(
LAO
);
MATCH_SCRIPT
(
LATIN
);
MATCH_SCRIPT
(
MALAYALAM
);
MATCH_SCRIPT
(
MONGOLIAN
);
MATCH_SCRIPT
(
MYANMAR
);
MATCH_SCRIPT
(
OGHAM
);
MATCH_SCRIPT
(
OLD_ITALIC
);
MATCH_SCRIPT
(
ORIYA
);
MATCH_SCRIPT
(
RUNIC
);
MATCH_SCRIPT
(
SINHALA
);
MATCH_SCRIPT
(
SYRIAC
);
MATCH_SCRIPT
(
TAMIL
);
MATCH_SCRIPT
(
TELUGU
);
MATCH_SCRIPT
(
THAANA
);
MATCH_SCRIPT
(
THAI
);
MATCH_SCRIPT
(
TIBETAN
);
MATCH_SCRIPT
(
CANADIAN_ABORIGINAL
);
MATCH_SCRIPT
(
YI
);
MATCH_SCRIPT
(
TAGALOG
);
MATCH_SCRIPT
(
HANUNOO
);
MATCH_SCRIPT
(
BUHID
);
MATCH_SCRIPT
(
TAGBANWA
);
/* Unicode-4.0 additions */
MATCH_SCRIPT
(
BRAILLE
);
MATCH_SCRIPT
(
CYPRIOT
);
MATCH_SCRIPT
(
LIMBU
);
MATCH_SCRIPT
(
OSMANYA
);
MATCH_SCRIPT
(
SHAVIAN
);
MATCH_SCRIPT
(
LINEAR_B
);
MATCH_SCRIPT
(
TAI_LE
);
MATCH_SCRIPT
(
UGARITIC
);
/* Unicode-4.1 additions */
MATCH_SCRIPT
(
NEW_TAI_LUE
);
MATCH_SCRIPT
(
BUGINESE
);
MATCH_SCRIPT
(
GLAGOLITIC
);
MATCH_SCRIPT
(
TIFINAGH
);
MATCH_SCRIPT
(
SYLOTI_NAGRI
);
MATCH_SCRIPT
(
OLD_PERSIAN
);
MATCH_SCRIPT
(
KHAROSHTHI
);
/* Unicode-5.0 additions */
MATCH_SCRIPT
(
UNKNOWN
);
MATCH_SCRIPT
(
BALINESE
);
MATCH_SCRIPT
(
CUNEIFORM
);
MATCH_SCRIPT
(
PHOENICIAN
);
MATCH_SCRIPT
(
PHAGS_PA
);
MATCH_SCRIPT
(
NKO
);
/* Unicode-5.1 additions */
MATCH_SCRIPT
(
KAYAH_LI
);
MATCH_SCRIPT
(
LEPCHA
);
MATCH_SCRIPT
(
REJANG
);
MATCH_SCRIPT
(
SUNDANESE
);
MATCH_SCRIPT
(
SAURASHTRA
);
MATCH_SCRIPT
(
CHAM
);
MATCH_SCRIPT
(
OL_CHIKI
);
MATCH_SCRIPT
(
VAI
);
MATCH_SCRIPT
(
CARIAN
);
MATCH_SCRIPT
(
LYCIAN
);
MATCH_SCRIPT
(
LYDIAN
);
/* Unicode-5.2 additions */
MATCH_SCRIPT
(
AVESTAN
);
#if CHECK_ICU_VERSION (4, 4)
MATCH_SCRIPT
(
BAMUM
);
#endif
MATCH_SCRIPT
(
EGYPTIAN_HIEROGLYPHS
);
MATCH_SCRIPT
(
IMPERIAL_ARAMAIC
);
MATCH_SCRIPT
(
INSCRIPTIONAL_PAHLAVI
);
MATCH_SCRIPT
(
INSCRIPTIONAL_PARTHIAN
);
MATCH_SCRIPT
(
JAVANESE
);
MATCH_SCRIPT
(
KAITHI
);
MATCH_SCRIPT2
(
LANNA
,
TAI_THAM
);
#if CHECK_ICU_VERSION (4, 4)
MATCH_SCRIPT
(
LISU
);
#endif
MATCH_SCRIPT2
(
MEITEI_MAYEK
,
MEETEI_MAYEK
);
#if CHECK_ICU_VERSION (4, 4)
MATCH_SCRIPT
(
OLD_SOUTH_ARABIAN
);
#endif
MATCH_SCRIPT2
(
ORKHON
,
OLD_TURKIC
);
MATCH_SCRIPT
(
SAMARITAN
);
MATCH_SCRIPT
(
TAI_VIET
);
/* Unicode-6.0 additions */
MATCH_SCRIPT
(
BATAK
);
MATCH_SCRIPT
(
BRAHMI
);
MATCH_SCRIPT2
(
MANDAEAN
,
MANDAIC
);
#undef CHECK_ICU_VERSION
#undef MATCH_SCRIPT
#undef MATCH_SCRIPT2
}
if
(
unlikely
(
script
==
HB_SCRIPT_INVALID
))
return
USCRIPT_INVALID_CODE
;
for
(
unsigned
int
i
=
0
;
i
<
USCRIPT_CODE_LIMIT
;
i
++
)
if
(
unlikely
(
hb_icu_script_to_script
((
UScriptCode
)
i
)
==
script
))
return
(
UScriptCode
)
i
;
return
USCRIPT_UNKNOWN
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录