Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
9ac4b965
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
12 个月 前同步成功
通知
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9ac4b965
编写于
11月 04, 2015
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add Unicode space category
Unused so far.
上级
8249ec3f
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
76 addition
and
2 deletion
+76
-2
src/hb-ot-layout-private.hh
src/hb-ot-layout-private.hh
+76
-2
未找到文件。
src/hb-ot-layout-private.hh
浏览文件 @
9ac4b965
...
...
@@ -213,6 +213,23 @@ _next_syllable (hb_buffer_t *buffer, unsigned int start)
/* unicode_props */
/* Design:
* unicode_props() is a two-byte number. The low byte includes:
* - General_Category: 5 bits.
* - A bit each for:
* * Is it Default_Ignorable(); we have a modified Default_Ignorable().
* * Is it U+200D ZWJ?
* * Is it U+200C ZWNJ?
*
* The high-byte has different meanings, switched by the Gen-Cat:
* - For Mn,Mc,Me: the modified Combining_Class.
* - For Ws: index of which space character this is, if space fallback
* is needed, ie. we don't set this by default, only if asked to.
*
* If needed, we can use the ZWJ/ZWNJ to use the high byte as well,
* freeing two more bits.
*/
enum
{
UPROPS_MASK_ZWJ
=
0x20u
,
UPROPS_MASK_ZWNJ
=
0x40u
,
...
...
@@ -220,6 +237,23 @@ enum {
UPROPS_MASK_GEN_CAT
=
0x1Fu
};
enum
space_t
{
SPACE
=
0
,
SPACE_NBSP
,
SPACE_EN
,
SPACE_EM
,
SPACE_EM_3
,
SPACE_EM_4
,
SPACE_EM_6
,
SPACE_FIGURE
,
SPACE_PUNCTUATION
,
SPACE_THIN
,
SPACE_HAIR
,
SPACE_NARROW
,
SPACE_MEDIUM
,
SPACE_IDEOGRAPHIC
,
};
static
inline
void
_hb_glyph_info_set_unicode_props
(
hb_glyph_info_t
*
info
,
hb_unicode_funcs_t
*
unicode
)
{
...
...
@@ -246,6 +280,9 @@ _hb_glyph_info_set_unicode_props (hb_glyph_info_t *info, hb_unicode_funcs_t *uni
* property value 0.
* 1.1.5+
* """
*
* Also, all Mn's that are Default_Ignorable, have ccc=0, hence
* the "else if".
*/
props
|=
unicode
->
modified_combining_class
(
info
->
codepoint
)
<<
8
;
}
...
...
@@ -273,7 +310,6 @@ _hb_glyph_info_is_unicode_mark (const hb_glyph_info_t *info)
{
return
HB_UNICODE_GENERAL_CATEGORY_IS_MARK
(
info
->
unicode_props
()
&
UPROPS_MASK_GEN_CAT
);
}
static
inline
void
_hb_glyph_info_set_modified_combining_class
(
hb_glyph_info_t
*
info
,
unsigned
int
modified_class
)
...
...
@@ -282,13 +318,51 @@ _hb_glyph_info_set_modified_combining_class (hb_glyph_info_t *info,
return
;
info
->
unicode_props
()
=
(
modified_class
<<
8
)
|
(
info
->
unicode_props
()
&
0xFF
);
}
static
inline
unsigned
int
_hb_glyph_info_get_modified_combining_class
(
const
hb_glyph_info_t
*
info
)
{
return
_hb_glyph_info_is_unicode_mark
(
info
)
?
info
->
unicode_props
()
>>
8
:
0
;
}
static
inline
bool
_hb_glyph_info_is_unicode_space
(
const
hb_glyph_info_t
*
info
)
{
return
_hb_glyph_info_get_general_category
(
info
)
==
HB_UNICODE_GENERAL_CATEGORY_SPACE_SEPARATOR
;
}
static
inline
void
_hb_glyph_info_set_unicode_space_for_char
(
hb_glyph_info_t
*
info
,
hb_codepoint_t
u
)
{
if
(
unlikely
(
!
_hb_glyph_info_is_unicode_space
(
info
)))
return
;
space_t
s
;
switch
(
u
)
{
default:
s
=
SPACE
;
break
;
/* Shouldn't happen. */
case
0x00A0u
:
s
=
SPACE_NBSP
;
break
;
case
0x2002u
:
s
=
SPACE_EN
;
break
;
case
0x2003u
:
s
=
SPACE_EM
;
break
;
case
0x2004u
:
s
=
SPACE_EM_3
;
break
;
case
0x2005u
:
s
=
SPACE_EM_4
;
break
;
case
0x2006u
:
s
=
SPACE_EM_6
;
break
;
case
0x2007u
:
s
=
SPACE_FIGURE
;
break
;
case
0x2008u
:
s
=
SPACE_PUNCTUATION
;
break
;
case
0x2009u
:
s
=
SPACE_THIN
;
break
;
case
0x200Au
:
s
=
SPACE_HAIR
;
break
;
case
0x202Fu
:
s
=
SPACE_NARROW
;
break
;
case
0x205Fu
:
s
=
SPACE_MEDIUM
;
break
;
case
0x3000u
:
s
=
SPACE_IDEOGRAPHIC
;
break
;
}
info
->
unicode_props
()
=
(((
unsigned
int
)
s
)
<<
8
)
|
(
info
->
unicode_props
()
&
0xFF
);
}
static
inline
space_t
_hb_glyph_info_get_unicode_space
(
const
hb_glyph_info_t
*
info
)
{
return
_hb_glyph_info_is_unicode_space
(
info
)
?
(
space_t
)
(
info
->
unicode_props
()
>>
8
)
:
SPACE
;
}
static
inline
bool
_hb_glyph_info_ligated
(
const
hb_glyph_info_t
*
info
);
static
inline
hb_bool_t
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录