Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
208f70f0
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看板
提交
208f70f0
编写于
8月 01, 2012
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Inline Unicode callbacks internally
上级
7470315a
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
73 addition
and
75 deletion
+73
-75
src/hb-buffer.cc
src/hb-buffer.cc
+1
-1
src/hb-fallback-shape.cc
src/hb-fallback-shape.cc
+1
-1
src/hb-old.cc
src/hb-old.cc
+1
-1
src/hb-ot-shape-complex-misc.cc
src/hb-ot-shape-complex-misc.cc
+1
-1
src/hb-ot-shape-normalize.cc
src/hb-ot-shape-normalize.cc
+6
-7
src/hb-ot-shape-private.hh
src/hb-ot-shape-private.hh
+3
-3
src/hb-ot-shape.cc
src/hb-ot-shape.cc
+2
-2
src/hb-unicode-private.hh
src/hb-unicode-private.hh
+56
-56
src/hb-unicode.cc
src/hb-unicode.cc
+2
-3
未找到文件。
src/hb-buffer.cc
浏览文件 @
208f70f0
...
...
@@ -456,7 +456,7 @@ hb_buffer_t::guess_properties (void)
/* If script is set to INVALID, guess from buffer contents */
if
(
props
.
script
==
HB_SCRIPT_INVALID
)
{
for
(
unsigned
int
i
=
0
;
i
<
len
;
i
++
)
{
hb_script_t
script
=
hb_unicode_script
(
unicode
,
info
[
i
].
codepoint
);
hb_script_t
script
=
unicode
->
script
(
info
[
i
].
codepoint
);
if
(
likely
(
script
!=
HB_SCRIPT_COMMON
&&
script
!=
HB_SCRIPT_INHERITED
&&
script
!=
HB_SCRIPT_UNKNOWN
))
{
...
...
src/hb-fallback-shape.cc
浏览文件 @
208f70f0
...
...
@@ -106,7 +106,7 @@ _hb_fallback_shape (hb_shape_plan_t *shape_plan,
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
{
if
(
_hb_unicode_
is_zero_width
(
buffer
->
info
[
i
].
codepoint
))
{
if
(
buffer
->
unicode
->
is_zero_width
(
buffer
->
info
[
i
].
codepoint
))
{
buffer
->
info
[
i
].
codepoint
=
space
;
buffer
->
pos
[
i
].
x_advance
=
0
;
buffer
->
pos
[
i
].
y_advance
=
0
;
...
...
src/hb-old.cc
浏览文件 @
208f70f0
...
...
@@ -94,7 +94,7 @@ hb_old_convertStringToGlyphIndices (HB_Font old_font,
u
=
string
[
i
];
if
(
rightToLeft
)
u
=
hb_unicode_
mirroring
(
hb_unicode_funcs_get_default
(),
u
);
u
=
hb_unicode_
funcs_get_default
()
->
mirroring
(
u
);
hb_font_get_glyph
(
font
,
u
,
0
,
&
u
);
/* TODO Variation selectors */
...
...
src/hb-ot-shape-complex-misc.cc
浏览文件 @
208f70f0
...
...
@@ -124,7 +124,7 @@ setup_masks_thai (const hb_ot_complex_shaper_t *shaper,
*
* Uniscribe also does so below-marks reordering. Namely, it positions U+0E3A
* after U+0E38 and U+0E39. We do that by modifying the ccc for U+0E3A.
* See
_hb_unicode_
modified_combining_class (). Lao does NOT have a U+0E3A
* See
unicode->
modified_combining_class (). Lao does NOT have a U+0E3A
* equivalent.
*/
...
...
src/hb-ot-shape-normalize.cc
浏览文件 @
208f70f0
...
...
@@ -95,7 +95,7 @@ decompose (hb_font_t *font, hb_buffer_t *buffer,
{
hb_codepoint_t
a
,
b
,
glyph
;
if
(
!
hb_unicode_decompose
(
buffer
->
unicode
,
ab
,
&
a
,
&
b
)
||
if
(
!
buffer
->
unicode
->
decompose
(
ab
,
&
a
,
&
b
)
||
(
b
&&
!
hb_font_get_glyph
(
font
,
b
,
0
,
&
glyph
)))
return
false
;
...
...
@@ -131,7 +131,7 @@ decompose_compatibility (hb_font_t *font, hb_buffer_t *buffer,
unsigned
int
len
,
i
;
hb_codepoint_t
decomposed
[
HB_UNICODE_MAX_DECOMPOSITION_LEN
];
len
=
hb_unicode_decompose_compatibility
(
buffer
->
unicode
,
u
,
decomposed
);
len
=
buffer
->
unicode
->
decompose_compatibility
(
u
,
decomposed
);
if
(
!
len
)
return
false
;
...
...
@@ -171,7 +171,7 @@ decompose_multi_char_cluster (hb_font_t *font, hb_buffer_t *buffer,
{
/* TODO Currently if there's a variation-selector we give-up, it's just too hard. */
for
(
unsigned
int
i
=
buffer
->
idx
;
i
<
end
;
i
++
)
if
(
unlikely
(
_hb_unicode_
is_variation_selector
(
buffer
->
info
[
i
].
codepoint
)))
{
if
(
unlikely
(
buffer
->
unicode
->
is_variation_selector
(
buffer
->
info
[
i
].
codepoint
)))
{
while
(
buffer
->
idx
<
end
)
buffer
->
next_glyph
();
return
;
...
...
@@ -281,8 +281,7 @@ _hb_ot_shape_normalize (hb_font_t *font, hb_buffer_t *buffer,
(
starter
==
buffer
->
out_len
-
1
||
_hb_glyph_info_get_modified_combining_class
(
&
buffer
->
prev
())
<
_hb_glyph_info_get_modified_combining_class
(
&
buffer
->
cur
()))
&&
/* And compose. */
hb_unicode_compose
(
buffer
->
unicode
,
buffer
->
out_info
[
starter
].
codepoint
,
buffer
->
unicode
->
compose
(
buffer
->
out_info
[
starter
].
codepoint
,
buffer
->
cur
().
codepoint
,
&
composed
)
&&
/* And the font has glyph for the composite. */
...
...
src/hb-ot-shape-private.hh
浏览文件 @
208f70f0
...
...
@@ -43,9 +43,9 @@ struct hb_ot_shape_plan_t
inline
void
_hb_glyph_info_set_unicode_props
(
hb_glyph_info_t
*
info
,
hb_unicode_funcs_t
*
unicode
)
{
info
->
unicode_props0
()
=
((
unsigned
int
)
hb_unicode_general_category
(
unicode
,
info
->
codepoint
))
|
(
_hb_unicode_
is_zero_width
(
info
->
codepoint
)
?
0x80
:
0
);
info
->
unicode_props1
()
=
_hb_unicode_modified_combining_class
(
unicode
,
info
->
codepoint
);
info
->
unicode_props0
()
=
((
unsigned
int
)
unicode
->
general_category
(
info
->
codepoint
))
|
(
unicode
->
is_zero_width
(
info
->
codepoint
)
?
0x80
:
0
);
info
->
unicode_props1
()
=
unicode
->
modified_combining_class
(
info
->
codepoint
);
}
inline
hb_unicode_general_category_t
...
...
src/hb-ot-shape.cc
浏览文件 @
208f70f0
...
...
@@ -306,7 +306,7 @@ hb_mirror_chars (hb_ot_shape_context_t *c)
unsigned
int
count
=
c
->
buffer
->
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
{
hb_codepoint_t
codepoint
=
hb_unicode_mirroring
(
unicode
,
c
->
buffer
->
info
[
i
].
codepoint
);
hb_codepoint_t
codepoint
=
unicode
->
mirroring
(
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 */
else
...
...
@@ -327,7 +327,7 @@ hb_map_glyphs (hb_font_t *font,
unsigned
int
count
=
buffer
->
len
-
1
;
for
(
buffer
->
idx
=
0
;
buffer
->
idx
<
count
;)
{
if
(
unlikely
(
_hb_unicode_
is_variation_selector
(
buffer
->
cur
(
+
1
).
codepoint
)))
{
if
(
unlikely
(
buffer
->
unicode
->
is_variation_selector
(
buffer
->
cur
(
+
1
).
codepoint
)))
{
hb_font_get_glyph
(
font
,
buffer
->
cur
().
codepoint
,
buffer
->
cur
(
+
1
).
codepoint
,
&
glyph
);
buffer
->
replace_glyphs
(
2
,
1
,
&
glyph
);
}
else
{
...
...
src/hb-unicode-private.hh
浏览文件 @
208f70f0
...
...
@@ -143,53 +143,19 @@ HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS_SIMPLE
}
struct
{
#define HB_UNICODE_FUNC_IMPLEMENT(name) hb_unicode_##name##_func_t name;
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
#undef HB_UNICODE_FUNC_IMPLEMENT
}
func
;
struct
{
#define HB_UNICODE_FUNC_IMPLEMENT(name) void *name;
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
#undef HB_UNICODE_FUNC_IMPLEMENT
}
user_data
;
struct
{
#define HB_UNICODE_FUNC_IMPLEMENT(name) hb_destroy_func_t name;
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
#undef HB_UNICODE_FUNC_IMPLEMENT
}
destroy
;
};
HB_INTERNAL
unsigned
int
modified_combining_class
(
hb_codepoint_t
unicode
);
#ifdef HAVE_GLIB
extern
HB_INTERNAL
const
hb_unicode_funcs_t
_hb_glib_unicode_funcs
;
#define _hb_unicode_funcs_default _hb_glib_unicode_funcs
#elif defined(HAVE_ICU)
extern
HB_INTERNAL
const
hb_unicode_funcs_t
_hb_icu_unicode_funcs
;
#define _hb_unicode_funcs_default _hb_icu_unicode_funcs
#else
#define HB_UNICODE_FUNCS_NIL 1
extern
HB_INTERNAL
const
hb_unicode_funcs_t
_hb_unicode_funcs_nil
;
#define _hb_unicode_funcs_default _hb_unicode_funcs_nil
#endif
HB_INTERNAL
unsigned
int
_hb_unicode_modified_combining_class
(
hb_unicode_funcs_t
*
ufuncs
,
hb_codepoint_t
unicode
);
static
inline
hb_bool_t
_hb_unicode_is_variation_selector
(
hb_codepoint_t
unicode
)
{
inline
hb_bool_t
is_variation_selector
(
hb_codepoint_t
unicode
)
{
return
unlikely
(
hb_in_ranges
<
hb_codepoint_t
>
(
unicode
,
0x180B
,
0x180D
,
/* MONGOLIAN FREE VARIATION SELECTOR ONE..THREE */
0xFE00
,
0xFE0F
,
/* VARIATION SELECTOR-1..16 */
0xE0100
,
0xE01EF
));
/* VARIATION SELECTOR-17..256 */
}
}
/* Zero-Width invisible characters:
/* Zero-Width invisible characters:
*
* 00AD SOFT HYPHEN
* 034F COMBINING GRAPHEME JOINER
...
...
@@ -217,9 +183,9 @@ _hb_unicode_is_variation_selector (hb_codepoint_t unicode)
*
* FEFF ZERO WIDTH NO-BREAK SPACE
*/
static
inline
hb_bool_t
_hb_unicode_
is_zero_width
(
hb_codepoint_t
ch
)
{
inline
hb_bool_t
is_zero_width
(
hb_codepoint_t
ch
)
{
return
((
ch
&
~
0x007F
)
==
0x2000
&&
(
hb_in_ranges
<
hb_codepoint_t
>
(
ch
,
0x200B
,
0x200F
,
0x202A
,
0x202E
,
...
...
@@ -230,6 +196,40 @@ _hb_unicode_is_zero_width (hb_codepoint_t ch)
ch
==
0x034F
||
ch
==
0x180E
||
ch
==
0xFEFF
);
}
}
struct
{
#define HB_UNICODE_FUNC_IMPLEMENT(name) hb_unicode_##name##_func_t name;
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
#undef HB_UNICODE_FUNC_IMPLEMENT
}
func
;
struct
{
#define HB_UNICODE_FUNC_IMPLEMENT(name) void *name;
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
#undef HB_UNICODE_FUNC_IMPLEMENT
}
user_data
;
struct
{
#define HB_UNICODE_FUNC_IMPLEMENT(name) hb_destroy_func_t name;
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
#undef HB_UNICODE_FUNC_IMPLEMENT
}
destroy
;
};
#ifdef HAVE_GLIB
extern
HB_INTERNAL
const
hb_unicode_funcs_t
_hb_glib_unicode_funcs
;
#define _hb_unicode_funcs_default _hb_glib_unicode_funcs
#elif defined(HAVE_ICU)
extern
HB_INTERNAL
const
hb_unicode_funcs_t
_hb_icu_unicode_funcs
;
#define _hb_unicode_funcs_default _hb_icu_unicode_funcs
#else
#define HB_UNICODE_FUNCS_NIL 1
extern
HB_INTERNAL
const
hb_unicode_funcs_t
_hb_unicode_funcs_nil
;
#define _hb_unicode_funcs_default _hb_unicode_funcs_nil
#endif
#endif
/* HB_UNICODE_PRIVATE_HH */
src/hb-unicode.cc
浏览文件 @
208f70f0
...
...
@@ -288,10 +288,9 @@ hb_unicode_decompose_compatibility (hb_unicode_funcs_t *ufuncs,
unsigned
int
_hb_unicode_modified_combining_class
(
hb_unicode_funcs_t
*
ufuncs
,
hb_codepoint_t
unicode
)
hb_unicode_funcs_t
::
modified_combining_class
(
hb_codepoint_t
unicode
)
{
int
c
=
hb_unicode_combining_class
(
ufuncs
,
unicode
);
int
c
=
combining_class
(
unicode
);
if
(
unlikely
(
hb_in_range
<
int
>
(
c
,
27
,
33
)))
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录