Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
ec544866
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,发现更多精彩内容 >>
提交
ec544866
编写于
2月 14, 2013
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add hb_ot_map_feature_flags_t
Code cleanup. No (intended) functional change.
上级
e7ffcfaf
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
74 addition
and
50 deletion
+74
-50
src/hb-ot-map-private.hh
src/hb-ot-map-private.hh
+25
-4
src/hb-ot-map.cc
src/hb-ot-map.cc
+12
-12
src/hb-ot-shape-complex-arabic.cc
src/hb-ot-shape-complex-arabic.cc
+2
-2
src/hb-ot-shape-complex-indic.cc
src/hb-ot-shape-complex-indic.cc
+28
-27
src/hb-ot-shape-complex-myanmar.cc
src/hb-ot-shape-complex-myanmar.cc
+2
-2
src/hb-ot-shape-complex-sea.cc
src/hb-ot-shape-complex-sea.cc
+1
-1
src/hb-ot-shape.cc
src/hb-ot-shape.cc
+4
-2
未找到文件。
src/hb-ot-map-private.hh
浏览文件 @
ec544866
...
...
@@ -145,6 +145,27 @@ struct hb_ot_map_t
hb_prealloced_array_t
<
pause_map_t
,
1
>
pauses
[
2
];
/* GSUB/GPOS */
};
enum
hb_ot_map_feature_flags_t
{
F_NONE
=
0x0000
,
F_GLOBAL
=
0x0001
,
F_HAS_FALLBACK
=
0x0002
};
inline
hb_ot_map_feature_flags_t
operator
|
(
hb_ot_map_feature_flags_t
l
,
hb_ot_map_feature_flags_t
r
)
{
return
hb_ot_map_feature_flags_t
((
unsigned
int
)
l
|
(
unsigned
int
)
r
);
}
inline
hb_ot_map_feature_flags_t
operator
&
(
hb_ot_map_feature_flags_t
l
,
hb_ot_map_feature_flags_t
r
)
{
return
hb_ot_map_feature_flags_t
((
unsigned
int
)
l
&
(
unsigned
int
)
r
);
}
inline
hb_ot_map_feature_flags_t
operator
~
(
hb_ot_map_feature_flags_t
r
)
{
return
hb_ot_map_feature_flags_t
(
~
(
unsigned
int
)
r
);
}
inline
hb_ot_map_feature_flags_t
&
operator
|=
(
hb_ot_map_feature_flags_t
&
l
,
hb_ot_map_feature_flags_t
r
)
{
l
=
l
|
r
;
return
l
;
}
inline
hb_ot_map_feature_flags_t
&
operator
&=
(
hb_ot_map_feature_flags_t
&
l
,
hb_ot_map_feature_flags_t
r
)
{
l
=
l
&
r
;
return
l
;
}
struct
hb_ot_map_builder_t
{
...
...
@@ -153,10 +174,11 @@ struct hb_ot_map_builder_t
HB_INTERNAL
hb_ot_map_builder_t
(
hb_face_t
*
face_
,
const
hb_segment_properties_t
*
props_
);
HB_INTERNAL
void
add_feature
(
hb_tag_t
tag
,
unsigned
int
value
,
bool
global
,
bool
has_fallback
=
false
);
HB_INTERNAL
void
add_feature
(
hb_tag_t
tag
,
unsigned
int
value
,
hb_ot_map_feature_flags_t
flags
);
inline
void
add_global_bool_feature
(
hb_tag_t
tag
)
{
add_feature
(
tag
,
1
,
true
,
false
);
}
{
add_feature
(
tag
,
1
,
F_GLOBAL
);
}
inline
void
add_gsub_pause
(
hb_ot_map_t
::
pause_func_t
pause_func
)
{
add_pause
(
0
,
pause_func
);
}
...
...
@@ -177,8 +199,7 @@ struct hb_ot_map_builder_t
hb_tag_t
tag
;
unsigned
int
seq
;
/* sequence#, used for stable sorting only */
unsigned
int
max_value
;
bool
global
;
/* whether the feature applies value to every glyph in the buffer */
bool
has_fallback
;
/* whether to allocate bits even if feature not found */
hb_ot_map_feature_flags_t
flags
;
unsigned
int
default_value
;
/* for non-global features, what should the unset glyphs take */
unsigned
int
stage
[
2
];
/* GSUB/GPOS */
...
...
src/hb-ot-map.cc
浏览文件 @
ec544866
...
...
@@ -84,16 +84,16 @@ hb_ot_map_builder_t::hb_ot_map_builder_t (hb_face_t *face_,
}
}
void
hb_ot_map_builder_t
::
add_feature
(
hb_tag_t
tag
,
unsigned
int
value
,
bool
global
,
bool
has_fallback
)
void
hb_ot_map_builder_t
::
add_feature
(
hb_tag_t
tag
,
unsigned
int
value
,
hb_ot_map_feature_flags_t
flags
)
{
feature_info_t
*
info
=
feature_infos
.
push
();
if
(
unlikely
(
!
info
))
return
;
info
->
tag
=
tag
;
info
->
seq
=
feature_infos
.
len
;
info
->
max_value
=
value
;
info
->
global
=
global
;
info
->
has_fallback
=
has_fallback
;
info
->
default_value
=
global
?
value
:
0
;
info
->
flags
=
flags
;
info
->
default_value
=
(
flags
&
F_GLOBAL
)
?
value
:
0
;
info
->
stage
[
0
]
=
current_stage
[
0
];
info
->
stage
[
1
]
=
current_stage
[
1
];
}
...
...
@@ -176,15 +176,15 @@ hb_ot_map_builder_t::compile (hb_ot_map_t &m)
if
(
feature_infos
[
i
].
tag
!=
feature_infos
[
j
].
tag
)
feature_infos
[
++
j
]
=
feature_infos
[
i
];
else
{
if
(
feature_infos
[
i
].
global
)
{
feature_infos
[
j
].
global
=
true
;
if
(
feature_infos
[
i
].
flags
&
F_GLOBAL
)
{
feature_infos
[
j
].
flags
|=
F_GLOBAL
;
feature_infos
[
j
].
max_value
=
feature_infos
[
i
].
max_value
;
feature_infos
[
j
].
default_value
=
feature_infos
[
i
].
default_value
;
}
else
{
feature_infos
[
j
].
global
=
false
;
feature_infos
[
j
].
flags
&=
~
F_GLOBAL
;
feature_infos
[
j
].
max_value
=
MAX
(
feature_infos
[
j
].
max_value
,
feature_infos
[
i
].
max_value
);
}
feature_infos
[
j
].
has_fallback
=
feature_infos
[
j
].
has_fallback
||
feature_infos
[
i
].
has_fallback
;
feature_infos
[
j
].
flags
|=
(
feature_infos
[
i
].
flags
&
F_HAS_FALLBACK
)
;
feature_infos
[
j
].
stage
[
0
]
=
MIN
(
feature_infos
[
j
].
stage
[
0
],
feature_infos
[
i
].
stage
[
0
]);
feature_infos
[
j
].
stage
[
1
]
=
MIN
(
feature_infos
[
j
].
stage
[
1
],
feature_infos
[
i
].
stage
[
1
]);
/* Inherit default_value from j */
...
...
@@ -200,7 +200,7 @@ hb_ot_map_builder_t::compile (hb_ot_map_t &m)
unsigned
int
bits_needed
;
if
(
info
->
global
&&
info
->
max_value
==
1
)
if
(
(
info
->
flags
&
F_GLOBAL
)
&&
info
->
max_value
==
1
)
/* Uses the global bit */
bits_needed
=
0
;
else
...
...
@@ -219,7 +219,7 @@ hb_ot_map_builder_t::compile (hb_ot_map_t &m)
language_index
[
table_index
],
info
->
tag
,
&
feature_index
[
table_index
]);
if
(
!
found
&&
!
info
->
has_fallback
)
if
(
!
found
&&
!
(
info
->
flags
&
F_HAS_FALLBACK
)
)
continue
;
...
...
@@ -232,7 +232,7 @@ hb_ot_map_builder_t::compile (hb_ot_map_t &m)
map
->
index
[
1
]
=
feature_index
[
1
];
map
->
stage
[
0
]
=
info
->
stage
[
0
];
map
->
stage
[
1
]
=
info
->
stage
[
1
];
if
(
info
->
global
&&
info
->
max_value
==
1
)
{
if
(
(
info
->
flags
&
F_GLOBAL
)
&&
info
->
max_value
==
1
)
{
/* Uses the global bit */
map
->
shift
=
0
;
map
->
mask
=
1
;
...
...
@@ -240,7 +240,7 @@ hb_ot_map_builder_t::compile (hb_ot_map_t &m)
map
->
shift
=
next_bit
;
map
->
mask
=
(
1
<<
(
next_bit
+
bits_needed
))
-
(
1
<<
next_bit
);
next_bit
+=
bits_needed
;
if
(
info
->
global
)
if
(
(
info
->
flags
&
F_GLOBAL
)
)
m
.
global_mask
|=
(
info
->
default_value
<<
map
->
shift
)
&
map
->
mask
;
}
map
->
_1_mask
=
(
1
<<
map
->
shift
)
&
map
->
mask
;
...
...
src/hb-ot-shape-complex-arabic.cc
浏览文件 @
ec544866
...
...
@@ -184,11 +184,11 @@ collect_features_arabic (hb_ot_shape_planner_t *plan)
map
->
add_gsub_pause
(
NULL
);
for
(
unsigned
int
i
=
0
;
i
<
ARABIC_NUM_FEATURES
;
i
++
)
map
->
add_feature
(
arabic_features
[
i
],
1
,
false
,
i
<
4
);
/* The first four features have fallback. */
map
->
add_feature
(
arabic_features
[
i
],
1
,
i
<
4
?
F_HAS_FALLBACK
:
F_NONE
);
/* The first four features have fallback. */
map
->
add_gsub_pause
(
NULL
);
map
->
add_feature
(
HB_TAG
(
'r'
,
'l'
,
'i'
,
'g'
),
1
,
true
,
true
);
map
->
add_feature
(
HB_TAG
(
'r'
,
'l'
,
'i'
,
'g'
),
1
,
F_GLOBAL
|
F_HAS_FALLBACK
);
map
->
add_gsub_pause
(
arabic_fallback_shape
);
map
->
add_global_bool_feature
(
HB_TAG
(
'c'
,
'a'
,
'l'
,
't'
));
...
...
src/hb-ot-shape-complex-indic.cc
浏览文件 @
ec544866
...
...
@@ -329,7 +329,7 @@ static const indic_config_t indic_configs[] =
struct
feature_list_t
{
hb_tag_t
tag
;
hb_
bool_t
is_global
;
hb_
ot_map_feature_flags_t
flags
;
};
static
const
feature_list_t
...
...
@@ -339,32 +339,32 @@ indic_features[] =
* Basic features.
* These features are applied in order, one at a time, after initial_reordering.
*/
{
HB_TAG
(
'n'
,
'u'
,
'k'
,
't'
),
true
},
{
HB_TAG
(
'a'
,
'k'
,
'h'
,
'n'
),
true
},
{
HB_TAG
(
'r'
,
'p'
,
'h'
,
'f'
),
false
},
{
HB_TAG
(
'r'
,
'k'
,
'r'
,
'f'
),
true
},
{
HB_TAG
(
'p'
,
'r'
,
'e'
,
'f'
),
false
},
{
HB_TAG
(
'b'
,
'l'
,
'w'
,
'f'
),
false
},
{
HB_TAG
(
'h'
,
'a'
,
'l'
,
'f'
),
false
},
{
HB_TAG
(
'a'
,
'b'
,
'v'
,
'f'
),
false
},
{
HB_TAG
(
'p'
,
's'
,
't'
,
'f'
),
false
},
{
HB_TAG
(
'c'
,
'f'
,
'a'
,
'r'
),
false
},
{
HB_TAG
(
'v'
,
'a'
,
't'
,
'u'
),
true
},
{
HB_TAG
(
'c'
,
'j'
,
'c'
,
't'
),
true
},
{
HB_TAG
(
'n'
,
'u'
,
'k'
,
't'
),
F_GLOBAL
},
{
HB_TAG
(
'a'
,
'k'
,
'h'
,
'n'
),
F_GLOBAL
},
{
HB_TAG
(
'r'
,
'p'
,
'h'
,
'f'
),
F_NONE
},
{
HB_TAG
(
'r'
,
'k'
,
'r'
,
'f'
),
F_GLOBAL
},
{
HB_TAG
(
'p'
,
'r'
,
'e'
,
'f'
),
F_NONE
},
{
HB_TAG
(
'b'
,
'l'
,
'w'
,
'f'
),
F_NONE
},
{
HB_TAG
(
'h'
,
'a'
,
'l'
,
'f'
),
F_NONE
},
{
HB_TAG
(
'a'
,
'b'
,
'v'
,
'f'
),
F_NONE
},
{
HB_TAG
(
'p'
,
's'
,
't'
,
'f'
),
F_NONE
},
{
HB_TAG
(
'c'
,
'f'
,
'a'
,
'r'
),
F_NONE
},
{
HB_TAG
(
'v'
,
'a'
,
't'
,
'u'
),
F_GLOBAL
},
{
HB_TAG
(
'c'
,
'j'
,
'c'
,
't'
),
F_GLOBAL
},
/*
* Other features.
* These features are applied all at once, after final_reordering.
*/
{
HB_TAG
(
'i'
,
'n'
,
'i'
,
't'
),
false
},
{
HB_TAG
(
'p'
,
'r'
,
'e'
,
's'
),
true
},
{
HB_TAG
(
'a'
,
'b'
,
'v'
,
's'
),
true
},
{
HB_TAG
(
'b'
,
'l'
,
'w'
,
's'
),
true
},
{
HB_TAG
(
'p'
,
's'
,
't'
,
's'
),
true
},
{
HB_TAG
(
'h'
,
'a'
,
'l'
,
'n'
),
true
},
{
HB_TAG
(
'i'
,
'n'
,
'i'
,
't'
),
F_NONE
},
{
HB_TAG
(
'p'
,
'r'
,
'e'
,
's'
),
F_GLOBAL
},
{
HB_TAG
(
'a'
,
'b'
,
'v'
,
's'
),
F_GLOBAL
},
{
HB_TAG
(
'b'
,
'l'
,
'w'
,
's'
),
F_GLOBAL
},
{
HB_TAG
(
'p'
,
's'
,
't'
,
's'
),
F_GLOBAL
},
{
HB_TAG
(
'h'
,
'a'
,
'l'
,
'n'
),
F_GLOBAL
},
/* Positioning features, though we don't care about the types. */
{
HB_TAG
(
'd'
,
'i'
,
's'
,
't'
),
true
},
{
HB_TAG
(
'a'
,
'b'
,
'v'
,
'm'
),
true
},
{
HB_TAG
(
'b'
,
'l'
,
'w'
,
'm'
),
true
},
{
HB_TAG
(
'd'
,
'i'
,
's'
,
't'
),
F_GLOBAL
},
{
HB_TAG
(
'a'
,
'b'
,
'v'
,
'm'
),
F_GLOBAL
},
{
HB_TAG
(
'b'
,
'l'
,
'w'
,
'm'
),
F_GLOBAL
},
};
/*
...
...
@@ -428,12 +428,12 @@ collect_features_indic (hb_ot_shape_planner_t *plan)
unsigned
int
i
=
0
;
map
->
add_gsub_pause
(
initial_reordering
);
for
(;
i
<
INDIC_BASIC_FEATURES
;
i
++
)
{
map
->
add_feature
(
indic_features
[
i
].
tag
,
1
,
indic_features
[
i
].
is_global
);
map
->
add_feature
(
indic_features
[
i
].
tag
,
1
,
indic_features
[
i
].
flags
);
map
->
add_gsub_pause
(
NULL
);
}
map
->
add_gsub_pause
(
final_reordering
);
for
(;
i
<
INDIC_NUM_FEATURES
;
i
++
)
{
map
->
add_feature
(
indic_features
[
i
].
tag
,
1
,
indic_features
[
i
].
is_global
);
map
->
add_feature
(
indic_features
[
i
].
tag
,
1
,
indic_features
[
i
].
flags
);
}
}
...
...
@@ -442,9 +442,9 @@ override_features_indic (hb_ot_shape_planner_t *plan)
{
/* Uniscribe does not apply 'kern'. */
if
(
hb_options
().
uniscribe_bug_compatible
)
plan
->
map
.
add_feature
(
HB_TAG
(
'k'
,
'e'
,
'r'
,
'n'
),
0
,
true
);
plan
->
map
.
add_feature
(
HB_TAG
(
'k'
,
'e'
,
'r'
,
'n'
),
0
,
F_GLOBAL
);
plan
->
map
.
add_feature
(
HB_TAG
(
'l'
,
'i'
,
'g'
,
'a'
),
0
,
true
);
plan
->
map
.
add_feature
(
HB_TAG
(
'l'
,
'i'
,
'g'
,
'a'
),
0
,
F_GLOBAL
);
}
...
...
@@ -532,7 +532,8 @@ data_create_indic (const hb_ot_shape_plan_t *plan)
indic_plan
->
pstf
.
init
(
&
plan
->
map
,
HB_TAG
(
'p'
,
's'
,
't'
,
'f'
));
for
(
unsigned
int
i
=
0
;
i
<
ARRAY_LENGTH
(
indic_plan
->
mask_array
);
i
++
)
indic_plan
->
mask_array
[
i
]
=
indic_features
[
i
].
is_global
?
0
:
plan
->
map
.
get_1_mask
(
indic_features
[
i
].
tag
);
indic_plan
->
mask_array
[
i
]
=
(
indic_features
[
i
].
flags
&
F_GLOBAL
)
?
0
:
plan
->
map
.
get_1_mask
(
indic_features
[
i
].
tag
);
return
indic_plan
;
}
...
...
src/hb-ot-shape-complex-myanmar.cc
浏览文件 @
ec544866
...
...
@@ -119,7 +119,7 @@ collect_features_myanmar (hb_ot_shape_planner_t *plan)
static
void
override_features_myanmar
(
hb_ot_shape_planner_t
*
plan
)
{
plan
->
map
.
add_feature
(
HB_TAG
(
'l'
,
'i'
,
'g'
,
'a'
),
0
,
true
);
plan
->
map
.
add_feature
(
HB_TAG
(
'l'
,
'i'
,
'g'
,
'a'
),
0
,
F_GLOBAL
);
/*
* Note:
...
...
@@ -130,7 +130,7 @@ override_features_myanmar (hb_ot_shape_planner_t *plan)
* 'mkmk' however.
*/
if
(
hb_options
().
uniscribe_bug_compatible
)
plan
->
map
.
add_feature
(
HB_TAG
(
'm'
,
'a'
,
'r'
,
'k'
),
0
,
true
);
plan
->
map
.
add_feature
(
HB_TAG
(
'm'
,
'a'
,
'r'
,
'k'
),
0
,
F_GLOBAL
);
}
...
...
src/hb-ot-shape-complex-sea.cc
浏览文件 @
ec544866
...
...
@@ -121,7 +121,7 @@ collect_features_sea (hb_ot_shape_planner_t *plan)
static
void
override_features_sea
(
hb_ot_shape_planner_t
*
plan
)
{
plan
->
map
.
add_feature
(
HB_TAG
(
'l'
,
'i'
,
'g'
,
'a'
),
0
,
true
);
plan
->
map
.
add_feature
(
HB_TAG
(
'l'
,
'i'
,
'g'
,
'a'
),
0
,
F_GLOBAL
);
}
...
...
src/hb-ot-shape.cc
浏览文件 @
ec544866
...
...
@@ -88,7 +88,7 @@ hb_ot_shape_collect_features (hb_ot_shape_planner_t *planner,
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
,
false
);
map
->
add_feature
(
HB_TAG
(
'r'
,
't'
,
'l'
,
'm'
),
1
,
F_NONE
);
break
;
case
HB_DIRECTION_TTB
:
case
HB_DIRECTION_BTT
:
...
...
@@ -120,7 +120,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
));
map
->
add_feature
(
feature
->
tag
,
feature
->
value
,
(
feature
->
start
==
0
&&
feature
->
end
==
(
unsigned
int
)
-
1
)
?
F_GLOBAL
:
F_NONE
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录