Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
d830d3d2
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d830d3d2
编写于
2月 13, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[indic] Share some copy/pasta code
上级
397ed53e
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
37 addition
and
68 deletion
+37
-68
src/hb-ot-shape-complex-indic-private.hh
src/hb-ot-shape-complex-indic-private.hh
+27
-2
src/hb-ot-shape-complex-indic.cc
src/hb-ot-shape-complex-indic.cc
+0
-27
src/hb-ot-shape-complex-khmer.cc
src/hb-ot-shape-complex-khmer.cc
+8
-22
src/hb-ot-shape-complex-myanmar.cc
src/hb-ot-shape-complex-myanmar.cc
+2
-17
未找到文件。
src/hb-ot-shape-complex-indic-private.hh
浏览文件 @
d830d3d2
...
...
@@ -190,6 +190,31 @@ hb_indic_get_categories (hb_codepoint_t u);
#define indic_category() complex_var_u8_0()
/* indic_category_t */
#define indic_position() complex_var_u8_1()
/* indic_position_t */
static
inline
bool
is_one_of
(
const
hb_glyph_info_t
&
info
,
unsigned
int
flags
)
{
/* If it ligated, all bets are off. */
if
(
_hb_glyph_info_ligated
(
&
info
))
return
false
;
return
!!
(
FLAG_UNSAFE
(
info
.
indic_category
())
&
flags
);
}
static
inline
bool
is_joiner
(
const
hb_glyph_info_t
&
info
)
{
return
is_one_of
(
info
,
JOINER_FLAGS
);
}
static
inline
bool
is_consonant
(
const
hb_glyph_info_t
&
info
)
{
return
is_one_of
(
info
,
CONSONANT_FLAGS
);
}
static
inline
bool
is_halant
(
const
hb_glyph_info_t
&
info
)
{
return
is_one_of
(
info
,
FLAG
(
OT_H
));
}
#define IN_HALF_BLOCK(u, Base) (((u) & ~0x7Fu) == (Base))
...
...
@@ -245,7 +270,7 @@ hb_indic_get_categories (hb_codepoint_t u);
)
static
inline
indic_position_t
matra_position
(
hb_codepoint_t
u
,
indic_position_t
side
)
matra_position
_indic
(
hb_codepoint_t
u
,
indic_position_t
side
)
{
switch
((
int
)
side
)
{
...
...
@@ -355,7 +380,7 @@ set_indic_properties (hb_glyph_info_t &info)
}
else
if
(
cat
==
OT_M
)
{
pos
=
matra_position
(
u
,
pos
);
pos
=
matra_position
_indic
(
u
,
pos
);
}
else
if
((
FLAG_UNSAFE
(
cat
)
&
(
FLAG
(
OT_SM
)
/* | FLAG (OT_VD) */
|
FLAG
(
OT_A
)
|
FLAG
(
OT_Symbol
))))
{
...
...
src/hb-ot-shape-complex-indic.cc
浏览文件 @
d830d3d2
...
...
@@ -33,33 +33,6 @@
*/
static
inline
bool
is_one_of
(
const
hb_glyph_info_t
&
info
,
unsigned
int
flags
)
{
/* If it ligated, all bets are off. */
if
(
_hb_glyph_info_ligated
(
&
info
))
return
false
;
return
!!
(
FLAG_UNSAFE
(
info
.
indic_category
())
&
flags
);
}
static
inline
bool
is_joiner
(
const
hb_glyph_info_t
&
info
)
{
return
is_one_of
(
info
,
JOINER_FLAGS
);
}
static
inline
bool
is_consonant
(
const
hb_glyph_info_t
&
info
)
{
return
is_one_of
(
info
,
CONSONANT_FLAGS
);
}
static
inline
bool
is_halant
(
const
hb_glyph_info_t
&
info
)
{
return
is_one_of
(
info
,
FLAG
(
OT_H
));
}
/*
* Indic configurations. Note that we do not want to keep every single script-specific
* behavior in these tables necessarily. This should mainly be used for per-script
...
...
src/hb-ot-shape-complex-khmer.cc
浏览文件 @
d830d3d2
...
...
@@ -28,8 +28,8 @@
#include "hb-ot-layout-private.hh"
/* buffer var allocations */
#define khmer_category()
complex_var_u8_0
()
/* khmer_category_t */
#define khmer_position()
complex_var_u8_1
()
/* khmer_position_t */
#define khmer_category()
indic_category
()
/* khmer_category_t */
#define khmer_position()
indic_position
()
/* khmer_position_t */
/*
...
...
@@ -41,7 +41,7 @@ typedef indic_position_t khmer_position_t;
static
inline
khmer_position_t
matra_position
(
khmer_position_t
side
)
matra_position
_khmer
(
khmer_position_t
side
)
{
switch
((
int
)
side
)
{
...
...
@@ -59,21 +59,7 @@ matra_position (khmer_position_t side)
}
static
inline
bool
is_one_of
(
const
hb_glyph_info_t
&
info
,
unsigned
int
flags
)
{
/* If it ligated, all bets are off. */
if
(
_hb_glyph_info_ligated
(
&
info
))
return
false
;
return
!!
(
FLAG_UNSAFE
(
info
.
khmer_category
())
&
flags
);
}
static
inline
bool
is_joiner
(
const
hb_glyph_info_t
&
info
)
{
return
is_one_of
(
info
,
JOINER_FLAGS
);
}
static
inline
bool
is_consonant
(
const
hb_glyph_info_t
&
info
)
is_consonant_or_vowel
(
const
hb_glyph_info_t
&
info
)
{
return
is_one_of
(
info
,
CONSONANT_FLAGS
|
FLAG
(
OT_V
));
}
...
...
@@ -122,7 +108,7 @@ set_khmer_properties (hb_glyph_info_t &info)
}
else
if
(
cat
==
OT_M
)
{
pos
=
matra_position
(
pos
);
pos
=
matra_position
_khmer
(
pos
);
}
else
if
((
FLAG_UNSAFE
(
cat
)
&
(
FLAG
(
OT_SM
)
|
FLAG
(
OT_A
)
|
FLAG
(
OT_Symbol
))))
{
...
...
@@ -404,7 +390,7 @@ initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan,
/* Mark all subsequent consonants as below. */
for
(
unsigned
int
i
=
base
+
1
;
i
<
end
;
i
++
)
if
(
is_consonant
(
info
[
i
]))
if
(
is_consonant
_or_vowel
(
info
[
i
]))
info
[
i
].
khmer_position
()
=
POS_BELOW_C
;
/* Mark final consonants. A final consonant is one appearing after a matra,
...
...
@@ -412,7 +398,7 @@ initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan,
for
(
unsigned
int
i
=
base
+
1
;
i
<
end
;
i
++
)
if
(
info
[
i
].
khmer_category
()
==
OT_M
)
{
for
(
unsigned
int
j
=
i
+
1
;
j
<
end
;
j
++
)
if
(
is_consonant
(
info
[
j
]))
{
if
(
is_consonant
_or_vowel
(
info
[
j
]))
{
info
[
j
].
khmer_position
()
=
POS_FINAL_C
;
break
;
}
...
...
@@ -455,7 +441,7 @@ initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan,
{
unsigned
int
last
=
base
;
for
(
unsigned
int
i
=
base
+
1
;
i
<
end
;
i
++
)
if
(
is_consonant
(
info
[
i
]))
if
(
is_consonant
_or_vowel
(
info
[
i
]))
{
for
(
unsigned
int
j
=
last
+
1
;
j
<
i
;
j
++
)
if
(
info
[
j
].
khmer_position
()
<
POS_SMVD
)
...
...
src/hb-ot-shape-complex-myanmar.cc
浏览文件 @
d830d3d2
...
...
@@ -27,8 +27,8 @@
#include "hb-ot-shape-complex-indic-private.hh"
/* buffer var allocations */
#define myanmar_category()
complex_var_u8_0
()
/* myanmar_category_t */
#define myanmar_position()
complex_var_u8_1
()
/* myanmar_position_t */
#define myanmar_category()
indic_category
()
/* myanmar_category_t */
#define myanmar_position()
indic_position
()
/* myanmar_position_t */
/*
...
...
@@ -149,21 +149,6 @@ enum myanmar_category_t {
};
static
inline
bool
is_one_of
(
const
hb_glyph_info_t
&
info
,
unsigned
int
flags
)
{
/* If it ligated, all bets are off. */
if
(
_hb_glyph_info_ligated
(
&
info
))
return
false
;
return
!!
(
FLAG_UNSAFE
(
info
.
myanmar_category
())
&
flags
);
}
static
inline
bool
is_consonant
(
const
hb_glyph_info_t
&
info
)
{
return
is_one_of
(
info
,
CONSONANT_FLAGS
);
}
static
inline
void
set_myanmar_properties
(
hb_glyph_info_t
&
info
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录