Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
961ebf85
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看板
提交
961ebf85
编写于
1月 05, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[khmer] Remove Halant from Khmer shaper
上级
9761f9d7
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
19 addition
and
21 deletion
+19
-21
src/hb-ot-shape-complex-indic-private.hh
src/hb-ot-shape-complex-indic-private.hh
+0
-1
src/hb-ot-shape-complex-khmer-machine.rl
src/hb-ot-shape-complex-khmer-machine.rl
+3
-4
src/hb-ot-shape-complex-khmer.cc
src/hb-ot-shape-complex-khmer.cc
+16
-16
未找到文件。
src/hb-ot-shape-complex-indic-private.hh
浏览文件 @
961ebf85
...
...
@@ -73,7 +73,6 @@ enum indic_category_t {
* consonant syllable logic from the vowel syllable function and get it all right! */
#define CONSONANT_FLAGS (FLAG (OT_C) | FLAG (OT_CS) | FLAG (OT_Ra) | MEDIAL_FLAGS | FLAG (OT_V) | FLAG (OT_PLACEHOLDER) | FLAG (OT_DOTTEDCIRCLE))
#define JOINER_FLAGS (FLAG (OT_ZWJ) | FLAG (OT_ZWNJ))
#define HALANT_OR_COENG_FLAGS (FLAG (OT_H) | FLAG (OT_Coeng))
/* Visual positions in a syllable from left to right. */
...
...
src/hb-ot-shape-complex-khmer-machine.rl
浏览文件 @
961ebf85
...
...
@@ -62,7 +62,6 @@ CS = 19;
c = (C | Ra); # is_consonant
n = ((ZWNJ?.RS)? (N.N?)?); # is_consonant_modifier
z = ZWJ|ZWNJ; # is_joiner
h = H | Coeng; # is_halant_or_coeng
reph = (Ra H | Repha); # possible reph
cn = c.ZWJ?.n?;
...
...
@@ -71,10 +70,10 @@ symbol = Symbol.N?;
matra_group = z{0,3}.M.N?.(H | forced_rakar)?;
syllable_tail = (z?.SM.SM?.ZWNJ?)? A{0,3}? VD{0,2};
place_holder = PLACEHOLDER | DOTTEDCIRCLE;
halant_group = (z?.
h
.(ZWJ.N?)?);
final_halant_group = halant_group |
h
.ZWNJ;
halant_group = (z?.
Coeng
.(ZWJ.N?)?);
final_halant_group = halant_group |
Coeng
.ZWNJ;
medial_group = CM?;
halant_or_matra_group = (final_halant_group | (
h
.ZWJ)? matra_group{0,4}) (Coeng (cn|V))?;
halant_or_matra_group = (final_halant_group | (
Coeng
.ZWJ)? matra_group{0,4}) (Coeng (cn|V))?;
consonant_syllable = (Repha|CS)? (cn.halant_group){0,4} cn medial_group halant_or_matra_group syllable_tail;
...
...
src/hb-ot-shape-complex-khmer.cc
浏览文件 @
961ebf85
...
...
@@ -161,9 +161,9 @@ is_consonant (const hb_glyph_info_t &info)
}
static
inline
bool
is_
halant_or_
coeng
(
const
hb_glyph_info_t
&
info
)
is_coeng
(
const
hb_glyph_info_t
&
info
)
{
return
is_one_of
(
info
,
HALANT_OR_COENG_FLAGS
);
return
is_one_of
(
info
,
FLAG
(
OT_Coeng
)
);
}
static
inline
void
...
...
@@ -971,7 +971,7 @@ initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan,
khmer_position_t
last_pos
=
POS_START
;
for
(
unsigned
int
i
=
start
;
i
<
end
;
i
++
)
{
if
((
FLAG_UNSAFE
(
info
[
i
].
khmer_category
())
&
(
JOINER_FLAGS
|
FLAG
(
OT_N
)
|
FLAG
(
OT_RS
)
|
MEDIAL_FLAGS
|
HALANT_OR_COENG_FLAGS
)))
if
((
FLAG_UNSAFE
(
info
[
i
].
khmer_category
())
&
(
JOINER_FLAGS
|
FLAG
(
OT_N
)
|
FLAG
(
OT_RS
)
|
MEDIAL_FLAGS
|
FLAG
(
OT_Coeng
)
)))
{
info
[
i
].
khmer_position
()
=
last_pos
;
if
(
unlikely
(
info
[
i
].
khmer_category
()
==
OT_H
&&
...
...
@@ -1313,7 +1313,7 @@ final_reordering_syllable (const hb_ot_shape_plan_t *plan,
_hb_glyph_info_ligated
(
&
info
[
i
])
&&
_hb_glyph_info_multiplied
(
&
info
[
i
]))
{
/* This will make sure that this glyph passes is_
halant_or_
coeng() test. */
/* This will make sure that this glyph passes is_coeng() test. */
info
[
i
].
khmer_category
()
=
OT_H
;
_hb_glyph_info_clear_ligated_and_multiplied
(
&
info
[
i
]);
}
...
...
@@ -1346,7 +1346,7 @@ final_reordering_syllable (const hb_ot_shape_plan_t *plan,
/* Ok, this was a 'pref' candidate but didn't form any.
* Base is around here... */
base
=
i
;
while
(
base
<
end
&&
is_
halant_or_
coeng
(
info
[
base
]))
while
(
base
<
end
&&
is_coeng
(
info
[
base
]))
base
++
;
info
[
base
].
khmer_position
()
=
POS_BASE_C
;
...
...
@@ -1362,7 +1362,7 @@ final_reordering_syllable (const hb_ot_shape_plan_t *plan,
{
while
(
i
<
end
&&
is_joiner
(
info
[
i
]))
i
++
;
if
(
i
==
end
||
!
is_
halant_or_
coeng
(
info
[
i
]))
if
(
i
==
end
||
!
is_coeng
(
info
[
i
]))
break
;
i
++
;
/* Skip halant. */
while
(
i
<
end
&&
is_joiner
(
info
[
i
]))
...
...
@@ -1384,7 +1384,7 @@ final_reordering_syllable (const hb_ot_shape_plan_t *plan,
base
--
;
if
(
base
<
end
)
while
(
start
<
base
&&
is_one_of
(
info
[
base
],
(
FLAG
(
OT_N
)
|
HALANT_OR_COENG_FLAGS
)))
is_one_of
(
info
[
base
],
(
FLAG
(
OT_N
)
|
FLAG
(
OT_Coeng
)
)))
base
--
;
...
...
@@ -1410,13 +1410,13 @@ final_reordering_syllable (const hb_ot_shape_plan_t *plan,
if
(
buffer
->
props
.
script
!=
HB_SCRIPT_MALAYALAM
&&
buffer
->
props
.
script
!=
HB_SCRIPT_TAMIL
)
{
while
(
new_pos
>
start
&&
!
(
is_one_of
(
info
[
new_pos
],
(
FLAG
(
OT_M
)
|
HALANT_OR_COENG_FLAGS
))))
!
(
is_one_of
(
info
[
new_pos
],
(
FLAG
(
OT_M
)
|
FLAG
(
OT_Coeng
)
))))
new_pos
--
;
/* If we found no Halant we are done.
* Otherwise only proceed if the Halant does
* not belong to the Matra itself! */
if
(
is_
halant_or_
coeng
(
info
[
new_pos
])
&&
if
(
is_coeng
(
info
[
new_pos
])
&&
info
[
new_pos
].
khmer_position
()
!=
POS_PRE_M
)
{
/* -> If ZWJ or ZWNJ follow this halant, position is moved after it. */
...
...
@@ -1506,10 +1506,10 @@ final_reordering_syllable (const hb_ot_shape_plan_t *plan,
*/
{
new_reph_pos
=
start
+
1
;
while
(
new_reph_pos
<
base
&&
!
is_
halant_or_
coeng
(
info
[
new_reph_pos
]))
while
(
new_reph_pos
<
base
&&
!
is_coeng
(
info
[
new_reph_pos
]))
new_reph_pos
++
;
if
(
new_reph_pos
<
base
&&
is_
halant_or_
coeng
(
info
[
new_reph_pos
]))
if
(
new_reph_pos
<
base
&&
is_coeng
(
info
[
new_reph_pos
]))
{
/* ->If ZWJ or ZWNJ are following this halant, position is moved after it. */
if
(
new_reph_pos
+
1
<
base
&&
is_joiner
(
info
[
new_reph_pos
+
1
]))
...
...
@@ -1558,10 +1558,10 @@ final_reordering_syllable (const hb_ot_shape_plan_t *plan,
{
/* Copied from step 2. */
new_reph_pos
=
start
+
1
;
while
(
new_reph_pos
<
base
&&
!
is_
halant_or_
coeng
(
info
[
new_reph_pos
]))
while
(
new_reph_pos
<
base
&&
!
is_coeng
(
info
[
new_reph_pos
]))
new_reph_pos
++
;
if
(
new_reph_pos
<
base
&&
is_
halant_or_
coeng
(
info
[
new_reph_pos
]))
if
(
new_reph_pos
<
base
&&
is_coeng
(
info
[
new_reph_pos
]))
{
/* ->If ZWJ or ZWNJ are following this halant, position is moved after it. */
if
(
new_reph_pos
+
1
<
base
&&
is_joiner
(
info
[
new_reph_pos
+
1
]))
...
...
@@ -1585,7 +1585,7 @@ final_reordering_syllable (const hb_ot_shape_plan_t *plan,
* TEST: U+0930,U+094D,U+0915,U+094B,U+094D
*/
if
(
!
hb_options
().
uniscribe_bug_compatible
&&
unlikely
(
is_
halant_or_
coeng
(
info
[
new_reph_pos
])))
{
unlikely
(
is_coeng
(
info
[
new_reph_pos
])))
{
for
(
unsigned
int
i
=
base
+
1
;
i
<
new_reph_pos
;
i
++
)
if
(
info
[
i
].
khmer_category
()
==
OT_M
)
{
/* Ok, got it. */
...
...
@@ -1646,7 +1646,7 @@ final_reordering_syllable (const hb_ot_shape_plan_t *plan,
if
(
buffer
->
props
.
script
!=
HB_SCRIPT_MALAYALAM
&&
buffer
->
props
.
script
!=
HB_SCRIPT_TAMIL
)
{
while
(
new_pos
>
start
&&
!
(
is_one_of
(
info
[
new_pos
-
1
],
FLAG
(
OT_M
)
|
HALANT_OR_COENG_FLAGS
)))
!
(
is_one_of
(
info
[
new_pos
-
1
],
FLAG
(
OT_M
)
|
FLAG
(
OT_Coeng
)
)))
new_pos
--
;
/* In Khmer coeng model, a H,Ra can go *after* matras. If it goes after a
...
...
@@ -1663,7 +1663,7 @@ final_reordering_syllable (const hb_ot_shape_plan_t *plan,
}
}
if
(
new_pos
>
start
&&
is_
halant_or_
coeng
(
info
[
new_pos
-
1
]))
if
(
new_pos
>
start
&&
is_coeng
(
info
[
new_pos
-
1
]))
{
/* -> If ZWJ or ZWNJ follow this halant, position is moved after it. */
if
(
new_pos
<
end
&&
is_joiner
(
info
[
new_pos
]))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录