Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
87b75d0a
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,发现更多精彩内容 >>
提交
87b75d0a
编写于
9月 04, 2012
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[OT] Allow adding features with fallback implementation
上级
1d3947a6
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
8 addition
and
5 deletion
+8
-5
src/hb-ot-map-private.hh
src/hb-ot-map-private.hh
+4
-3
src/hb-ot-map.cc
src/hb-ot-map.cc
+4
-2
未找到文件。
src/hb-ot-map-private.hh
浏览文件 @
87b75d0a
...
...
@@ -147,10 +147,10 @@ struct hb_ot_map_builder_t
hb_ot_map_builder_t
(
void
)
{
memset
(
this
,
0
,
sizeof
(
*
this
));
}
HB_INTERNAL
void
add_feature
(
hb_tag_t
tag
,
unsigned
int
value
,
bool
global
);
HB_INTERNAL
void
add_feature
(
hb_tag_t
tag
,
unsigned
int
value
,
bool
global
,
bool
has_fallback
=
false
);
inline
void
add_bool_feature
(
hb_tag_t
tag
,
bool
global
=
true
)
{
add_feature
(
tag
,
1
,
global
);
}
inline
void
add_bool_feature
(
hb_tag_t
tag
,
bool
global
=
true
,
bool
has_fallback
=
false
)
{
add_feature
(
tag
,
1
,
global
,
has_fallback
);
}
inline
void
add_gsub_pause
(
hb_ot_map_t
::
pause_func_t
pause_func
)
{
add_pause
(
0
,
pause_func
);
}
...
...
@@ -174,6 +174,7 @@ struct hb_ot_map_builder_t
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 */
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
浏览文件 @
87b75d0a
...
...
@@ -60,7 +60,7 @@ hb_ot_map_t::add_lookups (hb_face_t *face,
}
void
hb_ot_map_builder_t
::
add_feature
(
hb_tag_t
tag
,
unsigned
int
value
,
bool
global
)
void
hb_ot_map_builder_t
::
add_feature
(
hb_tag_t
tag
,
unsigned
int
value
,
bool
global
,
bool
has_fallback
)
{
feature_info_t
*
info
=
feature_infos
.
push
();
if
(
unlikely
(
!
info
))
return
;
...
...
@@ -68,6 +68,7 @@ void hb_ot_map_builder_t::add_feature (hb_tag_t tag, unsigned int value, bool gl
info
->
seq
=
feature_infos
.
len
;
info
->
max_value
=
value
;
info
->
global
=
global
;
info
->
has_fallback
=
has_fallback
;
info
->
default_value
=
global
?
value
:
0
;
info
->
stage
[
0
]
=
current_stage
[
0
];
info
->
stage
[
1
]
=
current_stage
[
1
];
...
...
@@ -175,6 +176,7 @@ hb_ot_map_builder_t::compile (hb_face_t *face,
feature_infos
[
j
].
global
=
false
;
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
].
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 */
...
...
@@ -209,7 +211,7 @@ hb_ot_map_builder_t::compile (hb_face_t *face,
language_index
[
table_index
],
info
->
tag
,
&
feature_index
[
table_index
]);
if
(
!
found
)
if
(
!
found
&&
!
info
->
has_fallback
)
continue
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录