Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
28b68cff
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看板
提交
28b68cff
编写于
10月 30, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[mort] Implement / adjust Contextual substitution
上级
11dbf0f1
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
59 addition
and
18 deletion
+59
-18
src/hb-aat-layout-morx-table.hh
src/hb-aat-layout-morx-table.hh
+52
-18
src/hb-open-type.hh
src/hb-open-type.hh
+7
-0
未找到文件。
src/hb-aat-layout-morx-table.hh
浏览文件 @
28b68cff
...
...
@@ -213,10 +213,13 @@ struct ContextualSubtable
Reserved
=
0x3FFF
,
/* These bits are reserved and should be set to 0. */
};
inline
driver_context_t
(
const
ContextualSubtable
*
table
)
:
inline
driver_context_t
(
const
ContextualSubtable
*
table_
,
hb_aat_apply_context_t
*
c_
)
:
ret
(
false
),
c
(
c_
),
mark_set
(
false
),
mark
(
0
),
table
(
table_
),
subs
(
table
+
table
->
substitutionTables
)
{}
inline
bool
is_actionable
(
StateTableDriver
<
Types
,
EntryData
>
*
driver
,
...
...
@@ -239,30 +242,57 @@ struct ContextualSubtable
if
(
buffer
->
idx
==
buffer
->
len
&&
!
mark_set
)
return
true
;
if
(
entry
->
data
.
markIndex
!=
0xFFFF
)
const
GlyphID
*
replacement
;
replacement
=
nullptr
;
if
(
Types
::
extended
)
{
const
Lookup
<
GlyphID
>
&
lookup
=
subs
[
entry
->
data
.
markIndex
];
hb_glyph_info_t
*
info
=
buffer
->
info
;
const
GlyphID
*
replacement
=
lookup
.
get_value
(
info
[
mark
].
codepoint
,
driver
->
num_glyphs
);
if
(
replacement
)
if
(
entry
->
data
.
markIndex
!=
0xFFFF
)
{
buffer
->
unsafe_to_break
(
mark
,
MIN
(
buffer
->
idx
+
1
,
buffer
->
len
));
info
[
mark
].
codepoint
=
*
replacement
;
ret
=
true
;
const
Lookup
<
GlyphID
>
&
lookup
=
subs
[
entry
->
data
.
markIndex
];
replacement
=
lookup
.
get_value
(
buffer
->
info
[
mark
].
codepoint
,
driver
->
num_glyphs
);
}
}
if
(
entry
->
data
.
currentIndex
!=
0xFFFF
)
else
{
unsigned
int
offset
=
2
*
(
entry
->
data
.
markIndex
+
buffer
->
info
[
mark
].
codepoint
);
replacement
=
&
StructAtOffset
<
GlyphID
>
(
table
,
offset
);
if
((
const
void
*
)
replacement
<
(
const
void
*
)
subs
||
!
replacement
->
sanitize
(
&
c
->
sanitizer
)
||
!*
replacement
)
replacement
=
nullptr
;
}
if
(
replacement
)
{
buffer
->
unsafe_to_break
(
mark
,
MIN
(
buffer
->
idx
+
1
,
buffer
->
len
));
buffer
->
info
[
mark
].
codepoint
=
*
replacement
;
ret
=
true
;
}
replacement
=
nullptr
;
unsigned
int
idx
=
MIN
(
buffer
->
idx
,
buffer
->
len
-
1
);
if
(
Types
::
extended
)
{
unsigned
int
idx
=
MIN
(
buffer
->
idx
,
buffer
->
len
-
1
);
const
Lookup
<
GlyphID
>
&
lookup
=
subs
[
entry
->
data
.
currentIndex
];
hb_glyph_info_t
*
info
=
buffer
->
info
;
const
GlyphID
*
replacement
=
lookup
.
get_value
(
info
[
idx
].
codepoint
,
driver
->
num_glyphs
);
if
(
replacement
)
if
(
entry
->
data
.
currentIndex
!=
0xFFFF
)
{
info
[
idx
].
codepoint
=
*
replacement
;
re
t
=
true
;
const
Lookup
<
GlyphID
>
&
lookup
=
subs
[
entry
->
data
.
currentIndex
]
;
re
placement
=
lookup
.
get_value
(
buffer
->
info
[
idx
].
codepoint
,
driver
->
num_glyphs
)
;
}
}
else
{
unsigned
int
offset
=
2
*
(
entry
->
data
.
currentIndex
+
buffer
->
info
[
idx
].
codepoint
);
replacement
=
&
StructAtOffset
<
GlyphID
>
(
table
,
offset
);
if
((
const
void
*
)
replacement
<
(
const
void
*
)
subs
||
!
replacement
->
sanitize
(
&
c
->
sanitizer
)
||
!*
replacement
)
replacement
=
nullptr
;
}
if
(
replacement
)
{
buffer
->
info
[
idx
].
codepoint
=
*
replacement
;
ret
=
true
;
}
if
(
entry
->
flags
&
SetMark
)
{
...
...
@@ -276,8 +306,10 @@ struct ContextualSubtable
public:
bool
ret
;
private:
hb_aat_apply_context_t
*
c
;
bool
mark_set
;
unsigned
int
mark
;
const
ContextualSubtable
*
table
;
const
UnsizedOffsetListOf
<
Lookup
<
GlyphID
>
,
HBUINT
,
false
>
&
subs
;
};
...
...
@@ -285,7 +317,7 @@ struct ContextualSubtable
{
TRACE_APPLY
(
this
);
driver_context_t
dc
(
this
);
driver_context_t
dc
(
this
,
c
);
StateTableDriver
<
Types
,
EntryData
>
driver
(
machine
,
c
->
buffer
,
c
->
face
);
driver
.
drive
(
&
dc
);
...
...
@@ -300,6 +332,8 @@ struct ContextualSubtable
unsigned
int
num_entries
=
0
;
if
(
unlikely
(
!
machine
.
sanitize
(
c
,
&
num_entries
)))
return_trace
(
false
);
if
(
!
Types
::
extended
)
return_trace
(
true
);
unsigned
int
num_lookups
=
0
;
const
Entry
<
EntryData
>
*
entries
=
machine
.
get_entries
();
...
...
src/hb-open-type.hh
浏览文件 @
28b68cff
...
...
@@ -340,6 +340,9 @@ struct UnsizedArrayOf
inline
const
Type
&
operator
[]
(
unsigned
int
i
)
const
{
return
arrayZ
[
i
];
}
inline
Type
&
operator
[]
(
unsigned
int
i
)
{
return
arrayZ
[
i
];
}
template
<
typename
T
>
inline
operator
T
*
(
void
)
{
return
arrayZ
;
}
template
<
typename
T
>
inline
operator
const
T
*
(
void
)
const
{
return
arrayZ
;
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
unsigned
int
count
)
const
{
TRACE_SANITIZE
(
this
);
...
...
@@ -450,6 +453,10 @@ struct ArrayOf
if
(
unlikely
(
i
>=
len
))
return
Crap
(
Type
);
return
arrayZ
[
i
];
}
template
<
typename
T
>
inline
operator
T
*
(
void
)
{
return
arrayZ
;
}
template
<
typename
T
>
inline
operator
const
T
*
(
void
)
const
{
return
arrayZ
;
}
inline
unsigned
int
get_size
(
void
)
const
{
return
len
.
static_size
+
len
*
Type
::
static_size
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录