Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
dc480fc4
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看板
提交
dc480fc4
编写于
7月 02, 2019
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[amalgam] More Indic-like issues
Part of
https://github.com/harfbuzz/harfbuzz/issues/1809
上级
d8b5353e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
74 addition
and
70 deletion
+74
-70
src/hb-ot-shape-complex-indic.cc
src/hb-ot-shape-complex-indic.cc
+39
-37
src/hb-ot-shape-complex-khmer.cc
src/hb-ot-shape-complex-khmer.cc
+19
-17
src/hb-ot-shape-complex-use.cc
src/hb-ot-shape-complex-use.cc
+16
-16
未找到文件。
src/hb-ot-shape-complex-indic.cc
浏览文件 @
dc480fc4
...
...
@@ -144,31 +144,31 @@ indic_features[] =
* Must be in the same order as the indic_features array.
*/
enum
{
_NUKT
,
_AKHN
,
RPHF
,
_RKRF
,
PREF
,
BLWF
,
ABVF
,
HALF
,
PSTF
,
_VATU
,
_CJCT
,
INIT
,
_PRES
,
_ABVS
,
_BLWS
,
_PSTS
,
_HALN
,
_DIST
,
_ABVM
,
_BLWM
,
_
INDIC_
NUKT
,
_
INDIC_
AKHN
,
INDIC_
RPHF
,
_
INDIC_
RKRF
,
INDIC_
PREF
,
INDIC_
BLWF
,
INDIC_
ABVF
,
INDIC_
HALF
,
INDIC_
PSTF
,
_
INDIC_
VATU
,
_
INDIC_
CJCT
,
IN
DIC_IN
IT
,
_
INDIC_
PRES
,
_
INDIC_
ABVS
,
_
INDIC_
BLWS
,
_
INDIC_
PSTS
,
_
INDIC_
HALN
,
_
INDIC_
DIST
,
_
INDIC_
ABVM
,
_
INDIC_
BLWM
,
INDIC_NUM_FEATURES
,
INDIC_BASIC_FEATURES
=
INIT
,
/* Don't forget to update this! */
INDIC_BASIC_FEATURES
=
IN
DIC_IN
IT
,
/* Don't forget to update this! */
};
static
void
...
...
@@ -467,7 +467,7 @@ initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan,
* and has more than one consonant, Ra is excluded from candidates for
* base consonants. */
unsigned
int
limit
=
start
;
if
(
indic_plan
->
mask_array
[
RPHF
]
&&
if
(
indic_plan
->
mask_array
[
INDIC_
RPHF
]
&&
start
+
3
<=
end
&&
(
(
indic_plan
->
config
->
reph_mode
==
REPH_MODE_IMPLICIT
&&
!
is_joiner
(
info
[
start
+
2
]))
||
...
...
@@ -803,13 +803,13 @@ initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan,
/* Reph */
for
(
unsigned
int
i
=
start
;
i
<
end
&&
info
[
i
].
indic_position
()
==
POS_RA_TO_BECOME_REPH
;
i
++
)
info
[
i
].
mask
|=
indic_plan
->
mask_array
[
RPHF
];
info
[
i
].
mask
|=
indic_plan
->
mask_array
[
INDIC_
RPHF
];
/* Pre-base */
mask
=
indic_plan
->
mask_array
[
HALF
];
mask
=
indic_plan
->
mask_array
[
INDIC_
HALF
];
if
(
!
indic_plan
->
is_old_spec
&&
indic_plan
->
config
->
blwf_mode
==
BLWF_MODE_PRE_AND_POST
)
mask
|=
indic_plan
->
mask_array
[
BLWF
];
mask
|=
indic_plan
->
mask_array
[
INDIC_
BLWF
];
for
(
unsigned
int
i
=
start
;
i
<
base
;
i
++
)
info
[
i
].
mask
|=
mask
;
/* Base */
...
...
@@ -817,7 +817,9 @@ initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan,
if
(
base
<
end
)
info
[
base
].
mask
|=
mask
;
/* Post-base */
mask
=
indic_plan
->
mask_array
[
BLWF
]
|
indic_plan
->
mask_array
[
ABVF
]
|
indic_plan
->
mask_array
[
PSTF
];
mask
=
indic_plan
->
mask_array
[
INDIC_BLWF
]
|
indic_plan
->
mask_array
[
INDIC_ABVF
]
|
indic_plan
->
mask_array
[
INDIC_PSTF
];
for
(
unsigned
int
i
=
base
+
1
;
i
<
end
;
i
++
)
info
[
i
].
mask
|=
mask
;
}
...
...
@@ -849,13 +851,13 @@ initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan,
(
i
+
2
==
base
||
info
[
i
+
2
].
indic_category
()
!=
OT_ZWJ
))
{
info
[
i
].
mask
|=
indic_plan
->
mask_array
[
BLWF
];
info
[
i
+
1
].
mask
|=
indic_plan
->
mask_array
[
BLWF
];
info
[
i
].
mask
|=
indic_plan
->
mask_array
[
INDIC_
BLWF
];
info
[
i
+
1
].
mask
|=
indic_plan
->
mask_array
[
INDIC_
BLWF
];
}
}
unsigned
int
pref_len
=
2
;
if
(
indic_plan
->
mask_array
[
PREF
]
&&
base
+
pref_len
<
end
)
if
(
indic_plan
->
mask_array
[
INDIC_
PREF
]
&&
base
+
pref_len
<
end
)
{
/* Find a Halant,Ra sequence and mark it for pre-base-reordering processing. */
for
(
unsigned
int
i
=
base
+
1
;
i
+
pref_len
-
1
<
end
;
i
++
)
{
...
...
@@ -865,7 +867,7 @@ initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan,
if
(
indic_plan
->
pref
.
would_substitute
(
glyphs
,
pref_len
,
face
))
{
for
(
unsigned
int
j
=
0
;
j
<
pref_len
;
j
++
)
info
[
i
++
].
mask
|=
indic_plan
->
mask_array
[
PREF
];
info
[
i
++
].
mask
|=
indic_plan
->
mask_array
[
INDIC_
PREF
];
break
;
}
}
...
...
@@ -886,7 +888,7 @@ initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan,
/* A ZWNJ disables HALF. */
if
(
non_joiner
)
info
[
j
].
mask
&=
~
indic_plan
->
mask_array
[
HALF
];
info
[
j
].
mask
&=
~
indic_plan
->
mask_array
[
INDIC_
HALF
];
}
while
(
j
>
start
&&
!
is_consonant
(
info
[
j
]));
}
...
...
@@ -1053,7 +1055,7 @@ final_reordering_syllable (const hb_ot_shape_plan_t *plan,
* syllable.
*/
bool
try_pref
=
!!
indic_plan
->
mask_array
[
PREF
];
bool
try_pref
=
!!
indic_plan
->
mask_array
[
INDIC_
PREF
];
/* Find base again */
unsigned
int
base
;
...
...
@@ -1063,7 +1065,7 @@ final_reordering_syllable (const hb_ot_shape_plan_t *plan,
if
(
try_pref
&&
base
+
1
<
end
)
{
for
(
unsigned
int
i
=
base
+
1
;
i
<
end
;
i
++
)
if
((
info
[
i
].
mask
&
indic_plan
->
mask_array
[
PREF
])
!=
0
)
if
((
info
[
i
].
mask
&
indic_plan
->
mask_array
[
INDIC_
PREF
])
!=
0
)
{
if
(
!
(
_hb_glyph_info_substituted
(
&
info
[
i
])
&&
_hb_glyph_info_ligated_and_didnt_multiply
(
&
info
[
i
])))
...
...
@@ -1385,7 +1387,7 @@ final_reordering_syllable (const hb_ot_shape_plan_t *plan,
if
(
try_pref
&&
base
+
1
<
end
)
/* Otherwise there can't be any pre-base-reordering Ra. */
{
for
(
unsigned
int
i
=
base
+
1
;
i
<
end
;
i
++
)
if
((
info
[
i
].
mask
&
indic_plan
->
mask_array
[
PREF
])
!=
0
)
if
((
info
[
i
].
mask
&
indic_plan
->
mask_array
[
INDIC_
PREF
])
!=
0
)
{
/* 1. Only reorder a glyph produced by substitution during application
* of the <pref> feature. (Note that a font may shape a Ra consonant with
...
...
@@ -1448,7 +1450,7 @@ final_reordering_syllable (const hb_ot_shape_plan_t *plan,
if
(
!
start
||
!
(
FLAG_UNSAFE
(
_hb_glyph_info_get_general_category
(
&
info
[
start
-
1
]))
&
FLAG_RANGE
(
HB_UNICODE_GENERAL_CATEGORY_FORMAT
,
HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK
)))
info
[
start
].
mask
|=
indic_plan
->
mask_array
[
INIT
];
info
[
start
].
mask
|=
indic_plan
->
mask_array
[
IN
DIC_IN
IT
];
else
buffer
->
unsafe_to_break
(
start
-
1
,
start
+
1
);
}
...
...
src/hb-ot-shape-complex-khmer.cc
浏览文件 @
dc480fc4
...
...
@@ -69,23 +69,23 @@ khmer_features[] =
* Must be in the same order as the khmer_features array.
*/
enum
{
PREF
,
BLWF
,
ABVF
,
PSTF
,
CFAR
,
KHMER_
PREF
,
KHMER_
BLWF
,
KHMER_
ABVF
,
KHMER_
PSTF
,
KHMER_
CFAR
,
_PRES
,
_ABVS
,
_BLWS
,
_PSTS
,
_
KHMER_
PRES
,
_
KHMER_
ABVS
,
_
KHMER_
BLWS
,
_
KHMER_
PSTS
,
_DIST
,
_ABVM
,
_BLWM
,
_
KHMER_
DIST
,
_
KHMER_
ABVM
,
_
KHMER_
BLWM
,
KHMER_NUM_FEATURES
,
KHMER_BASIC_FEATURES
=
_PRES
,
/* Don't forget to update this! */
KHMER_BASIC_FEATURES
=
_
KHMER_
PRES
,
/* Don't forget to update this! */
};
static
void
...
...
@@ -252,7 +252,9 @@ reorder_consonant_syllable (const hb_ot_shape_plan_t *plan,
/* Setup masks. */
{
/* Post-base */
hb_mask_t
mask
=
khmer_plan
->
mask_array
[
BLWF
]
|
khmer_plan
->
mask_array
[
ABVF
]
|
khmer_plan
->
mask_array
[
PSTF
];
hb_mask_t
mask
=
khmer_plan
->
mask_array
[
KHMER_BLWF
]
|
khmer_plan
->
mask_array
[
KHMER_ABVF
]
|
khmer_plan
->
mask_array
[
KHMER_PSTF
];
for
(
unsigned
int
i
=
start
+
1
;
i
<
end
;
i
++
)
info
[
i
].
mask
|=
mask
;
}
...
...
@@ -279,7 +281,7 @@ reorder_consonant_syllable (const hb_ot_shape_plan_t *plan,
if
(
info
[
i
+
1
].
khmer_category
()
==
OT_Ra
)
{
for
(
unsigned
int
j
=
0
;
j
<
2
;
j
++
)
info
[
i
+
j
].
mask
|=
khmer_plan
->
mask_array
[
PREF
];
info
[
i
+
j
].
mask
|=
khmer_plan
->
mask_array
[
KHMER_
PREF
];
/* Move the Coeng,Ro sequence to the start. */
buffer
->
merge_clusters
(
start
,
i
+
2
);
...
...
@@ -295,9 +297,9 @@ reorder_consonant_syllable (const hb_ot_shape_plan_t *plan,
* U+1784,U+17D2,U+179A,U+17D2,U+1782
* U+1784,U+17D2,U+1782,U+17D2,U+179A
*/
if
(
khmer_plan
->
mask_array
[
CFAR
])
if
(
khmer_plan
->
mask_array
[
KHMER_
CFAR
])
for
(
unsigned
int
j
=
i
+
2
;
j
<
end
;
j
++
)
info
[
j
].
mask
|=
khmer_plan
->
mask_array
[
CFAR
];
info
[
j
].
mask
|=
khmer_plan
->
mask_array
[
KHMER_
CFAR
];
num_coengs
=
2
;
/* Done. */
}
...
...
src/hb-ot-shape-complex-use.cc
浏览文件 @
dc480fc4
...
...
@@ -59,7 +59,7 @@ use_basic_features[] =
HB_TAG
(
'c'
,
'j'
,
'c'
,
't'
),
};
static
const
hb_tag_t
use_
arabic
_features
[]
=
use_
topographical
_features
[]
=
{
HB_TAG
(
'i'
,
's'
,
'o'
,
'l'
),
HB_TAG
(
'i'
,
'n'
,
'i'
,
't'
),
...
...
@@ -71,13 +71,13 @@ use_arabic_features[] =
HB_TAG
(
'f'
,
'i'
,
'n'
,
'2'
),
HB_TAG
(
'f'
,
'i'
,
'n'
,
'3'
),
};
/* Same order as use_
arabic
_features. Don't need Syriac stuff.*/
/* Same order as use_
topographical
_features. Don't need Syriac stuff.*/
enum
joining_form_t
{
ISOL
,
INIT
,
MEDI
,
FINA
,
_NONE
USE_
ISOL
,
USE_
INIT
,
USE_
MEDI
,
USE_
FINA
,
_
USE_
NONE
};
static
const
hb_tag_t
use_other_features
[]
=
...
...
@@ -152,8 +152,8 @@ collect_features_use (hb_ot_shape_planner_t *plan)
map
->
add_gsub_pause
(
_hb_clear_syllables
);
/* "Topographical features" */
for
(
unsigned
int
i
=
0
;
i
<
ARRAY_LENGTH
(
use_
arabic
_features
);
i
++
)
map
->
add_feature
(
use_
arabic
_features
[
i
]);
for
(
unsigned
int
i
=
0
;
i
<
ARRAY_LENGTH
(
use_
topographical
_features
);
i
++
)
map
->
add_feature
(
use_
topographical
_features
[
i
]);
map
->
add_gsub_pause
(
nullptr
);
/* "Standard typographic presentation" */
...
...
@@ -305,11 +305,11 @@ setup_topographical_masks (const hb_ot_shape_plan_t *plan,
if
(
use_plan
->
arabic_plan
)
return
;
static_assert
((
INIT
<
4
&&
ISOL
<
4
&&
MEDI
<
4
&&
FINA
<
4
),
""
);
static_assert
((
USE_INIT
<
4
&&
USE_ISOL
<
4
&&
USE_MEDI
<
4
&&
USE_
FINA
<
4
),
""
);
hb_mask_t
masks
[
4
],
all_masks
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
4
;
i
++
)
{
masks
[
i
]
=
plan
->
map
.
get_1_mask
(
use_
arabic
_features
[
i
]);
masks
[
i
]
=
plan
->
map
.
get_1_mask
(
use_
topographical
_features
[
i
]);
if
(
masks
[
i
]
==
plan
->
map
.
get_global_mask
())
masks
[
i
]
=
0
;
all_masks
|=
masks
[
i
];
...
...
@@ -319,7 +319,7 @@ setup_topographical_masks (const hb_ot_shape_plan_t *plan,
hb_mask_t
other_masks
=
~
all_masks
;
unsigned
int
last_start
=
0
;
joining_form_t
last_form
=
_NONE
;
joining_form_t
last_form
=
_
USE_
NONE
;
hb_glyph_info_t
*
info
=
buffer
->
info
;
foreach_syllable
(
buffer
,
start
,
end
)
{
...
...
@@ -330,7 +330,7 @@ setup_topographical_masks (const hb_ot_shape_plan_t *plan,
case
use_symbol_cluster
:
case
use_non_cluster
:
/* These don't join. Nothing to do. */
last_form
=
_NONE
;
last_form
=
_
USE_
NONE
;
break
;
case
use_virama_terminated_cluster
:
...
...
@@ -340,18 +340,18 @@ setup_topographical_masks (const hb_ot_shape_plan_t *plan,
case
use_numeral_cluster
:
case
use_broken_cluster
:
bool
join
=
last_form
==
FINA
||
last_form
==
ISOL
;
bool
join
=
last_form
==
USE_FINA
||
last_form
==
USE_
ISOL
;
if
(
join
)
{
/* Fixup previous syllable's form. */
last_form
=
last_form
==
FINA
?
MEDI
:
INIT
;
last_form
=
last_form
==
USE_FINA
?
USE_MEDI
:
USE_
INIT
;
for
(
unsigned
int
i
=
last_start
;
i
<
start
;
i
++
)
info
[
i
].
mask
=
(
info
[
i
].
mask
&
other_masks
)
|
masks
[
last_form
];
}
/* Form for this syllable. */
last_form
=
join
?
FINA
:
ISOL
;
last_form
=
join
?
USE_FINA
:
USE_
ISOL
;
for
(
unsigned
int
i
=
start
;
i
<
end
;
i
++
)
info
[
i
].
mask
=
(
info
[
i
].
mask
&
other_masks
)
|
masks
[
last_form
];
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录