Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
9761f9d7
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看板
提交
9761f9d7
编写于
1月 05, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[indic] Remove more Khmer-specific stuff from Indic shaper
No numbers changed.
上级
07589536
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
25 addition
and
40 deletion
+25
-40
src/hb-ot-shape-complex-indic-machine.rl
src/hb-ot-shape-complex-indic-machine.rl
+3
-5
src/hb-ot-shape-complex-indic.cc
src/hb-ot-shape-complex-indic.cc
+22
-35
未找到文件。
src/hb-ot-shape-complex-indic-machine.rl
浏览文件 @
9761f9d7
...
...
@@ -52,7 +52,6 @@ A = 10;
PLACEHOLDER = 11;
DOTTEDCIRCLE = 12;
RS = 13;
Coeng = 14;
Repha = 15;
Ra = 16;
CM = 17;
...
...
@@ -62,7 +61,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 +69,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?.
H
.(ZWJ.N?)?);
final_halant_group = halant_group |
H
.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 | (
H.ZWJ)? matra_group{0,4})
;
consonant_syllable = (Repha|CS)? (cn.halant_group){0,4} cn medial_group halant_or_matra_group syllable_tail;
...
...
src/hb-ot-shape-complex-indic.cc
浏览文件 @
9761f9d7
...
...
@@ -152,9 +152,9 @@ is_consonant (const hb_glyph_info_t &info)
}
static
inline
bool
is_halant
_or_coeng
(
const
hb_glyph_info_t
&
info
)
is_halant
(
const
hb_glyph_info_t
&
info
)
{
return
is_one_of
(
info
,
HALANT_OR_COENG_FLAGS
);
return
is_one_of
(
info
,
FLAG
(
OT_H
)
);
}
static
inline
void
...
...
@@ -861,15 +861,15 @@ initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan,
if
(
base
<
end
)
info
[
base
].
indic_position
()
=
POS_BASE_C
;
/* Mark final consonants. A final consonant is one appearing after a matra
,
*
like in Khmer
. */
/* Mark final consonants. A final consonant is one appearing after a matra
.
*
Happens in Sinhala
. */
for
(
unsigned
int
i
=
base
+
1
;
i
<
end
;
i
++
)
if
(
info
[
i
].
indic_category
()
==
OT_M
)
{
for
(
unsigned
int
j
=
i
+
1
;
j
<
end
;
j
++
)
if
(
is_consonant
(
info
[
j
]))
{
info
[
j
].
indic_position
()
=
POS_FINAL_C
;
break
;
}
if
(
is_consonant
(
info
[
j
]))
{
info
[
j
].
indic_position
()
=
POS_FINAL_C
;
break
;
}
break
;
}
...
...
@@ -920,7 +920,7 @@ initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan,
indic_position_t
last_pos
=
POS_START
;
for
(
unsigned
int
i
=
start
;
i
<
end
;
i
++
)
{
if
((
FLAG_UNSAFE
(
info
[
i
].
indic_category
())
&
(
JOINER_FLAGS
|
FLAG
(
OT_N
)
|
FLAG
(
OT_RS
)
|
MEDIAL_FLAGS
|
HALANT_OR_COENG_FLAGS
)))
if
((
FLAG_UNSAFE
(
info
[
i
].
indic_category
())
&
(
JOINER_FLAGS
|
FLAG
(
OT_N
)
|
FLAG
(
OT_RS
)
|
MEDIAL_FLAGS
|
FLAG
(
OT_H
)
)))
{
info
[
i
].
indic_position
()
=
last_pos
;
if
(
unlikely
(
info
[
i
].
indic_category
()
==
OT_H
&&
...
...
@@ -1251,7 +1251,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_halant() test. */
info
[
i
].
indic_category
()
=
OT_H
;
_hb_glyph_info_clear_ligated_and_multiplied
(
&
info
[
i
]);
}
...
...
@@ -1284,7 +1284,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_halant
(
info
[
base
]))
base
++
;
info
[
base
].
indic_position
()
=
POS_BASE_C
;
...
...
@@ -1300,7 +1300,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_halant
(
info
[
i
]))
break
;
i
++
;
/* Skip halant. */
while
(
i
<
end
&&
is_joiner
(
info
[
i
]))
...
...
@@ -1322,7 +1322,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_H
)
)))
base
--
;
...
...
@@ -1348,13 +1348,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_H
)
))))
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_halant
(
info
[
new_pos
])
&&
info
[
new_pos
].
indic_position
()
!=
POS_PRE_M
)
{
/* -> If ZWJ or ZWNJ follow this halant, position is moved after it. */
...
...
@@ -1442,10 +1442,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_halant
(
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_halant
(
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
]))
...
...
@@ -1494,10 +1494,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_halant
(
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_halant
(
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
]))
...
...
@@ -1521,7 +1521,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_halant
(
info
[
new_reph_pos
])))
{
for
(
unsigned
int
i
=
base
+
1
;
i
<
new_reph_pos
;
i
++
)
if
(
info
[
i
].
indic_category
()
==
OT_M
)
{
/* Ok, got it. */
...
...
@@ -1582,24 +1582,11 @@ 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_H
)
)))
new_pos
--
;
/* In Khmer coeng model, a H,Ra can go *after* matras. If it goes after a
* split matra, it should be reordered to *before* the left part of such matra. */
if
(
new_pos
>
start
&&
info
[
new_pos
-
1
].
indic_category
()
==
OT_M
)
{
unsigned
int
old_pos
=
i
;
for
(
unsigned
int
j
=
base
+
1
;
j
<
old_pos
;
j
++
)
if
(
info
[
j
].
indic_category
()
==
OT_M
)
{
new_pos
--
;
break
;
}
}
}
if
(
new_pos
>
start
&&
is_halant
_or_coeng
(
info
[
new_pos
-
1
]))
if
(
new_pos
>
start
&&
is_halant
(
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录