Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
891c4755
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
接近 2 年 前同步成功
通知
1
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看板
提交
891c4755
编写于
7月 07, 2011
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Humm, undo some shuffling
In preparation for adding more advanced unicode funcs.
上级
4b6317c4
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
70 addition
and
39 deletion
+70
-39
src/hb-ot-shape.cc
src/hb-ot-shape.cc
+3
-3
src/hb-shape.cc
src/hb-shape.cc
+1
-1
src/hb-unicode-private.hh
src/hb-unicode-private.hh
+18
-18
src/hb-unicode.cc
src/hb-unicode.cc
+48
-17
未找到文件。
src/hb-ot-shape.cc
浏览文件 @
891c4755
...
@@ -197,8 +197,8 @@ hb_set_unicode_props (hb_ot_shape_context_t *c)
...
@@ -197,8 +197,8 @@ hb_set_unicode_props (hb_ot_shape_context_t *c)
unsigned
int
count
=
c
->
buffer
->
len
;
unsigned
int
count
=
c
->
buffer
->
len
;
for
(
unsigned
int
i
=
1
;
i
<
count
;
i
++
)
{
for
(
unsigned
int
i
=
1
;
i
<
count
;
i
++
)
{
info
[
i
].
general_category
()
=
unicode
->
get_general_category
(
info
[
i
].
codepoint
);
info
[
i
].
general_category
()
=
hb_unicode_get_general_category
(
unicode
,
info
[
i
].
codepoint
);
info
[
i
].
combining_class
()
=
unicode
->
get_combining_class
(
info
[
i
].
codepoint
);
info
[
i
].
combining_class
()
=
hb_unicode_get_combining_class
(
unicode
,
info
[
i
].
codepoint
);
}
}
}
}
...
@@ -252,7 +252,7 @@ hb_mirror_chars (hb_ot_shape_context_t *c)
...
@@ -252,7 +252,7 @@ hb_mirror_chars (hb_ot_shape_context_t *c)
unsigned
int
count
=
c
->
buffer
->
len
;
unsigned
int
count
=
c
->
buffer
->
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
{
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
{
hb_codepoint_t
codepoint
=
unicode
->
get_mirroring
(
c
->
buffer
->
info
[
i
].
codepoint
);
hb_codepoint_t
codepoint
=
hb_unicode_get_mirroring
(
unicode
,
c
->
buffer
->
info
[
i
].
codepoint
);
if
(
likely
(
codepoint
==
c
->
buffer
->
info
[
i
].
codepoint
))
if
(
likely
(
codepoint
==
c
->
buffer
->
info
[
i
].
codepoint
))
c
->
buffer
->
info
[
i
].
mask
|=
rtlm_mask
;
/* XXX this should be moved to before setting user-feature masks */
c
->
buffer
->
info
[
i
].
mask
|=
rtlm_mask
;
/* XXX this should be moved to before setting user-feature masks */
else
else
...
...
src/hb-shape.cc
浏览文件 @
891c4755
...
@@ -63,7 +63,7 @@ hb_shape (hb_font_t *font,
...
@@ -63,7 +63,7 @@ hb_shape (hb_font_t *font,
hb_unicode_funcs_t
*
unicode
=
buffer
->
unicode
;
hb_unicode_funcs_t
*
unicode
=
buffer
->
unicode
;
unsigned
int
count
=
buffer
->
len
;
unsigned
int
count
=
buffer
->
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
{
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
{
hb_script_t
script
=
unicode
->
get_script
(
buffer
->
info
[
i
].
codepoint
);
hb_script_t
script
=
hb_unicode_get_script
(
unicode
,
buffer
->
info
[
i
].
codepoint
);
if
(
likely
(
script
!=
HB_SCRIPT_COMMON
&&
if
(
likely
(
script
!=
HB_SCRIPT_COMMON
&&
script
!=
HB_SCRIPT_INHERITED
&&
script
!=
HB_SCRIPT_INHERITED
&&
script
!=
HB_SCRIPT_UNKNOWN
))
{
script
!=
HB_SCRIPT_UNKNOWN
))
{
...
...
src/hb-unicode-private.hh
浏览文件 @
891c4755
...
@@ -44,13 +44,22 @@ HB_BEGIN_DECLS
...
@@ -44,13 +44,22 @@ HB_BEGIN_DECLS
*/
*/
#define HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS \
#define HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS \
HB_UNICODE_FUNC_IMPLEMENT (
unsigned int, combining_class, 0
) \
HB_UNICODE_FUNC_IMPLEMENT (
combining_class
) \
HB_UNICODE_FUNC_IMPLEMENT (
unsigned int, eastasian_width, 1
) \
HB_UNICODE_FUNC_IMPLEMENT (
eastasian_width
) \
HB_UNICODE_FUNC_IMPLEMENT (
hb_unicode_general_category_t, general_category, HB_UNICODE_GENERAL_CATEGORY_OTHER_LETTER
) \
HB_UNICODE_FUNC_IMPLEMENT (
general_category
) \
HB_UNICODE_FUNC_IMPLEMENT (
hb_codepoint_t, mirroring, unicode
) \
HB_UNICODE_FUNC_IMPLEMENT (
mirroring
) \
HB_UNICODE_FUNC_IMPLEMENT (
hb_script_t, script, HB_SCRIPT_UNKNOWN
) \
HB_UNICODE_FUNC_IMPLEMENT (
script
) \
/* ^--- Add new callbacks here */
/* ^--- Add new callbacks here */
/* Simple callbacks are those taking a hb_codepoint_t and returning a hb_codepoint_t */
#define HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS_SIMPLE \
HB_UNICODE_FUNC_IMPLEMENT (unsigned int, combining_class) \
HB_UNICODE_FUNC_IMPLEMENT (unsigned int, eastasian_width) \
HB_UNICODE_FUNC_IMPLEMENT (hb_unicode_general_category_t, general_category) \
HB_UNICODE_FUNC_IMPLEMENT (hb_codepoint_t, mirroring) \
HB_UNICODE_FUNC_IMPLEMENT (hb_script_t, script) \
/* ^--- Add new simple callbacks here */
struct
_hb_unicode_funcs_t
{
struct
_hb_unicode_funcs_t
{
hb_object_header_t
header
;
hb_object_header_t
header
;
...
@@ -58,31 +67,22 @@ struct _hb_unicode_funcs_t {
...
@@ -58,31 +67,22 @@ struct _hb_unicode_funcs_t {
bool
immutable
;
bool
immutable
;
#define HB_UNICODE_FUNC_IMPLEMENT(return_type, name, default_value) \
/* Don't access these directly. Call hb_unicode_get_*() instead. */
inline return_type \
get_##name (hb_codepoint_t unicode) \
{ return this->get.name (this, unicode, this->user_data.name); }
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
#undef HB_UNICODE_FUNC_IMPLEMENT
/* Don't access these directly. Call get_*() instead. */
struct
{
struct
{
#define HB_UNICODE_FUNC_IMPLEMENT(
return_type, name, default_valu
e) hb_unicode_get_##name##_func_t name;
#define HB_UNICODE_FUNC_IMPLEMENT(
nam
e) hb_unicode_get_##name##_func_t name;
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
#undef HB_UNICODE_FUNC_IMPLEMENT
#undef HB_UNICODE_FUNC_IMPLEMENT
}
get
;
}
get
;
struct
{
struct
{
#define HB_UNICODE_FUNC_IMPLEMENT(
return_type, name, default_valu
e) void *name;
#define HB_UNICODE_FUNC_IMPLEMENT(
nam
e) void *name;
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
#undef HB_UNICODE_FUNC_IMPLEMENT
#undef HB_UNICODE_FUNC_IMPLEMENT
}
user_data
;
}
user_data
;
struct
{
struct
{
#define HB_UNICODE_FUNC_IMPLEMENT(
return_type, name, default_valu
e) hb_destroy_func_t name;
#define HB_UNICODE_FUNC_IMPLEMENT(
nam
e) hb_destroy_func_t name;
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
#undef HB_UNICODE_FUNC_IMPLEMENT
#undef HB_UNICODE_FUNC_IMPLEMENT
}
destroy
;
}
destroy
;
...
...
src/hb-unicode.cc
浏览文件 @
891c4755
...
@@ -39,19 +39,45 @@ HB_BEGIN_DECLS
...
@@ -39,19 +39,45 @@ HB_BEGIN_DECLS
* hb_unicode_funcs_t
* hb_unicode_funcs_t
*/
*/
#define HB_UNICODE_FUNC_IMPLEMENT(return_type, name, default_value) \
static
unsigned
int
\
hb_unicode_get_combining_class_nil
(
hb_unicode_funcs_t
*
ufuncs
HB_UNUSED
,
\
hb_codepoint_t
unicode
HB_UNUSED
,
static return_type \
void
*
user_data
HB_UNUSED
)
hb_unicode_get_##name##_nil (hb_unicode_funcs_t *ufuncs HB_UNUSED, \
{
hb_codepoint_t unicode HB_UNUSED, \
return
0
;
void *user_data HB_UNUSED) \
{ \
return default_value; \
}
}
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
static
unsigned
int
#undef HB_UNICODE_FUNC_IMPLEMENT
hb_unicode_get_eastasian_width_nil
(
hb_unicode_funcs_t
*
ufuncs
HB_UNUSED
,
hb_codepoint_t
unicode
HB_UNUSED
,
void
*
user_data
HB_UNUSED
)
{
return
1
;
}
static
hb_unicode_general_category_t
hb_unicode_get_general_category_nil
(
hb_unicode_funcs_t
*
ufuncs
HB_UNUSED
,
hb_codepoint_t
unicode
HB_UNUSED
,
void
*
user_data
HB_UNUSED
)
{
return
HB_UNICODE_GENERAL_CATEGORY_OTHER_LETTER
;
}
static
hb_codepoint_t
hb_unicode_get_mirroring_nil
(
hb_unicode_funcs_t
*
ufuncs
HB_UNUSED
,
hb_codepoint_t
unicode
HB_UNUSED
,
void
*
user_data
HB_UNUSED
)
{
return
unicode
;
}
static
hb_script_t
hb_unicode_get_script_nil
(
hb_unicode_funcs_t
*
ufuncs
HB_UNUSED
,
hb_codepoint_t
unicode
HB_UNUSED
,
void
*
user_data
HB_UNUSED
)
{
return
HB_SCRIPT_UNKNOWN
;
}
hb_unicode_funcs_t
_hb_unicode_funcs_nil
=
{
hb_unicode_funcs_t
_hb_unicode_funcs_nil
=
{
...
@@ -60,7 +86,7 @@ hb_unicode_funcs_t _hb_unicode_funcs_nil = {
...
@@ -60,7 +86,7 @@ hb_unicode_funcs_t _hb_unicode_funcs_nil = {
NULL
,
/* parent */
NULL
,
/* parent */
TRUE
,
/* immutable */
TRUE
,
/* immutable */
{
{
#define HB_UNICODE_FUNC_IMPLEMENT(
return_type, name, default_valu
e) hb_unicode_get_##name##_nil,
#define HB_UNICODE_FUNC_IMPLEMENT(
nam
e) hb_unicode_get_##name##_nil,
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
#undef HB_UNICODE_FUNC_IMPLEMENT
#undef HB_UNICODE_FUNC_IMPLEMENT
}
}
...
@@ -114,7 +140,7 @@ hb_unicode_funcs_destroy (hb_unicode_funcs_t *ufuncs)
...
@@ -114,7 +140,7 @@ hb_unicode_funcs_destroy (hb_unicode_funcs_t *ufuncs)
{
{
if
(
!
hb_object_destroy
(
ufuncs
))
return
;
if
(
!
hb_object_destroy
(
ufuncs
))
return
;
#define HB_UNICODE_FUNC_IMPLEMENT(
return_type, name, default_valu
e) \
#define HB_UNICODE_FUNC_IMPLEMENT(
nam
e) \
if (ufuncs->destroy.name) ufuncs->destroy.name (ufuncs->user_data.name);
if (ufuncs->destroy.name) ufuncs->destroy.name (ufuncs->user_data.name);
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
#undef HB_UNICODE_FUNC_IMPLEMENT
#undef HB_UNICODE_FUNC_IMPLEMENT
...
@@ -163,7 +189,7 @@ hb_unicode_funcs_get_parent (hb_unicode_funcs_t *ufuncs)
...
@@ -163,7 +189,7 @@ hb_unicode_funcs_get_parent (hb_unicode_funcs_t *ufuncs)
}
}
#define HB_UNICODE_FUNC_IMPLEMENT(
return_type, name, default_value)
\
#define HB_UNICODE_FUNC_IMPLEMENT(
name)
\
\
\
void \
void \
hb_unicode_funcs_set_##name##_func (hb_unicode_funcs_t *ufuncs, \
hb_unicode_funcs_set_##name##_func (hb_unicode_funcs_t *ufuncs, \
...
@@ -186,7 +212,13 @@ hb_unicode_funcs_set_##name##_func (hb_unicode_funcs_t *ufuncs, \
...
@@ -186,7 +212,13 @@ hb_unicode_funcs_set_##name##_func (hb_unicode_funcs_t *ufuncs, \
ufuncs->user_data.name = ufuncs->parent->user_data.name; \
ufuncs->user_data.name = ufuncs->parent->user_data.name; \
ufuncs->destroy.name = NULL; \
ufuncs->destroy.name = NULL; \
} \
} \
} \
}
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
#undef HB_UNICODE_FUNC_IMPLEMENT
#define HB_UNICODE_FUNC_IMPLEMENT(return_type, name) \
\
\
return_type \
return_type \
hb_unicode_get_##name (hb_unicode_funcs_t *ufuncs, \
hb_unicode_get_##name (hb_unicode_funcs_t *ufuncs, \
...
@@ -194,8 +226,7 @@ hb_unicode_get_##name (hb_unicode_funcs_t *ufuncs, \
...
@@ -194,8 +226,7 @@ hb_unicode_get_##name (hb_unicode_funcs_t *ufuncs, \
{ \
{ \
return ufuncs->get.name (ufuncs, unicode, ufuncs->user_data.name); \
return ufuncs->get.name (ufuncs, unicode, ufuncs->user_data.name); \
}
}
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS_SIMPLE
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
#undef HB_UNICODE_FUNC_IMPLEMENT
#undef HB_UNICODE_FUNC_IMPLEMENT
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录