Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
59055b54
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
接近 2 年 前同步成功
通知
1
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看板
提交
59055b54
编写于
9月 10, 2016
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[GX] Implement Feature Variations
Not hooked up to shaper yet.
上级
85ec4944
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
180 addition
and
8 deletion
+180
-8
src/hb-ot-layout-common-private.hh
src/hb-ot-layout-common-private.hh
+167
-1
src/hb-ot-layout-gdef-table.hh
src/hb-ot-layout-gdef-table.hh
+0
-1
src/hb-ot-layout-gpos-table.hh
src/hb-ot-layout-gpos-table.hh
+0
-2
src/hb-ot-layout-gsub-table.hh
src/hb-ot-layout-gsub-table.hh
+0
-2
src/hb-ot-layout-gsubgpos-private.hh
src/hb-ot-layout-gsubgpos-private.hh
+13
-2
未找到文件。
src/hb-ot-layout-common-private.hh
浏览文件 @
59055b54
...
...
@@ -507,7 +507,7 @@ struct Feature
{
return
this
+
featureParams
;
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
const
Record
<
Feature
>::
sanitize_closure_t
*
closure
)
const
const
Record
<
Feature
>::
sanitize_closure_t
*
closure
=
NULL
)
const
{
TRACE_SANITIZE
(
this
);
if
(
unlikely
(
!
(
c
->
check_struct
(
this
)
&&
lookupIndex
.
sanitize
(
c
))))
...
...
@@ -1333,6 +1333,172 @@ struct VariationStore
DEFINE_SIZE_ARRAY
(
8
,
dataSets
);
};
/*
* Feature Variations
*/
struct
ConditionFormat1
{
friend
struct
Condition
;
private:
inline
bool
evaluate
(
int
*
coords
,
unsigned
int
coord_len
)
const
{
int
coord
=
axisIndex
<
coord_len
?
coords
[
axisIndex
]
:
0
;
return
filterRangeMinValue
<=
coord
&&
coord
<=
filterRangeMaxValue
;
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return_trace
(
c
->
check_struct
(
this
));
}
protected:
USHORT
format
;
/* Format identifier--format = 1 */
USHORT
axisIndex
;
F2DOT14
filterRangeMinValue
;
F2DOT14
filterRangeMaxValue
;
public:
DEFINE_SIZE_STATIC
(
8
);
};
struct
Condition
{
inline
bool
evaluate
(
int
*
coords
,
unsigned
int
coord_len
)
const
{
switch
(
u
.
format
)
{
case
1
:
return
u
.
format1
.
evaluate
(
coords
,
coord_len
);
default:
return
false
;
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
if
(
!
u
.
format
.
sanitize
(
c
))
return_trace
(
false
);
switch
(
u
.
format
)
{
case
1
:
return_trace
(
u
.
format1
.
sanitize
(
c
));
default:
return_trace
(
true
);
}
}
protected:
union
{
USHORT
format
;
/* Format identifier */
ConditionFormat1
format1
;
}
u
;
public:
DEFINE_SIZE_UNION
(
2
,
format
);
};
struct
ConditionSet
{
inline
bool
evaluate
(
int
*
coords
,
unsigned
int
coord_len
)
const
{
unsigned
int
count
=
conditions
.
len
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
if
(
!
(
this
+
conditions
.
array
[
i
]).
evaluate
(
coords
,
coord_len
))
return
false
;
return
true
;
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return_trace
(
conditions
.
sanitize
(
c
,
this
));
}
protected:
OffsetArrayOf
<
Condition
,
ULONG
>
conditions
;
public:
DEFINE_SIZE_ARRAY
(
2
,
conditions
);
};
struct
FeatureTableSubstitutionRecord
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return_trace
(
c
->
check_struct
(
this
)
&&
feature
.
sanitize
(
c
,
this
));
}
protected:
USHORT
featureIndex
;
OffsetTo
<
Feature
,
ULONG
>
feature
;
public:
DEFINE_SIZE_STATIC
(
6
);
};
struct
FeatureTableSubstitution
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return_trace
(
version
.
sanitize
(
c
)
&&
likely
(
version
.
major
==
1
)
&&
substitutions
.
sanitize
(
c
,
this
));
}
protected:
FixedVersion
<>
version
;
/* Version--0x00010000u */
OffsetArrayOf
<
FeatureTableSubstitutionRecord
,
ULONG
>
substitutions
;
public:
DEFINE_SIZE_ARRAY
(
6
,
substitutions
);
};
struct
FeatureVariationRecord
{
friend
struct
FeatureVariations
;
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
const
void
*
base
)
const
{
TRACE_SANITIZE
(
this
);
return_trace
(
conditions
.
sanitize
(
c
,
base
)
&&
substitutions
.
sanitize
(
c
,
base
));
}
protected:
OffsetTo
<
ConditionSet
,
ULONG
>
conditions
;
OffsetTo
<
FeatureTableSubstitution
,
ULONG
>
substitutions
;
public:
DEFINE_SIZE_STATIC
(
8
);
};
struct
FeatureVariations
{
inline
const
FeatureTableSubstitution
&
get_substitutions
(
int
*
coords
,
unsigned
int
coord_len
)
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
);
}
return
Null
(
FeatureTableSubstitution
);
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
return_trace
(
version
.
sanitize
(
c
)
&&
likely
(
version
.
major
==
1
)
&&
varRecords
.
sanitize
(
c
,
this
));
}
protected:
FixedVersion
<>
version
;
/* Version--0x00010000u */
ArrayOf
<
FeatureVariationRecord
,
ULONG
>
varRecords
;
public:
DEFINE_SIZE_ARRAY
(
8
,
varRecords
);
};
/*
* Device Tables
...
...
src/hb-ot-layout-gdef-table.hh
浏览文件 @
59055b54
...
...
@@ -397,7 +397,6 @@ struct GDEF
(
version
.
to_int
()
<
0x00010003u
||
varStore
.
sanitize
(
c
,
this
)));
}
/* glyph_props is a 16-bit integer where the lower 8-bit have bits representing
* glyph class and other bits, and high 8-bit gthe mark attachment type (if any).
* Not to be confused with lookup_props which is very similar. */
...
...
src/hb-ot-layout-gpos-table.hh
浏览文件 @
59055b54
...
...
@@ -1518,8 +1518,6 @@ struct GPOS : GSUBGPOS
const
OffsetTo
<
PosLookupList
>
&
list
=
CastR
<
OffsetTo
<
PosLookupList
>
>
(
lookupList
);
return_trace
(
list
.
sanitize
(
c
,
this
));
}
public:
DEFINE_SIZE_STATIC
(
10
);
};
...
...
src/hb-ot-layout-gsub-table.hh
浏览文件 @
59055b54
...
...
@@ -1273,8 +1273,6 @@ struct GSUB : GSUBGPOS
const
OffsetTo
<
SubstLookupList
>
&
list
=
CastR
<
OffsetTo
<
SubstLookupList
>
>
(
lookupList
);
return_trace
(
list
.
sanitize
(
c
,
this
));
}
public:
DEFINE_SIZE_STATIC
(
10
);
};
...
...
src/hb-ot-layout-gsubgpos-private.hh
浏览文件 @
59055b54
...
...
@@ -2271,6 +2271,11 @@ 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
{
return
(
version
.
to_int
()
>=
0x00010001u
?
this
+
featureVars
:
Null
(
FeatureVariations
))
.
get_substitutions
(
coords
,
coord_len
);
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
...
...
@@ -2278,7 +2283,8 @@ struct GSUBGPOS
likely
(
version
.
major
==
1
)
&&
scriptList
.
sanitize
(
c
,
this
)
&&
featureList
.
sanitize
(
c
,
this
)
&&
lookupList
.
sanitize
(
c
,
this
));
lookupList
.
sanitize
(
c
,
this
)
&&
(
version
.
to_int
()
<
0x00010001u
||
featureVars
.
sanitize
(
c
,
this
)));
}
protected:
...
...
@@ -2290,8 +2296,13 @@ struct GSUBGPOS
featureList
;
/* FeatureList table */
OffsetTo
<
LookupList
>
lookupList
;
/* LookupList table */
OffsetTo
<
FeatureVariations
,
ULONG
>
featureVars
;
/* Offset to Feature Variations
table--from beginning of table
* (may be NULL). Introduced
* in version 0x00010001. */
public:
DEFINE_SIZE_
STATIC
(
10
);
DEFINE_SIZE_
MIN
(
10
);
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录