Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
f048ead8
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看板
提交
f048ead8
编写于
9月 24, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Some more
上级
1676f608
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
59 addition
and
57 deletion
+59
-57
src/hb-ot-map.cc
src/hb-ot-map.cc
+3
-2
src/hb-ot-map.hh
src/hb-ot-map.hh
+7
-6
src/hb-ot-shape-complex-arabic.cc
src/hb-ot-shape-complex-arabic.cc
+9
-9
src/hb-ot-shape-complex-hangul.cc
src/hb-ot-shape-complex-hangul.cc
+1
-1
src/hb-ot-shape-complex-indic.cc
src/hb-ot-shape-complex-indic.cc
+4
-4
src/hb-ot-shape-complex-khmer.cc
src/hb-ot-shape-complex-khmer.cc
+4
-4
src/hb-ot-shape-complex-myanmar.cc
src/hb-ot-shape-complex-myanmar.cc
+5
-5
src/hb-ot-shape-complex-tibetan.cc
src/hb-ot-shape-complex-tibetan.cc
+1
-1
src/hb-ot-shape-complex-use.cc
src/hb-ot-shape-complex-use.cc
+10
-10
src/hb-ot-shape.cc
src/hb-ot-shape.cc
+15
-15
未找到文件。
src/hb-ot-map.cc
浏览文件 @
f048ead8
...
...
@@ -74,8 +74,9 @@ hb_ot_map_builder_t::~hb_ot_map_builder_t (void)
stages
[
table_index
].
fini
();
}
void
hb_ot_map_builder_t
::
add_feature
(
hb_tag_t
tag
,
unsigned
int
value
,
hb_ot_map_feature_flags_t
flags
)
void
hb_ot_map_builder_t
::
add_feature
(
hb_tag_t
tag
,
hb_ot_map_feature_flags_t
flags
,
unsigned
int
value
)
{
feature_info_t
*
info
=
feature_infos
.
push
();
if
(
unlikely
(
!
tag
))
return
;
...
...
src/hb-ot-map.hh
浏览文件 @
f048ead8
...
...
@@ -196,17 +196,18 @@ struct hb_ot_map_builder_t
HB_INTERNAL
~
hb_ot_map_builder_t
(
void
);
HB_INTERNAL
void
add_feature
(
hb_tag_t
tag
,
unsigned
int
value
,
hb_ot_map_feature_flags_t
flags
);
HB_INTERNAL
void
add_feature
(
hb_tag_t
tag
,
hb_ot_map_feature_flags_t
flags
=
F_NONE
,
unsigned
int
value
=
1
);
inline
void
add_feature
(
const
hb_ot_map_feature_t
&
feat
)
{
add_feature
(
feat
.
tag
,
1
,
feat
.
flags
);
}
{
add_feature
(
feat
.
tag
,
feat
.
flags
);
}
inline
void
add_global_bool
_feature
(
hb_tag_t
tag
)
{
add_feature
(
tag
,
1
,
F_GLOBAL
);
}
inline
void
enable
_feature
(
hb_tag_t
tag
)
{
add_feature
(
tag
,
F_GLOBAL
);
}
inline
void
disable_feature
(
hb_tag_t
tag
)
{
add_feature
(
tag
,
0
,
F_GLOBAL
);
}
{
add_feature
(
tag
,
F_GLOBAL
,
0
);
}
inline
void
add_gsub_pause
(
hb_ot_map_t
::
pause_func_t
pause_func
)
{
add_pause
(
0
,
pause_func
);
}
...
...
src/hb-ot-shape-complex-arabic.cc
浏览文件 @
f048ead8
...
...
@@ -202,28 +202,28 @@ collect_features_arabic (hb_ot_shape_planner_t *plan)
map
->
add_gsub_pause
(
nuke_joiners
);
map
->
add_global_bool
_feature
(
HB_TAG
(
's'
,
't'
,
'c'
,
'h'
));
map
->
enable
_feature
(
HB_TAG
(
's'
,
't'
,
'c'
,
'h'
));
map
->
add_gsub_pause
(
record_stch
);
map
->
add_global_bool
_feature
(
HB_TAG
(
'c'
,
'c'
,
'm'
,
'p'
));
map
->
add_global_bool
_feature
(
HB_TAG
(
'l'
,
'o'
,
'c'
,
'l'
));
map
->
enable
_feature
(
HB_TAG
(
'c'
,
'c'
,
'm'
,
'p'
));
map
->
enable
_feature
(
HB_TAG
(
'l'
,
'o'
,
'c'
,
'l'
));
map
->
add_gsub_pause
(
nullptr
);
for
(
unsigned
int
i
=
0
;
i
<
ARABIC_NUM_FEATURES
;
i
++
)
{
bool
has_fallback
=
plan
->
props
.
script
==
HB_SCRIPT_ARABIC
&&
!
FEATURE_IS_SYRIAC
(
arabic_features
[
i
]);
map
->
add_feature
(
arabic_features
[
i
],
1
,
has_fallback
?
F_HAS_FALLBACK
:
F_NONE
);
map
->
add_feature
(
arabic_features
[
i
],
has_fallback
?
F_HAS_FALLBACK
:
F_NONE
);
map
->
add_gsub_pause
(
nullptr
);
}
map
->
add_feature
(
HB_TAG
(
'r'
,
'l'
,
'i'
,
'g'
),
1
,
F_GLOBAL
|
F_HAS_FALLBACK
);
map
->
add_feature
(
HB_TAG
(
'r'
,
'l'
,
'i'
,
'g'
),
F_GLOBAL
|
F_HAS_FALLBACK
);
if
(
plan
->
props
.
script
==
HB_SCRIPT_ARABIC
)
map
->
add_gsub_pause
(
arabic_fallback_shape
);
/* No pause after rclt. See 98460779bae19e4d64d29461ff154b3527bf8420. */
map
->
add_global_bool
_feature
(
HB_TAG
(
'r'
,
'c'
,
'l'
,
't'
));
map
->
add_global_bool
_feature
(
HB_TAG
(
'c'
,
'a'
,
'l'
,
't'
));
map
->
enable
_feature
(
HB_TAG
(
'r'
,
'c'
,
'l'
,
't'
));
map
->
enable
_feature
(
HB_TAG
(
'c'
,
'a'
,
'l'
,
't'
));
map
->
add_gsub_pause
(
nullptr
);
/* The spec includes 'cswh'. Earlier versions of Windows
...
...
@@ -234,8 +234,8 @@ collect_features_arabic (hb_ot_shape_planner_t *plan)
* Note that IranNastaliq uses this feature extensively
* to fixup broken glyph sequences. Oh well...
* Test case: U+0643,U+0640,U+0631. */
//map->
add_global_bool
_feature (HB_TAG('c','s','w','h'));
map
->
add_global_bool
_feature
(
HB_TAG
(
'm'
,
's'
,
'e'
,
't'
));
//map->
enable
_feature (HB_TAG('c','s','w','h'));
map
->
enable
_feature
(
HB_TAG
(
'm'
,
's'
,
'e'
,
't'
));
}
#include "hb-ot-shape-complex-arabic-fallback.hh"
...
...
src/hb-ot-shape-complex-hangul.cc
浏览文件 @
f048ead8
...
...
@@ -56,7 +56,7 @@ collect_features_hangul (hb_ot_shape_planner_t *plan)
hb_ot_map_builder_t
*
map
=
&
plan
->
map
;
for
(
unsigned
int
i
=
FIRST_HANGUL_FEATURE
;
i
<
HANGUL_FEATURE_COUNT
;
i
++
)
map
->
add_feature
(
hangul_features
[
i
]
,
1
,
F_NONE
);
map
->
add_feature
(
hangul_features
[
i
]);
}
static
void
...
...
src/hb-ot-shape-complex-indic.cc
浏览文件 @
f048ead8
...
...
@@ -190,10 +190,10 @@ collect_features_indic (hb_ot_shape_planner_t *plan)
/* Do this before any lookups have been applied. */
map
->
add_gsub_pause
(
setup_syllables
);
map
->
add_global_bool
_feature
(
HB_TAG
(
'l'
,
'o'
,
'c'
,
'l'
));
map
->
enable
_feature
(
HB_TAG
(
'l'
,
'o'
,
'c'
,
'l'
));
/* The Indic specs do not require ccmp, but we apply it here since if
* there is a use of it, it's typically at the beginning. */
map
->
add_global_bool
_feature
(
HB_TAG
(
'c'
,
'c'
,
'm'
,
'p'
));
map
->
enable
_feature
(
HB_TAG
(
'c'
,
'c'
,
'm'
,
'p'
));
unsigned
int
i
=
0
;
...
...
@@ -209,8 +209,8 @@ collect_features_indic (hb_ot_shape_planner_t *plan)
for
(;
i
<
INDIC_NUM_FEATURES
;
i
++
)
map
->
add_feature
(
indic_features
[
i
]);
map
->
add_global_bool
_feature
(
HB_TAG
(
'c'
,
'a'
,
'l'
,
't'
));
map
->
add_global_bool
_feature
(
HB_TAG
(
'c'
,
'l'
,
'i'
,
'g'
));
map
->
enable
_feature
(
HB_TAG
(
'c'
,
'a'
,
'l'
,
't'
));
map
->
enable
_feature
(
HB_TAG
(
'c'
,
'l'
,
'i'
,
'g'
));
map
->
add_gsub_pause
(
clear_syllables
);
}
...
...
src/hb-ot-shape-complex-khmer.cc
浏览文件 @
f048ead8
...
...
@@ -116,8 +116,8 @@ collect_features_khmer (hb_ot_shape_planner_t *plan)
*
* https://github.com/harfbuzz/harfbuzz/issues/974
*/
map
->
add_global_bool
_feature
(
HB_TAG
(
'l'
,
'o'
,
'c'
,
'l'
));
map
->
add_global_bool
_feature
(
HB_TAG
(
'c'
,
'c'
,
'm'
,
'p'
));
map
->
enable
_feature
(
HB_TAG
(
'l'
,
'o'
,
'c'
,
'l'
));
map
->
enable
_feature
(
HB_TAG
(
'c'
,
'c'
,
'm'
,
'p'
));
unsigned
int
i
=
0
;
for
(;
i
<
KHMER_BASIC_FEATURES
;
i
++
)
...
...
@@ -128,8 +128,8 @@ collect_features_khmer (hb_ot_shape_planner_t *plan)
for
(;
i
<
KHMER_NUM_FEATURES
;
i
++
)
map
->
add_feature
(
khmer_features
[
i
]);
map
->
add_global_bool
_feature
(
HB_TAG
(
'c'
,
'a'
,
'l'
,
't'
));
map
->
add_global_bool
_feature
(
HB_TAG
(
'c'
,
'l'
,
'i'
,
'g'
));
map
->
enable
_feature
(
HB_TAG
(
'c'
,
'a'
,
'l'
,
't'
));
map
->
enable
_feature
(
HB_TAG
(
'c'
,
'l'
,
'i'
,
'g'
));
}
...
...
src/hb-ot-shape-complex-myanmar.cc
浏览文件 @
f048ead8
...
...
@@ -96,27 +96,27 @@ collect_features_myanmar (hb_ot_shape_planner_t *plan)
/* Do this before any lookups have been applied. */
map
->
add_gsub_pause
(
setup_syllables
);
map
->
add_global_bool
_feature
(
HB_TAG
(
'l'
,
'o'
,
'c'
,
'l'
));
map
->
enable
_feature
(
HB_TAG
(
'l'
,
'o'
,
'c'
,
'l'
));
/* The Indic specs do not require ccmp, but we apply it here since if
* there is a use of it, it's typically at the beginning. */
map
->
add_global_bool
_feature
(
HB_TAG
(
'c'
,
'c'
,
'm'
,
'p'
));
map
->
enable
_feature
(
HB_TAG
(
'c'
,
'c'
,
'm'
,
'p'
));
map
->
add_gsub_pause
(
initial_reordering
);
for
(
unsigned
int
i
=
0
;
i
<
ARRAY_LENGTH
(
basic_features
);
i
++
)
{
map
->
add_feature
(
basic_features
[
i
],
1
,
F_GLOBAL
|
F_MANUAL_ZWJ
);
map
->
add_feature
(
basic_features
[
i
],
F_GLOBAL
|
F_MANUAL_ZWJ
);
map
->
add_gsub_pause
(
nullptr
);
}
map
->
add_gsub_pause
(
final_reordering
);
for
(
unsigned
int
i
=
0
;
i
<
ARRAY_LENGTH
(
other_features
);
i
++
)
map
->
add_feature
(
other_features
[
i
],
1
,
F_GLOBAL
|
F_MANUAL_ZWJ
);
map
->
add_feature
(
other_features
[
i
],
F_GLOBAL
|
F_MANUAL_ZWJ
);
for
(
unsigned
int
i
=
0
;
i
<
ARRAY_LENGTH
(
positioning_features
);
i
++
)
map
->
add_feature
(
positioning_features
[
i
],
1
,
F_GLOBAL
);
map
->
enable_feature
(
positioning_features
[
i
]
);
}
static
void
...
...
src/hb-ot-shape-complex-tibetan.cc
浏览文件 @
f048ead8
...
...
@@ -40,7 +40,7 @@ static void
collect_features_tibetan
(
hb_ot_shape_planner_t
*
plan
)
{
for
(
const
hb_tag_t
*
script_features
=
tibetan_features
;
script_features
&&
*
script_features
;
script_features
++
)
plan
->
map
.
add_global_bool
_feature
(
*
script_features
);
plan
->
map
.
enable
_feature
(
*
script_features
);
}
...
...
src/hb-ot-shape-complex-use.cc
浏览文件 @
f048ead8
...
...
@@ -129,37 +129,37 @@ collect_features_use (hb_ot_shape_planner_t *plan)
map
->
add_gsub_pause
(
setup_syllables
);
/* "Default glyph pre-processing group" */
map
->
add_global_bool
_feature
(
HB_TAG
(
'l'
,
'o'
,
'c'
,
'l'
));
map
->
add_global_bool
_feature
(
HB_TAG
(
'c'
,
'c'
,
'm'
,
'p'
));
map
->
add_global_bool
_feature
(
HB_TAG
(
'n'
,
'u'
,
'k'
,
't'
));
map
->
add_global_bool
_feature
(
HB_TAG
(
'a'
,
'k'
,
'h'
,
'n'
));
map
->
enable
_feature
(
HB_TAG
(
'l'
,
'o'
,
'c'
,
'l'
));
map
->
enable
_feature
(
HB_TAG
(
'c'
,
'c'
,
'm'
,
'p'
));
map
->
enable
_feature
(
HB_TAG
(
'n'
,
'u'
,
'k'
,
't'
));
map
->
enable
_feature
(
HB_TAG
(
'a'
,
'k'
,
'h'
,
'n'
));
/* "Reordering group" */
map
->
add_gsub_pause
(
clear_substitution_flags
);
map
->
add_feature
(
HB_TAG
(
'r'
,
'p'
,
'h'
,
'f'
),
1
,
F_MANUAL_ZWJ
);
map
->
add_feature
(
HB_TAG
(
'r'
,
'p'
,
'h'
,
'f'
),
F_MANUAL_ZWJ
);
map
->
add_gsub_pause
(
record_rphf
);
map
->
add_gsub_pause
(
clear_substitution_flags
);
map
->
add_feature
(
HB_TAG
(
'p'
,
'r'
,
'e'
,
'f'
),
1
,
F_GLOBAL
|
F_MANUAL_ZWJ
);
map
->
add_feature
(
HB_TAG
(
'p'
,
'r'
,
'e'
,
'f'
),
F_GLOBAL
|
F_MANUAL_ZWJ
);
map
->
add_gsub_pause
(
record_pref
);
/* "Orthographic unit shaping group" */
for
(
unsigned
int
i
=
0
;
i
<
ARRAY_LENGTH
(
basic_features
);
i
++
)
map
->
add_feature
(
basic_features
[
i
],
1
,
F_GLOBAL
|
F_MANUAL_ZWJ
);
map
->
add_feature
(
basic_features
[
i
],
F_GLOBAL
|
F_MANUAL_ZWJ
);
map
->
add_gsub_pause
(
reorder
);
/* "Topographical features" */
for
(
unsigned
int
i
=
0
;
i
<
ARRAY_LENGTH
(
arabic_features
);
i
++
)
map
->
add_feature
(
arabic_features
[
i
]
,
1
,
F_NONE
);
map
->
add_feature
(
arabic_features
[
i
]);
map
->
add_gsub_pause
(
nullptr
);
/* "Standard typographic presentation" */
for
(
unsigned
int
i
=
0
;
i
<
ARRAY_LENGTH
(
other_features
);
i
++
)
map
->
add_feature
(
other_features
[
i
],
1
,
F_GLOBAL
|
F_MANUAL_ZWJ
);
map
->
add_feature
(
other_features
[
i
],
F_GLOBAL
|
F_MANUAL_ZWJ
);
/* "Positional feature application" */
for
(
unsigned
int
i
=
0
;
i
<
ARRAY_LENGTH
(
positioning_features
);
i
++
)
map
->
add_feature
(
positioning_features
[
i
],
1
,
F_GLOBAL
);
map
->
enable_feature
(
positioning_features
[
i
]
);
}
struct
use_shape_plan_t
...
...
src/hb-ot-shape.cc
浏览文件 @
f048ead8
...
...
@@ -71,17 +71,17 @@ hb_ot_shape_collect_features (hb_ot_shape_planner_t *planner,
{
hb_ot_map_builder_t
*
map
=
&
planner
->
map
;
map
->
add_global_bool
_feature
(
HB_TAG
(
'r'
,
'v'
,
'r'
,
'n'
));
map
->
enable
_feature
(
HB_TAG
(
'r'
,
'v'
,
'r'
,
'n'
));
map
->
add_gsub_pause
(
nullptr
);
switch
(
props
->
direction
)
{
case
HB_DIRECTION_LTR
:
map
->
add_global_bool
_feature
(
HB_TAG
(
'l'
,
't'
,
'r'
,
'a'
));
map
->
add_global_bool
_feature
(
HB_TAG
(
'l'
,
't'
,
'r'
,
'm'
));
map
->
enable
_feature
(
HB_TAG
(
'l'
,
't'
,
'r'
,
'a'
));
map
->
enable
_feature
(
HB_TAG
(
'l'
,
't'
,
'r'
,
'm'
));
break
;
case
HB_DIRECTION_RTL
:
map
->
add_global_bool
_feature
(
HB_TAG
(
'r'
,
't'
,
'l'
,
'a'
));
map
->
add_feature
(
HB_TAG
(
'r'
,
't'
,
'l'
,
'm'
)
,
1
,
F_NONE
);
map
->
enable
_feature
(
HB_TAG
(
'r'
,
't'
,
'l'
,
'a'
));
map
->
add_feature
(
HB_TAG
(
'r'
,
't'
,
'l'
,
'm'
));
break
;
case
HB_DIRECTION_TTB
:
case
HB_DIRECTION_BTT
:
...
...
@@ -91,22 +91,22 @@ hb_ot_shape_collect_features (hb_ot_shape_planner_t *planner,
}
/* Automatic fractions. */
map
->
add_feature
(
HB_TAG
(
'f'
,
'r'
,
'a'
,
'c'
)
,
1
,
F_NONE
);
map
->
add_feature
(
HB_TAG
(
'n'
,
'u'
,
'm'
,
'r'
)
,
1
,
F_NONE
);
map
->
add_feature
(
HB_TAG
(
'd'
,
'n'
,
'o'
,
'm'
)
,
1
,
F_NONE
);
map
->
add_feature
(
HB_TAG
(
'f'
,
'r'
,
'a'
,
'c'
));
map
->
add_feature
(
HB_TAG
(
'n'
,
'u'
,
'm'
,
'r'
));
map
->
add_feature
(
HB_TAG
(
'd'
,
'n'
,
'o'
,
'm'
));
/* Random! */
map
->
add_feature
(
HB_TAG
(
'r'
,
'a'
,
'n'
,
'd'
),
HB_OT_MAP_MAX_VALUE
,
F_GLOBAL
|
F_RANDOM
);
map
->
add_feature
(
HB_TAG
(
'r'
,
'a'
,
'n'
,
'd'
),
F_GLOBAL
|
F_RANDOM
,
HB_OT_MAP_MAX_VALUE
);
if
(
planner
->
shaper
->
collect_features
)
planner
->
shaper
->
collect_features
(
planner
);
for
(
unsigned
int
i
=
0
;
i
<
ARRAY_LENGTH
(
common_features
);
i
++
)
map
->
add_global_bool
_feature
(
common_features
[
i
]);
map
->
enable
_feature
(
common_features
[
i
]);
if
(
HB_DIRECTION_IS_HORIZONTAL
(
props
->
direction
))
for
(
unsigned
int
i
=
0
;
i
<
ARRAY_LENGTH
(
horizontal_features
);
i
++
)
map
->
add_feature
(
horizontal_features
[
i
],
1
,
F_GLOBAL
|
map
->
add_feature
(
horizontal_features
[
i
],
F_GLOBAL
|
(
horizontal_features
[
i
]
==
HB_TAG
(
'k'
,
'e'
,
'r'
,
'n'
)
?
F_HAS_FALLBACK
:
F_NONE
));
else
...
...
@@ -115,7 +115,7 @@ hb_ot_shape_collect_features (hb_ot_shape_planner_t *planner,
* matter which script/langsys it is listed (or not) under.
* See various bugs referenced from:
* https://github.com/harfbuzz/harfbuzz/issues/63 */
map
->
add_feature
(
HB_TAG
(
'v'
,
'e'
,
'r'
,
't'
),
1
,
F_GLOBAL
|
F_GLOBAL_SEARCH
);
map
->
add_feature
(
HB_TAG
(
'v'
,
'e'
,
'r'
,
't'
),
F_GLOBAL
|
F_GLOBAL_SEARCH
);
}
if
(
planner
->
shaper
->
override_features
)
...
...
@@ -124,9 +124,9 @@ hb_ot_shape_collect_features (hb_ot_shape_planner_t *planner,
for
(
unsigned
int
i
=
0
;
i
<
num_user_features
;
i
++
)
{
const
hb_feature_t
*
feature
=
&
user_features
[
i
];
map
->
add_feature
(
feature
->
tag
,
feature
->
value
,
(
feature
->
start
==
0
&&
feature
->
end
==
(
unsigned
int
)
-
1
)
?
F_GLOBAL
:
F_NONE
);
map
->
add_feature
(
feature
->
tag
,
(
feature
->
start
==
0
&&
feature
->
end
==
(
unsigned
int
)
-
1
)
?
F_GLOBAL
:
F_NONE
,
feature
->
value
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录