Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
02e1e5c6
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看板
提交
02e1e5c6
编写于
5月 18, 2009
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[HB] One more step to go, for fully working GSUB and ChainContext
上级
f14c2b7a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
61 addition
and
46 deletion
+61
-46
src/hb-ot-layout-gsubgpos-private.h
src/hb-ot-layout-gsubgpos-private.h
+61
-46
未找到文件。
src/hb-ot-layout-gsubgpos-private.h
浏览文件 @
02e1e5c6
...
@@ -168,12 +168,9 @@ static inline bool context_lookup (LOOKUP_ARGS_DEF,
...
@@ -168,12 +168,9 @@ static inline bool context_lookup (LOOKUP_ARGS_DEF,
USHORT
inputCount
,
/* Including the first glyph (not matched) */
USHORT
inputCount
,
/* Including the first glyph (not matched) */
const
USHORT
input
[],
/* Array of input values--start with second glyph */
const
USHORT
input
[],
/* Array of input values--start with second glyph */
USHORT
lookupCount
,
USHORT
lookupCount
,
const
LookupRecord
lookupRecord
[],
/* Array of LookupRecords--in design order */
const
LookupRecord
lookupRecord
[],
ContextLookupContext
&
context
)
ContextLookupContext
&
context
)
{
{
unsigned
int
i
,
j
;
unsigned
int
count
=
inputCount
;
return
match_input
(
LOOKUP_ARGS
,
return
match_input
(
LOOKUP_ARGS
,
inputCount
,
input
,
inputCount
,
input
,
context
.
funcs
.
match
,
context
.
match_data
,
context
.
funcs
.
match
,
context
.
match_data
,
...
@@ -308,8 +305,12 @@ struct ContextFormat3 {
...
@@ -308,8 +305,12 @@ struct ContextFormat3 {
friend
struct
Context
;
friend
struct
Context
;
private:
private:
inline
bool
apply
(
LOOKUP_ARGS_DEF
,
apply_lookup_func_t
apply_func
)
const
{
unsigned
int
index
=
(
this
+
coverage
[
0
])
(
IN_CURGLYPH
());
if
(
G_LIKELY
(
index
==
NOT_COVERED
))
return
false
;
inline
bool
apply_coverage
(
LOOKUP_ARGS_DEF
,
apply_lookup_func_t
apply_func
)
const
{
const
LookupRecord
*
lookupRecord
=
(
const
LookupRecord
*
)
const
LookupRecord
*
lookupRecord
=
(
const
LookupRecord
*
)
((
const
char
*
)
coverage
+
((
const
char
*
)
coverage
+
sizeof
(
coverage
[
0
])
*
glyphCount
);
sizeof
(
coverage
[
0
])
*
glyphCount
);
...
@@ -325,15 +326,6 @@ struct ContextFormat3 {
...
@@ -325,15 +326,6 @@ struct ContextFormat3 {
context
);
context
);
}
}
inline
bool
apply
(
LOOKUP_ARGS_DEF
,
apply_lookup_func_t
apply_func
)
const
{
unsigned
int
index
=
(
this
+
coverage
[
0
])
(
IN_CURGLYPH
());
if
(
G_LIKELY
(
index
==
NOT_COVERED
))
return
false
;
return
apply_coverage
(
LOOKUP_ARGS
,
apply_func
);
}
private:
private:
USHORT
format
;
/* Format identifier--format = 3 */
USHORT
format
;
/* Format identifier--format = 3 */
USHORT
glyphCount
;
/* Number of glyphs in the input glyph
USHORT
glyphCount
;
/* Number of glyphs in the input glyph
...
@@ -377,6 +369,26 @@ struct ChainContextLookupContext {
...
@@ -377,6 +369,26 @@ struct ChainContextLookupContext {
char
*
match_data
[
3
];
char
*
match_data
[
3
];
};
};
static
inline
bool
chain_context_lookup
(
LOOKUP_ARGS_DEF
,
USHORT
backtrackCount
,
const
USHORT
backtrack
[],
USHORT
inputCount
,
/* Including the first glyph (not matched) */
const
USHORT
input
[],
/* Array of input values--start with second glyph */
USHORT
lookaheadCount
,
const
USHORT
lookahead
[],
USHORT
lookupCount
,
const
LookupRecord
lookupRecord
[],
ChainContextLookupContext
&
context
)
{
return
match_input
(
LOOKUP_ARGS
,
inputCount
,
input
,
context
.
funcs
.
match
,
context
.
match_data
[
1
],
&
context_length
)
&&
apply_lookup
(
LOOKUP_ARGS
,
inputCount
,
lookupCount
,
lookupRecord
,
context
.
funcs
.
apply
);
}
struct
ChainRule
{
struct
ChainRule
{
...
@@ -388,15 +400,18 @@ struct ChainRule {
...
@@ -388,15 +400,18 @@ struct ChainRule {
((
const
char
*
)
&
backtrack
+
backtrack
.
get_size
());
((
const
char
*
)
&
backtrack
+
backtrack
.
get_size
());
const
ArrayOf
<
USHORT
>
&
lookahead
=
*
(
const
ArrayOf
<
USHORT
>
*
)
const
ArrayOf
<
USHORT
>
&
lookahead
=
*
(
const
ArrayOf
<
USHORT
>
*
)
((
const
char
*
)
&
input
+
input
.
get_size
());
((
const
char
*
)
&
input
+
input
.
get_size
());
const
LookupRecord
&
lookupRecord
=
*
(
const
LookupRecord
*
)
const
ArrayOf
<
LookupRecord
>
&
lookup
=
*
(
const
ArrayOf
<
LookupRecord
>
*
)
((
const
char
*
)
&
lookahead
+
lookahead
.
get_size
());
((
const
char
*
)
&
lookahead
+
lookahead
.
get_size
());
// XXXXXXXXXXXXXXXXXX
return
chain_context_lookup
(
LOOKUP_ARGS
,
// return context_lookup (LOOKUP_ARGS,
backtrack
.
len
,
// inputCount,
backtrack
.
array
,
// input,
input
.
len
,
// lookupCount,
input
.
array
+
1
,
// record,
lookahead
.
len
,
// context);
lookahead
.
array
,
lookup
.
len
,
lookup
.
array
,
context
);
return
false
;
return
false
;
}
}
...
@@ -413,7 +428,7 @@ struct ChainRule {
...
@@ -413,7 +428,7 @@ struct ChainRule {
lookaheadX
;
/* Array of lookahead values's (to be
lookaheadX
;
/* Array of lookahead values's (to be
* matched after the input sequence) */
* matched after the input sequence) */
ArrayOf
<
LookupRecord
>
ArrayOf
<
LookupRecord
>
lookup
Record
X
;
/* Array of LookupRecords--in
lookupX
;
/* Array of LookupRecords--in
* design order) */
* design order) */
};
};
ASSERT_SIZE
(
ChainRule
,
8
);
ASSERT_SIZE
(
ChainRule
,
8
);
...
@@ -526,38 +541,38 @@ struct ChainContextFormat3 {
...
@@ -526,38 +541,38 @@ struct ChainContextFormat3 {
private:
private:
inline
bool
apply_coverage
(
LOOKUP_ARGS_DEF
,
apply_lookup_func_t
apply_func
)
const
{
inline
bool
apply_coverage
(
LOOKUP_ARGS_DEF
,
apply_lookup_func_t
apply_func
)
const
{
}
inline
bool
apply
(
LOOKUP_ARGS_DEF
,
apply_lookup_func_t
apply_func
)
const
{
const
OffsetArrayOf
<
Coverage
>
&
input
=
*
(
const
OffsetArrayOf
<
Coverage
>
*
)
const
OffsetArrayOf
<
Coverage
>
&
input
=
*
(
const
OffsetArrayOf
<
Coverage
>
*
)
((
const
char
*
)
&
backtrack
+
backtrack
.
get_size
());
((
const
char
*
)
&
backtrack
+
backtrack
.
get_size
());
unsigned
int
index
=
(
this
+
input
[
0
])
(
IN_CURGLYPH
());
if
(
G_LIKELY
(
index
==
NOT_COVERED
))
return
false
;
const
OffsetArrayOf
<
Coverage
>
&
lookahead
=
*
(
const
OffsetArrayOf
<
Coverage
>
*
)
const
OffsetArrayOf
<
Coverage
>
&
lookahead
=
*
(
const
OffsetArrayOf
<
Coverage
>
*
)
((
const
char
*
)
&
input
+
input
.
get_size
());
((
const
char
*
)
&
input
+
input
.
get_size
());
const
LookupRecord
&
lookupRecord
=
*
(
const
LookupRecord
*
)
const
ArrayOf
<
LookupRecord
>
&
lookup
=
*
(
const
ArrayOf
<
LookupRecord
>
*
)
((
const
char
*
)
&
lookahead
+
lookahead
.
get_size
());
((
const
char
*
)
&
lookahead
+
lookahead
.
get_size
());
struct
ChainContextLookupContext
context
=
{
struct
ChainContextLookupContext
context
=
{
{
match_coverage
,
apply_func
},
{
match_coverage
,
apply_func
},
{(
char
*
)
this
,
(
char
*
)
this
,
(
char
*
)
this
}
{(
char
*
)
this
,
(
char
*
)
this
,
(
char
*
)
this
}
};
};
/*
return
chain_context_lookup
(
LOOKUP_ARGS
,
XXXXXXXXXXXXXXXXXXXXX
backtrack
.
len
,
return context_lookup (LOOKUP_ARGS,
(
USHORT
*
)
backtrack
.
array
,
glyphCount,
input
.
len
,
(const USHORT *) (coverage + 1),
(
USHORT
*
)
input
.
array
,
lookupCount,
lookahead
.
len
,
record,
(
USHORT
*
)
lookahead
.
array
,
context);
lookup
.
len
,
*/
lookup
.
array
,
context
);
return
false
;
return
false
;
}
}
inline
bool
apply
(
LOOKUP_ARGS_DEF
,
apply_lookup_func_t
apply_func
)
const
{
/* XXX */
unsigned
int
index
=
0
;
//(this+coverage[0]) (IN_CURGLYPH ());
if
(
G_LIKELY
(
index
==
NOT_COVERED
))
return
false
;
return
apply_coverage
(
LOOKUP_ARGS
,
apply_func
);
}
private:
private:
USHORT
format
;
/* Format identifier--format = 3 */
USHORT
format
;
/* Format identifier--format = 3 */
OffsetArrayOf
<
Coverage
>
OffsetArrayOf
<
Coverage
>
...
@@ -573,7 +588,7 @@ struct ChainContextFormat3 {
...
@@ -573,7 +588,7 @@ struct ChainContextFormat3 {
* in lookahead sequence, in glyph
* in lookahead sequence, in glyph
* sequence order */
* sequence order */
ArrayOf
<
LookupRecord
>
ArrayOf
<
LookupRecord
>
lookup
Record
X
;
/* Array of LookupRecords--in
lookupX
;
/* Array of LookupRecords--in
* design order) */
* design order) */
};
};
ASSERT_SIZE
(
ChainContextFormat3
,
10
);
ASSERT_SIZE
(
ChainContextFormat3
,
10
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录