Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
4febed61
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看板
提交
4febed61
编写于
7月 21, 2015
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[USE] Set up features
上级
52a95779
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
38 addition
and
30 deletion
+38
-30
src/hb-ot-shape-complex-use.cc
src/hb-ot-shape-complex-use.cc
+38
-30
未找到文件。
src/hb-ot-shape-complex-use.cc
浏览文件 @
4febed61
...
...
@@ -42,26 +42,32 @@ basic_features[] =
{
/*
* Basic features.
* These features are applied
in order, one at a time, after initial_
reordering.
* These features are applied
all at once, before
reordering.
*/
HB_TAG
(
'
p'
,
'r'
,
'e
'
,
'f'
),
HB_TAG
(
'
r'
,
'k'
,
'r
'
,
'f'
),
HB_TAG
(
'a'
,
'b'
,
'v'
,
'f'
),
HB_TAG
(
'b'
,
'l'
,
'w'
,
'f'
),
HB_TAG
(
'h'
,
'a'
,
'l'
,
'f'
),
HB_TAG
(
'p'
,
's'
,
't'
,
'f'
),
HB_TAG
(
'v'
,
'a'
,
't'
,
'u'
),
HB_TAG
(
'c'
,
'j'
,
'c'
,
't'
),
};
static
const
hb_tag_t
other_features
[]
=
{
/*
* Other features.
* These features are applied all at once, after
final_
reordering.
* These features are applied all at once, after reordering.
*/
HB_TAG
(
'p'
,
'r'
,
'e'
,
's'
),
HB_TAG
(
'a'
,
'b'
,
'v'
,
's'
),
HB_TAG
(
'b'
,
'l'
,
'w'
,
's'
),
HB_TAG
(
'h'
,
'a'
,
'l'
,
'n'
),
HB_TAG
(
'p'
,
'r'
,
'e'
,
's'
),
HB_TAG
(
'p'
,
's'
,
't'
,
's'
),
/* Positioning features, though we don't care about the types. */
HB_TAG
(
'd'
,
'i'
,
's'
,
't'
),
HB_TAG
(
'a'
,
'b'
,
'v'
,
'm'
),
HB_TAG
(
'b'
,
'l'
,
'w'
,
'm'
),
};
static
void
...
...
@@ -69,9 +75,9 @@ setup_syllables (const hb_ot_shape_plan_t *plan,
hb_font_t
*
font
,
hb_buffer_t
*
buffer
);
static
void
reorder
ing
(
const
hb_ot_shape_plan_t
*
plan
,
hb_font_t
*
font
,
hb_buffer_t
*
buffer
);
reorder
(
const
hb_ot_shape_plan_t
*
plan
,
hb_font_t
*
font
,
hb_buffer_t
*
buffer
);
static
void
collect_features_use
(
hb_ot_shape_planner_t
*
plan
)
...
...
@@ -81,27 +87,33 @@ collect_features_use (hb_ot_shape_planner_t *plan)
/* Do this before any lookups have been applied. */
map
->
add_gsub_pause
(
setup_syllables
);
/* "Default glyph pre-processing group" */
map
->
add_global_bool_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
->
add_global_bool_feature
(
HB_TAG
(
'n'
,
'u'
,
'k'
,
't'
));
map
->
add_global_bool_feature
(
HB_TAG
(
'a'
,
'k'
,
'h'
,
'n'
));
/* "Reordering group" */
map
->
add_gsub_pause
(
NULL
);
map
->
add_feature
(
HB_TAG
(
'r'
,
'p'
,
'h'
,
'f'
),
1
,
F_GLOBAL
|
F_MANUAL_ZWJ
);
map
->
add_gsub_pause
(
NULL
);
map
->
add_feature
(
HB_TAG
(
'p'
,
'r'
,
'e'
,
'f'
),
1
,
F_GLOBAL
|
F_MANUAL_ZWJ
);
map
->
add_gsub_pause
(
NULL
);
/* "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_gsub_pause
(
NULL
);
}
map
->
add_gsub_pause
(
reordering
);
map
->
add_gsub_pause
(
reorder
);
/* "Topographical features" */
// TODO isol/init/medi/fina
/* "Standard typographic presentation" and "Positional feature application" */
for
(
unsigned
int
i
=
0
;
i
<
ARRAY_LENGTH
(
other_features
);
i
++
)
map
->
add_feature
(
other_features
[
i
],
1
,
F_GLOBAL
|
F_MANUAL_ZWJ
);
}
static
void
override_features_use
(
hb_ot_shape_planner_t
*
plan
)
{
plan
->
map
.
add_feature
(
HB_TAG
(
'l'
,
'i'
,
'g'
,
'a'
),
0
,
F_GLOBAL
);
}
enum
syllable_type_t
{
independent_cluster
,
...
...
@@ -248,14 +260,10 @@ insert_dotted_circles (const hb_ot_shape_plan_t *plan HB_UNUSED,
return;
hb_codepoint_t dottedcircle_glyph;
if (!font->get_glyph (0x25CCu, 0, &dottedcircle_glyph))
return;
hb_glyph_info_t dottedcircle = {0};
dottedcircle.codepoint = 0x25CCu;
set_use_properties (dottedcircle)
;
dottedcircle.
codepoint = dottedcircle_glyph
;
if (!font->get_glyph (0x25CCu, 0, &dottedcircle.codepoint))
return
;
dottedcircle.
use_category() = hb_use_get_categories (0x25CC)
;
buffer->clear_output ();
...
...
@@ -285,9 +293,9 @@ insert_dotted_circles (const hb_ot_shape_plan_t *plan HB_UNUSED,
}
static
void
reorder
ing
(
const
hb_ot_shape_plan_t
*
plan
,
hb_font_t
*
font
,
hb_buffer_t
*
buffer
)
reorder
(
const
hb_ot_shape_plan_t
*
plan
,
hb_font_t
*
font
,
hb_buffer_t
*
buffer
)
{
insert_dotted_circles
(
plan
,
font
,
buffer
);
...
...
@@ -316,7 +324,7 @@ const hb_ot_complex_shaper_t _hb_ot_complex_shaper_use =
{
"use"
,
collect_features_use
,
override_features_use
,
NULL
,
/* override_features */
NULL
,
/* data_create */
NULL
,
/* data_destroy */
NULL
,
/* preprocess_text */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录