Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
f9be6738
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看板
提交
f9be6738
编写于
1月 11, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[aat] Implement ContextualSubtable
Tested with Zapfino and text "2nd". Sascha will create tests later.
上级
335a9c1f
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
66 addition
and
4 deletion
+66
-4
src/hb-aat-layout-morx-table.hh
src/hb-aat-layout-morx-table.hh
+66
-4
未找到文件。
src/hb-aat-layout-morx-table.hh
浏览文件 @
f9be6738
...
@@ -200,8 +200,70 @@ struct ContextualSubtable
...
@@ -200,8 +200,70 @@ struct ContextualSubtable
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
inline
bool
apply
(
hb_apply_context_t
*
c
)
const
{
{
TRACE_APPLY
(
this
);
TRACE_APPLY
(
this
);
/* TODO */
return_trace
(
false
);
bool
ret
=
false
;
unsigned
int
num_glyphs
=
c
->
face
->
get_num_glyphs
();
const
UnsizedOffsetListOf
<
Lookup
<
GlyphID
>
,
HBUINT
>
&
subs
=
this
+
substitutionTables
;
unsigned
int
state
=
0
;
unsigned
int
last_zero
=
0
;
unsigned
int
last_zero_before_mark
=
0
;
unsigned
int
mark
=
0
;
hb_glyph_info_t
*
info
=
c
->
buffer
->
info
;
unsigned
int
count
=
c
->
buffer
->
len
;
for
(
unsigned
int
i
=
0
;
i
<=
count
;
i
++
)
{
if
(
!
state
)
last_zero
=
i
;
unsigned
int
klass
=
i
<
count
?
machine
.
get_class
(
info
[
i
].
codepoint
,
num_glyphs
)
:
0
/* End of text */
;
const
Entry
<
EntryData
>
*
entry
=
machine
.
get_entry
(
state
,
klass
);
if
(
unlikely
(
!
entry
))
break
;
unsigned
int
flags
=
entry
->
flags
;
if
(
flags
&
SetMark
)
{
mark
=
i
;
last_zero_before_mark
=
last_zero
;
}
if
(
entry
->
data
.
markIndex
!=
0xFFFF
)
{
const
Lookup
<
GlyphID
>
&
lookup
=
subs
[
entry
->
data
.
markIndex
];
// XXX bounds
const
GlyphID
*
replacement
=
lookup
.
get_value
(
info
[
mark
].
codepoint
,
num_glyphs
);
if
(
replacement
)
{
c
->
buffer
->
unsafe_to_break
(
last_zero_before_mark
,
MIN
(
i
+
1
,
count
));
info
[
mark
].
codepoint
=
*
replacement
;
ret
=
true
;
}
}
if
(
entry
->
data
.
currentIndex
!=
0xFFFF
)
{
const
Lookup
<
GlyphID
>
&
lookup
=
subs
[
entry
->
data
.
currentIndex
];
// XXX bounds
const
GlyphID
*
replacement
=
lookup
.
get_value
(
info
[
i
].
codepoint
,
num_glyphs
);
if
(
replacement
)
{
c
->
buffer
->
unsafe_to_break
(
last_zero
,
MIN
(
i
+
1
,
count
));
info
[
i
].
codepoint
=
*
replacement
;
ret
=
true
;
}
}
if
(
false
/* XXX */
&&
flags
&
DontAdvance
)
i
--
;
/* XXX Detect infinite loop. */
state
=
entry
->
newState
;
}
return_trace
(
ret
);
}
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
...
@@ -233,7 +295,7 @@ struct LigatureSubtable
...
@@ -233,7 +295,7 @@ struct LigatureSubtable
{
{
TRACE_SANITIZE
(
this
);
TRACE_SANITIZE
(
this
);
/* TODO */
/* TODO */
return_trace
(
fals
e
);
return_trace
(
tru
e
);
}
}
};
};
...
@@ -288,7 +350,7 @@ struct InsertionSubtable
...
@@ -288,7 +350,7 @@ struct InsertionSubtable
{
{
TRACE_SANITIZE
(
this
);
TRACE_SANITIZE
(
this
);
/* TODO */
/* TODO */
return_trace
(
fals
e
);
return_trace
(
tru
e
);
}
}
};
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录