Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
7470315a
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看板
提交
7470315a
编写于
8月 01, 2012
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move unicode accessors around
上级
21fdcee0
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
78 addition
and
60 deletion
+78
-60
src/hb-unicode-private.hh
src/hb-unicode-private.hh
+72
-1
src/hb-unicode.cc
src/hb-unicode.cc
+6
-59
未找到文件。
src/hb-unicode-private.hh
浏览文件 @
7470315a
...
...
@@ -70,7 +70,78 @@ struct hb_unicode_funcs_t {
bool
immutable
;
/* Don't access these directly. Call hb_unicode_*() instead. */
#define HB_UNICODE_FUNC_IMPLEMENT(return_type, name) \
inline return_type name (hb_codepoint_t unicode) { return func.name (this, unicode, user_data.name); }
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS_SIMPLE
#undef HB_UNICODE_FUNC_IMPLEMENT
inline
hb_bool_t
compose
(
hb_codepoint_t
a
,
hb_codepoint_t
b
,
hb_codepoint_t
*
ab
)
{
*
ab
=
0
;
/* XXX, this belongs to indic normalizer. */
if
((
FLAG
(
general_category
(
a
))
&
(
FLAG
(
HB_UNICODE_GENERAL_CATEGORY_SPACING_MARK
)
|
FLAG
(
HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK
)
|
FLAG
(
HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK
))))
return
false
;
/* XXX, add composition-exclusion exceptions to Indic shaper. */
if
(
a
==
0x09AF
&&
b
==
0x09BC
)
{
*
ab
=
0x09DF
;
return
true
;
}
return
func
.
compose
(
this
,
a
,
b
,
ab
,
user_data
.
compose
);
}
inline
hb_bool_t
decompose
(
hb_codepoint_t
ab
,
hb_codepoint_t
*
a
,
hb_codepoint_t
*
b
)
{
/* XXX FIXME, move these to complex shapers and propagage to normalizer.*/
switch
(
ab
)
{
case
0x0AC9
:
return
false
;
case
0x0931
:
return
false
;
case
0x0B94
:
return
false
;
/* These ones have Unicode decompositions, but we do it
* this way to be close to what Uniscribe does. */
case
0x0DDA
:
*
a
=
0x0DD9
;
*
b
=
0x0DDA
;
return
true
;
case
0x0DDC
:
*
a
=
0x0DD9
;
*
b
=
0x0DDC
;
return
true
;
case
0x0DDD
:
*
a
=
0x0DD9
;
*
b
=
0x0DDD
;
return
true
;
case
0x0DDE
:
*
a
=
0x0DD9
;
*
b
=
0x0DDE
;
return
true
;
case
0x0F77
:
*
a
=
0x0FB2
;
*
b
=
0x0F81
;
return
true
;
case
0x0F79
:
*
a
=
0x0FB3
;
*
b
=
0x0F81
;
return
true
;
case
0x17BE
:
*
a
=
0x17C1
;
*
b
=
0x17BE
;
return
true
;
case
0x17BF
:
*
a
=
0x17C1
;
*
b
=
0x17BF
;
return
true
;
case
0x17C0
:
*
a
=
0x17C1
;
*
b
=
0x17C0
;
return
true
;
case
0x17C4
:
*
a
=
0x17C1
;
*
b
=
0x17C4
;
return
true
;
case
0x17C5
:
*
a
=
0x17C1
;
*
b
=
0x17C5
;
return
true
;
case
0x1925
:
*
a
=
0x1920
;
*
b
=
0x1923
;
return
true
;
case
0x1926
:
*
a
=
0x1920
;
*
b
=
0x1924
;
return
true
;
case
0x1B3C
:
*
a
=
0x1B42
;
*
b
=
0x1B3C
;
return
true
;
case
0x1112E
:
*
a
=
0x11127
;
*
b
=
0x11131
;
return
true
;
case
0x1112F
:
*
a
=
0x11127
;
*
b
=
0x11132
;
return
true
;
#if 0
case 0x0B57 : *a = 0xno decomp, -> RIGHT; return true;
case 0x1C29 : *a = 0xno decomp, -> LEFT; return true;
case 0xA9C0 : *a = 0xno decomp, -> RIGHT; return true;
case 0x111BF : *a = 0xno decomp, -> ABOVE; return true;
#endif
}
*
a
=
ab
;
*
b
=
0
;
return
func
.
decompose
(
this
,
ab
,
a
,
b
,
user_data
.
decompose
);
}
inline
unsigned
int
decompose_compatibility
(
hb_codepoint_t
u
,
hb_codepoint_t
*
decomposed
)
{
unsigned
int
ret
=
func
.
decompose_compatibility
(
this
,
u
,
decomposed
,
user_data
.
decompose_compatibility
);
if
(
ret
==
1
&&
u
==
decomposed
[
0
])
{
decomposed
[
0
]
=
0
;
return
0
;
}
decomposed
[
ret
]
=
0
;
return
ret
;
}
struct
{
#define HB_UNICODE_FUNC_IMPLEMENT(name) hb_unicode_##name##_func_t name;
...
...
src/hb-unicode.cc
浏览文件 @
7470315a
...
...
@@ -245,7 +245,7 @@ hb_unicode_funcs_set_##name##_func (hb_unicode_funcs_t *ufuncs, \
} \
}
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
#undef HB_UNICODE_FUNC_IMPLEMENT
...
...
@@ -255,9 +255,9 @@ return_type \
hb_unicode_##name (hb_unicode_funcs_t *ufuncs, \
hb_codepoint_t unicode) \
{ \
return ufuncs->
func.name (ufuncs, unicode, ufuncs->user_data.name);
\
return ufuncs->
name (unicode);
\
}
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS_SIMPLE
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS_SIMPLE
#undef HB_UNICODE_FUNC_IMPLEMENT
hb_bool_t
...
...
@@ -266,16 +266,7 @@ hb_unicode_compose (hb_unicode_funcs_t *ufuncs,
hb_codepoint_t
b
,
hb_codepoint_t
*
ab
)
{
*
ab
=
0
;
/* XXX, this belongs to indic normalizer. */
if
((
FLAG
(
hb_unicode_general_category
(
ufuncs
,
a
))
&
(
FLAG
(
HB_UNICODE_GENERAL_CATEGORY_SPACING_MARK
)
|
FLAG
(
HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK
)
|
FLAG
(
HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK
))))
return
false
;
/* XXX, add composition-exclusion exceptions to Indic shaper. */
if
(
a
==
0x09AF
&&
b
==
0x09BC
)
{
*
ab
=
0x09DF
;
return
true
;
}
return
ufuncs
->
func
.
compose
(
ufuncs
,
a
,
b
,
ab
,
ufuncs
->
user_data
.
compose
);
return
ufuncs
->
compose
(
a
,
b
,
ab
);
}
hb_bool_t
...
...
@@ -284,41 +275,7 @@ hb_unicode_decompose (hb_unicode_funcs_t *ufuncs,
hb_codepoint_t
*
a
,
hb_codepoint_t
*
b
)
{
/* XXX FIXME, move these to complex shapers and propagage to normalizer.*/
switch
(
ab
)
{
case
0x0AC9
:
return
false
;
case
0x0931
:
return
false
;
case
0x0B94
:
return
false
;
/* These ones have Unicode decompositions, but we do it
* this way to be close to what Uniscribe does. */
case
0x0DDA
:
*
a
=
0x0DD9
;
*
b
=
0x0DDA
;
return
true
;
case
0x0DDC
:
*
a
=
0x0DD9
;
*
b
=
0x0DDC
;
return
true
;
case
0x0DDD
:
*
a
=
0x0DD9
;
*
b
=
0x0DDD
;
return
true
;
case
0x0DDE
:
*
a
=
0x0DD9
;
*
b
=
0x0DDE
;
return
true
;
case
0x0F77
:
*
a
=
0x0FB2
;
*
b
=
0x0F81
;
return
true
;
case
0x0F79
:
*
a
=
0x0FB3
;
*
b
=
0x0F81
;
return
true
;
case
0x17BE
:
*
a
=
0x17C1
;
*
b
=
0x17BE
;
return
true
;
case
0x17BF
:
*
a
=
0x17C1
;
*
b
=
0x17BF
;
return
true
;
case
0x17C0
:
*
a
=
0x17C1
;
*
b
=
0x17C0
;
return
true
;
case
0x17C4
:
*
a
=
0x17C1
;
*
b
=
0x17C4
;
return
true
;
case
0x17C5
:
*
a
=
0x17C1
;
*
b
=
0x17C5
;
return
true
;
case
0x1925
:
*
a
=
0x1920
;
*
b
=
0x1923
;
return
true
;
case
0x1926
:
*
a
=
0x1920
;
*
b
=
0x1924
;
return
true
;
case
0x1B3C
:
*
a
=
0x1B42
;
*
b
=
0x1B3C
;
return
true
;
case
0x1112E
:
*
a
=
0x11127
;
*
b
=
0x11131
;
return
true
;
case
0x1112F
:
*
a
=
0x11127
;
*
b
=
0x11132
;
return
true
;
#if 0
case 0x0B57 : *a = 0xno decomp, -> RIGHT; return true;
case 0x1C29 : *a = 0xno decomp, -> LEFT; return true;
case 0xA9C0 : *a = 0xno decomp, -> RIGHT; return true;
case 0x111BF : *a = 0xno decomp, -> ABOVE; return true;
#endif
}
*
a
=
ab
;
*
b
=
0
;
return
ufuncs
->
func
.
decompose
(
ufuncs
,
ab
,
a
,
b
,
ufuncs
->
user_data
.
decompose
);
return
ufuncs
->
decompose
(
ab
,
a
,
b
);
}
unsigned
int
...
...
@@ -326,17 +283,7 @@ hb_unicode_decompose_compatibility (hb_unicode_funcs_t *ufuncs,
hb_codepoint_t
u
,
hb_codepoint_t
*
decomposed
)
{
unsigned
int
ret
=
ufuncs
->
func
.
decompose_compatibility
(
ufuncs
,
u
,
decomposed
,
ufuncs
->
user_data
.
decompose_compatibility
);
if
(
ret
==
1
&&
u
==
decomposed
[
0
])
{
decomposed
[
0
]
=
0
;
return
0
;
}
decomposed
[
ret
]
=
0
;
return
ret
;
return
ufuncs
->
decompose_compatibility
(
u
,
decomposed
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录