Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
809c5870
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看板
提交
809c5870
编写于
5月 13, 2019
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[config] Better compile away morx/kerx/trak
Part of
https://github.com/harfbuzz/harfbuzz/issues/1652
上级
b1d3e54b
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
25 addition
and
25 deletion
+25
-25
src/hb-ot-shape.cc
src/hb-ot-shape.cc
+14
-24
src/hb-ot-shape.hh
src/hb-ot-shape.hh
+11
-1
未找到文件。
src/hb-ot-shape.cc
浏览文件 @
809c5870
...
...
@@ -55,13 +55,9 @@ hb_ot_shape_collect_features (hb_ot_shape_planner_t *planner,
const
hb_feature_t
*
user_features
,
unsigned
int
num_user_features
);
static
bool
static
inline
bool
_hb_apply_morx
(
hb_face_t
*
face
)
{
#ifdef HB_NO_SHAPE_AAT
return
false
;
#endif
if
(
hb_options
().
aat
&&
hb_aat_layout_has_substitution
(
face
))
return
true
;
...
...
@@ -79,18 +75,18 @@ hb_ot_shape_planner_t::hb_ot_shape_planner_t (hb_face_t *fac
face
(
face
),
props
(
*
props
),
map
(
face
,
props
),
aat_map
(
face
,
props
),
apply_morx
(
_hb_apply_morx
(
face
))
aat_map
(
face
,
props
)
#ifndef HB_NO_SHAPE_AAT
,
apply_morx
(
_hb_apply_morx
(
face
))
#endif
{
shaper
=
hb_ot_shape_complex_categorize
(
this
);
script_zero_marks
=
shaper
->
zero_width_marks
!=
HB_OT_SHAPE_ZERO_WIDTH_MARKS_NONE
;
script_fallback_mark_positioning
=
shaper
->
fallback_position
;
#ifndef HB_NO_SHAPE_AAT
if
(
apply_morx
)
shaper
=
&
_hb_ot_complex_shaper_default
;
#endif
}
void
...
...
@@ -100,10 +96,8 @@ hb_ot_shape_planner_t::compile (hb_ot_shape_plan_t &plan,
plan
.
props
=
props
;
plan
.
shaper
=
shaper
;
map
.
compile
(
plan
.
map
,
key
);
#ifndef HB_NO_SHAPE_AAT
if
(
apply_morx
)
aat_map
.
compile
(
plan
.
aat_map
);
#endif
plan
.
frac_mask
=
plan
.
map
.
get_1_mask
(
HB_TAG
(
'f'
,
'r'
,
'a'
,
'c'
));
plan
.
numr_mask
=
plan
.
map
.
get_1_mask
(
HB_TAG
(
'n'
,
'u'
,
'm'
,
'r'
));
...
...
@@ -132,7 +126,9 @@ hb_ot_shape_planner_t::compile (hb_ot_shape_plan_t &plan,
* Decide who does substitutions. GSUB, morx, or fallback.
*/
#ifndef HB_NO_SHAPE_AAT
plan
.
apply_morx
=
apply_morx
;
#endif
/*
* Decide who does positioning. GPOS, kerx, kern, or fallback.
...
...
@@ -154,8 +150,12 @@ hb_ot_shape_planner_t::compile (hb_ot_shape_plan_t &plan,
if
(
!
plan
.
apply_kerx
&&
!
has_gpos_kern
)
{
/* Apparently Apple applies kerx if GPOS kern was not applied. */
if
(
hb_aat_layout_has_positioning
(
face
))
if
(
0
)
;
#ifndef HB_NO_SHAPE_AAT
else
if
(
hb_aat_layout_has_positioning
(
face
))
plan
.
apply_kerx
=
true
;
#endif
else
if
(
hb_ot_layout_has_kerning
(
face
))
plan
.
apply_kern
=
true
;
}
...
...
@@ -172,8 +172,10 @@ hb_ot_shape_planner_t::compile (hb_ot_shape_plan_t &plan,
plan
.
fallback_mark_positioning
=
plan
.
adjust_mark_positioning_when_zeroing
&&
script_fallback_mark_positioning
;
#ifndef HB_NO_SHAPE_AAT
/* Currently we always apply trak. */
plan
.
apply_trak
=
plan
.
requested_tracking
&&
hb_aat_layout_has_tracking
(
face
);
#endif
}
bool
...
...
@@ -216,11 +218,9 @@ void
hb_ot_shape_plan_t
::
substitute
(
hb_font_t
*
font
,
hb_buffer_t
*
buffer
)
const
{
#ifndef HB_NO_SHAPE_AAT
if
(
unlikely
(
apply_morx
))
hb_aat_layout_substitute
(
this
,
font
,
buffer
);
else
#endif
map
.
substitute
(
this
,
font
,
buffer
);
}
...
...
@@ -230,19 +230,15 @@ hb_ot_shape_plan_t::position (hb_font_t *font,
{
if
(
this
->
apply_gpos
)
map
.
position
(
this
,
font
,
buffer
);
#ifndef HB_NO_SHAPE_AAT
else
if
(
this
->
apply_kerx
)
hb_aat_layout_position
(
this
,
font
,
buffer
);
#endif
else
if
(
this
->
apply_kern
)
hb_ot_layout_kern
(
this
,
font
,
buffer
);
else
_hb_ot_shape_fallback_kern
(
this
,
font
,
buffer
);
#ifndef HB_NO_SHAPE_AAT
if
(
this
->
apply_trak
)
hb_aat_layout_track
(
this
,
font
,
buffer
);
#endif
}
...
...
@@ -338,7 +334,6 @@ hb_ot_shape_collect_features (hb_ot_shape_planner_t *planner,
feature
->
value
);
}
#ifndef HB_NO_SHAPE_AAT
if
(
planner
->
apply_morx
)
{
hb_aat_map_builder_t
*
aat_map
=
&
planner
->
aat_map
;
...
...
@@ -348,7 +343,6 @@ hb_ot_shape_collect_features (hb_ot_shape_planner_t *planner,
aat_map
->
add_feature
(
feature
->
tag
,
feature
->
value
);
}
}
#endif
if
(
planner
->
shaper
->
override_features
)
planner
->
shaper
->
override_features
(
planner
);
...
...
@@ -783,10 +777,8 @@ static inline void
hb_ot_substitute_post
(
const
hb_ot_shape_context_t
*
c
)
{
hb_ot_hide_default_ignorables
(
c
->
buffer
,
c
->
font
);
#ifndef HB_NO_SHAPE_AAT
if
(
c
->
plan
->
apply_morx
)
hb_aat_layout_remove_deleted_glyphs
(
c
->
buffer
);
#endif
if
(
c
->
plan
->
shaper
->
postprocess_glyphs
)
c
->
plan
->
shaper
->
postprocess_glyphs
(
c
->
plan
,
c
->
buffer
,
c
->
font
);
...
...
@@ -920,10 +912,8 @@ hb_ot_position_complex (const hb_ot_shape_context_t *c)
/* Finish off. Has to follow a certain order. */
hb_ot_layout_position_finish_advances
(
c
->
font
,
c
->
buffer
);
hb_ot_zero_width_default_ignorables
(
c
->
buffer
);
#ifndef HB_NO_SHAPE_AAT
if
(
c
->
plan
->
apply_morx
)
hb_aat_layout_zero_width_deleted_glyphs
(
c
->
buffer
);
#endif
hb_ot_layout_position_finish_offsets
(
c
->
font
,
c
->
buffer
);
/* The nil glyph_h_origin() func returns 0, so no need to apply it. */
...
...
src/hb-ot-shape.hh
浏览文件 @
809c5870
...
...
@@ -80,10 +80,16 @@ struct hb_ot_shape_plan_t
bool
adjust_mark_positioning_when_zeroing
:
1
;
bool
apply_gpos
:
1
;
bool
apply_kerx
:
1
;
bool
apply_kern
:
1
;
#ifndef HB_NO_SHAPE_AAT
bool
apply_kerx
:
1
;
bool
apply_morx
:
1
;
bool
apply_trak
:
1
;
#else
static
constexpr
bool
apply_kerx
=
false
;
static
constexpr
bool
apply_morx
=
false
;
static
constexpr
bool
apply_trak
=
false
;
#endif
void
collect_lookups
(
hb_tag_t
table_tag
,
hb_set_t
*
lookups
)
const
{
...
...
@@ -113,7 +119,11 @@ struct hb_ot_shape_planner_t
hb_segment_properties_t
props
;
hb_ot_map_builder_t
map
;
hb_aat_map_builder_t
aat_map
;
#ifndef HB_NO_SHAPE_AAT
bool
apply_morx
:
1
;
#else
static
constexpr
bool
apply_morx
=
false
;
#endif
bool
script_zero_marks
:
1
;
bool
script_fallback_mark_positioning
:
1
;
const
struct
hb_ot_complex_shaper_t
*
shaper
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录