Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
0f98fe88
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看板
提交
0f98fe88
编写于
7月 23, 2015
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[ot] Search globally for 'vert' feature if not found in specified script/lang
Fixes
https://github.com/behdad/harfbuzz/issues/63
上级
f327aacf
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
50 addition
and
4 deletion
+50
-4
src/hb-ot-layout-private.hh
src/hb-ot-layout-private.hh
+9
-0
src/hb-ot-layout.cc
src/hb-ot-layout.cc
+22
-0
src/hb-ot-map-private.hh
src/hb-ot-map-private.hh
+4
-3
src/hb-ot-map.cc
src/hb-ot-map.cc
+10
-0
src/hb-ot-shape.cc
src/hb-ot-shape.cc
+5
-1
未找到文件。
src/hb-ot-layout-private.hh
浏览文件 @
0f98fe88
...
...
@@ -36,6 +36,15 @@
#include "hb-set-private.hh"
/* Private API corresponding to hb-ot-layout.h: */
HB_INTERNAL
hb_bool_t
hb_ot_layout_table_find_feature
(
hb_face_t
*
face
,
hb_tag_t
table_tag
,
hb_tag_t
feature_tag
,
unsigned
int
*
feature_index
);
/*
* GDEF
*/
...
...
src/hb-ot-layout.cc
浏览文件 @
0f98fe88
...
...
@@ -291,6 +291,28 @@ hb_ot_layout_table_get_feature_tags (hb_face_t *face,
return
g
.
get_feature_tags
(
start_offset
,
feature_count
,
feature_tags
);
}
hb_bool_t
hb_ot_layout_table_find_feature
(
hb_face_t
*
face
,
hb_tag_t
table_tag
,
hb_tag_t
feature_tag
,
unsigned
int
*
feature_index
)
{
ASSERT_STATIC
(
OT
::
Index
::
NOT_FOUND_INDEX
==
HB_OT_LAYOUT_NO_FEATURE_INDEX
);
const
OT
::
GSUBGPOS
&
g
=
get_gsubgpos_table
(
face
,
table_tag
);
unsigned
int
num_features
=
g
.
get_feature_count
();
for
(
unsigned
int
i
=
0
;
i
<
num_features
;
i
++
)
{
if
(
feature_tag
==
g
.
get_feature_tag
(
i
))
{
if
(
feature_index
)
*
feature_index
=
i
;
return
true
;
}
}
if
(
feature_index
)
*
feature_index
=
HB_OT_LAYOUT_NO_FEATURE_INDEX
;
return
false
;
}
unsigned
int
hb_ot_layout_script_get_language_tags
(
hb_face_t
*
face
,
...
...
src/hb-ot-map-private.hh
浏览文件 @
0f98fe88
...
...
@@ -154,9 +154,10 @@ struct hb_ot_map_t
enum
hb_ot_map_feature_flags_t
{
F_NONE
=
0x0000u
,
F_GLOBAL
=
0x0001u
,
F_HAS_FALLBACK
=
0x0002u
,
F_MANUAL_ZWJ
=
0x0004u
F_GLOBAL
=
0x0001u
,
/* Feature applies to all characters; results in no mask allocated for it. */
F_HAS_FALLBACK
=
0x0002u
,
/* Has fallback implementation, so include mask bit even if feature not found. */
F_MANUAL_ZWJ
=
0x0004u
,
/* Don't skip over ZWJ when matching. */
F_GLOBAL_SEARCH
=
0x0008u
/* If feature not found in LangSys, look for it in global feature list and pick one. */
};
/* Macro version for where const is desired. */
#define F_COMBINE(l,r) (hb_ot_map_feature_flags_t ((unsigned int) (l) | (unsigned int) (r)))
...
...
src/hb-ot-map.cc
浏览文件 @
0f98fe88
...
...
@@ -216,6 +216,16 @@ hb_ot_map_builder_t::compile (hb_ot_map_t &m)
info
->
tag
,
&
feature_index
[
table_index
]);
}
if
(
!
found
&&
(
info
->
flags
&
F_GLOBAL_SEARCH
))
{
for
(
unsigned
int
table_index
=
0
;
table_index
<
2
;
table_index
++
)
{
found
|=
hb_ot_layout_table_find_feature
(
face
,
table_tags
[
table_index
],
info
->
tag
,
&
feature_index
[
table_index
]);
}
}
if
(
!
found
&&
!
(
info
->
flags
&
F_HAS_FALLBACK
))
continue
;
...
...
src/hb-ot-shape.cc
浏览文件 @
0f98fe88
...
...
@@ -102,7 +102,11 @@ hb_ot_shape_collect_features (hb_ot_shape_planner_t *planner,
F_HAS_FALLBACK
:
F_NONE
));
else
{
map
->
add_global_bool_feature
(
HB_TAG
(
'v'
,
'e'
,
'r'
,
't'
));
/* We really want to find a 'vert' feature if there's any in the font, no
* matter which script/langsys it is listed (or not) under.
* See various bugs referenced from:
* https://github.com/behdad/harfbuzz/issues/63 */
map
->
add_feature
(
HB_TAG
(
'v'
,
'e'
,
'r'
,
't'
),
1
,
F_GLOBAL
|
F_GLOBAL_SEARCH
);
}
if
(
planner
->
shaper
->
override_features
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录