Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
30c42b64
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看板
提交
30c42b64
编写于
9月 10, 2016
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[GX] Add hb_ot_layout_table_find_feature_variations()
上级
7ceadbe9
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
39 addition
and
10 deletion
+39
-10
src/hb-ot-layout-common-private.hh
src/hb-ot-layout-common-private.hh
+11
-7
src/hb-ot-layout-gsubgpos-private.hh
src/hb-ot-layout-gsubgpos-private.hh
+3
-3
src/hb-ot-layout.cc
src/hb-ot-layout.cc
+15
-0
src/hb-ot-layout.h
src/hb-ot-layout.h
+10
-0
未找到文件。
src/hb-ot-layout-common-private.hh
浏览文件 @
30c42b64
...
...
@@ -1342,7 +1342,7 @@ struct ConditionFormat1
friend
struct
Condition
;
private:
inline
bool
evaluate
(
int
*
coords
,
unsigned
int
coord_len
)
const
inline
bool
evaluate
(
const
int
*
coords
,
unsigned
int
coord_len
)
const
{
int
coord
=
axisIndex
<
coord_len
?
coords
[
axisIndex
]
:
0
;
return
filterRangeMinValue
<=
coord
&&
coord
<=
filterRangeMaxValue
;
...
...
@@ -1365,7 +1365,7 @@ struct ConditionFormat1
struct
Condition
{
inline
bool
evaluate
(
int
*
coords
,
unsigned
int
coord_len
)
const
inline
bool
evaluate
(
const
int
*
coords
,
unsigned
int
coord_len
)
const
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
.
evaluate
(
coords
,
coord_len
);
...
...
@@ -1394,7 +1394,7 @@ struct Condition
struct
ConditionSet
{
inline
bool
evaluate
(
int
*
coords
,
unsigned
int
coord_len
)
const
inline
bool
evaluate
(
const
int
*
coords
,
unsigned
int
coord_len
)
const
{
unsigned
int
count
=
conditions
.
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
...
...
@@ -1470,17 +1470,21 @@ struct FeatureVariationRecord
struct
FeatureVariations
{
inline
const
FeatureTableSubstitution
&
get_substitutions
(
int
*
coords
,
unsigned
int
coord_len
)
const
inline
bool
find_index
(
const
int
*
coords
,
unsigned
int
coord_len
,
unsigned
int
*
index
)
const
{
unsigned
int
count
=
varRecords
.
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
{
const
FeatureVariationRecord
&
record
=
varRecords
.
array
[
i
];
if
((
this
+
record
.
conditions
).
evaluate
(
coords
,
coord_len
))
return
(
this
+
record
.
substitutions
);
{
*
index
=
i
;
return
true
;
}
}
return
Null
(
FeatureTableSubstitution
);
*
index
=
0xFFFFFFFF
;
return
false
;
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
...
...
src/hb-ot-layout-gsubgpos-private.hh
浏览文件 @
30c42b64
...
...
@@ -2271,10 +2271,10 @@ struct GSUBGPOS
inline
const
Lookup
&
get_lookup
(
unsigned
int
i
)
const
{
return
(
this
+
lookupList
)[
i
];
}
inline
const
FeatureTableSubstitution
&
get_feature_substitutions
(
int
*
coords
,
unsigned
int
coord_len
)
const
inline
bool
find_variations_index
(
const
int
*
coords
,
unsigned
int
num_coords
,
unsigned
int
*
index
)
const
{
return
(
version
.
to_int
()
>=
0x00010001u
?
this
+
featureVars
:
Null
(
FeatureVariations
))
.
get_substitutions
(
coords
,
coord_len
);
}
.
find_index
(
coords
,
num_coords
,
index
);
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
...
...
src/hb-ot-layout.cc
浏览文件 @
30c42b64
...
...
@@ -836,6 +836,21 @@ hb_ot_layout_lookup_collect_glyphs (hb_face_t *face,
}
/* Variations support */
hb_bool_t
hb_ot_layout_table_find_feature_variations
(
hb_face_t
*
face
,
hb_tag_t
table_tag
,
const
int
*
coords
,
unsigned
int
num_coords
,
unsigned
int
*
variations_index
/* out */
)
{
const
OT
::
GSUBGPOS
&
g
=
get_gsubgpos_table
(
face
,
table_tag
);
return
g
.
find_variations_index
(
coords
,
num_coords
,
variations_index
);
}
/*
* OT::GSUB
*/
...
...
src/hb-ot-layout.h
浏览文件 @
30c42b64
...
...
@@ -95,6 +95,7 @@ hb_ot_layout_get_ligature_carets (hb_font_t *font,
#define HB_OT_LAYOUT_NO_SCRIPT_INDEX 0xFFFFu
#define HB_OT_LAYOUT_NO_FEATURE_INDEX 0xFFFFu
#define HB_OT_LAYOUT_DEFAULT_LANGUAGE_INDEX 0xFFFFu
#define HB_OT_LAYOUT_NO_VARIATIONS_INDEX 0xFFFFFFFFu
HB_EXTERN
unsigned
int
hb_ot_layout_table_get_script_tags
(
hb_face_t
*
face
,
...
...
@@ -236,6 +237,15 @@ Xhb_ot_layout_lookup_enumerate_sequences (hb_face_t *face,
void
*
user_data
);
#endif
/* Variations support */
HB_EXTERN
hb_bool_t
hb_ot_layout_table_find_feature_variations
(
hb_face_t
*
face
,
hb_tag_t
table_tag
,
const
int
*
coords
,
unsigned
int
num_coords
,
unsigned
int
*
variations_index
/* out */
);
/*
* GSUB
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录