Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
6fddf2d7
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,发现更多精彩内容 >>
提交
6fddf2d7
编写于
11月 12, 2012
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Refactoring ot-map building to make chosen script available earlier
上级
f17ed811
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
40 addition
and
28 deletion
+40
-28
src/hb-ot-map-private.hh
src/hb-ot-map-private.hh
+9
-4
src/hb-ot-map.cc
src/hb-ot-map.cc
+29
-22
src/hb-ot-shape-private.hh
src/hb-ot-shape-private.hh
+2
-2
未找到文件。
src/hb-ot-map-private.hh
浏览文件 @
6fddf2d7
...
...
@@ -151,7 +151,8 @@ struct hb_ot_map_builder_t
{
public:
hb_ot_map_builder_t
(
void
)
{
memset
(
this
,
0
,
sizeof
(
*
this
));
}
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
);
...
...
@@ -163,9 +164,7 @@ struct hb_ot_map_builder_t
inline
void
add_gpos_pause
(
hb_ot_map_t
::
pause_func_t
pause_func
)
{
add_pause
(
1
,
pause_func
);
}
HB_INTERNAL
void
compile
(
hb_face_t
*
face
,
const
hb_segment_properties_t
*
props
,
struct
hb_ot_map_t
&
m
);
HB_INTERNAL
void
compile
(
struct
hb_ot_map_t
&
m
);
inline
void
finish
(
void
)
{
feature_infos
.
finish
();
...
...
@@ -195,6 +194,12 @@ struct hb_ot_map_builder_t
HB_INTERNAL
void
add_pause
(
unsigned
int
table_index
,
hb_ot_map_t
::
pause_func_t
pause_func
);
hb_face_t
*
face
;
hb_segment_properties_t
props
;
hb_tag_t
chosen_script
[
2
];
unsigned
int
script_index
[
2
],
language_index
[
2
];
unsigned
int
current_stage
[
2
];
/* GSUB/GPOS */
hb_prealloced_array_t
<
feature_info_t
,
16
>
feature_infos
;
hb_prealloced_array_t
<
pause_info_t
,
1
>
pauses
[
2
];
/* GSUB/GPOS */
...
...
src/hb-ot-map.cc
浏览文件 @
6fddf2d7
...
...
@@ -59,6 +59,30 @@ hb_ot_map_t::add_lookups (hb_face_t *face,
}
while
(
len
==
ARRAY_LENGTH
(
lookup_indices
));
}
hb_ot_map_builder_t
::
hb_ot_map_builder_t
(
hb_face_t
*
face_
,
const
hb_segment_properties_t
*
props_
)
{
memset
(
this
,
0
,
sizeof
(
*
this
));
face
=
face_
;
props
=
*
props_
;
/* Fetch script/language indices for GSUB/GPOS. We need these later to skip
* features not available in either table and not waste precious bits for them. */
hb_tag_t
script_tags
[
3
]
=
{
HB_TAG_NONE
,
HB_TAG_NONE
,
HB_TAG_NONE
};
hb_tag_t
language_tag
;
hb_ot_tags_from_script
(
props
.
script
,
&
script_tags
[
0
],
&
script_tags
[
1
]);
language_tag
=
hb_ot_tag_from_language
(
props
.
language
);
for
(
unsigned
int
table_index
=
0
;
table_index
<
2
;
table_index
++
)
{
hb_tag_t
table_tag
=
table_tags
[
table_index
];
hb_ot_layout_table_choose_script
(
face
,
table_tag
,
script_tags
,
&
script_index
[
table_index
],
&
chosen_script
[
table_index
]);
hb_ot_layout_script_find_language
(
face
,
table_tag
,
script_index
[
table_index
],
language_tag
,
&
language_index
[
table_index
]);
}
}
void
hb_ot_map_builder_t
::
add_feature
(
hb_tag_t
tag
,
unsigned
int
value
,
bool
global
,
bool
has_fallback
)
{
...
...
@@ -133,33 +157,16 @@ void hb_ot_map_builder_t::add_pause (unsigned int table_index, hb_ot_map_t::paus
}
void
hb_ot_map_builder_t
::
compile
(
hb_face_t
*
face
,
const
hb_segment_properties_t
*
props
,
hb_ot_map_t
&
m
)
hb_ot_map_builder_t
::
compile
(
hb_ot_map_t
&
m
)
{
m
.
global_mask
=
1
;
m
.
global_mask
=
1
;
for
(
unsigned
int
table_index
=
0
;
table_index
<
2
;
table_index
++
)
m
.
chosen_script
[
table_index
]
=
chosen_script
[
table_index
];
if
(
!
feature_infos
.
len
)
return
;
/* Fetch script/language indices for GSUB/GPOS. We need these later to skip
* features not available in either table and not waste precious bits for them. */
hb_tag_t
script_tags
[
3
]
=
{
HB_TAG_NONE
};
hb_tag_t
language_tag
;
hb_ot_tags_from_script
(
props
->
script
,
&
script_tags
[
0
],
&
script_tags
[
1
]);
language_tag
=
hb_ot_tag_from_language
(
props
->
language
);
unsigned
int
script_index
[
2
],
language_index
[
2
];
for
(
unsigned
int
table_index
=
0
;
table_index
<
2
;
table_index
++
)
{
hb_tag_t
table_tag
=
table_tags
[
table_index
];
hb_ot_layout_table_choose_script
(
face
,
table_tag
,
script_tags
,
&
script_index
[
table_index
],
&
m
.
chosen_script
[
table_index
]);
hb_ot_layout_script_find_language
(
face
,
table_tag
,
script_index
[
table_index
],
language_tag
,
&
language_index
[
table_index
]);
}
/* Sort features and merge duplicates */
{
feature_infos
.
sort
();
...
...
src/hb-ot-shape-private.hh
浏览文件 @
6fddf2d7
...
...
@@ -65,14 +65,14 @@ struct hb_ot_shape_planner_t
face
(
master_plan
->
face
),
props
(
master_plan
->
props
),
shaper
(
NULL
),
map
()
{}
map
(
face
,
&
props
)
{}
~
hb_ot_shape_planner_t
(
void
)
{
map
.
finish
();
}
inline
void
compile
(
hb_ot_shape_plan_t
&
plan
)
{
plan
.
props
=
props
;
plan
.
shaper
=
shaper
;
map
.
compile
(
face
,
&
props
,
plan
.
map
);
map
.
compile
(
plan
.
map
);
}
private:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录