Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
36e90ef5
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看板
提交
36e90ef5
编写于
10月 31, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[mort] Massage some more
上级
cbaff4ef
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
33 addition
and
16 deletion
+33
-16
src/hb-aat-layout-common.hh
src/hb-aat-layout-common.hh
+28
-0
src/hb-aat-layout-morx-table.hh
src/hb-aat-layout-morx-table.hh
+5
-16
未找到文件。
src/hb-aat-layout-common.hh
浏览文件 @
36e90ef5
...
...
@@ -560,6 +560,20 @@ struct MortTypes
return
ClassTable
::
get_class
(
glyph_id
);
}
};
template
<
typename
T
>
static
inline
unsigned
int
offsetToIndex
(
unsigned
int
offset
,
const
void
*
base
,
const
T
*
array
)
{
return
(
offset
-
((
const
char
*
)
array
-
(
const
char
*
)
base
))
/
sizeof
(
T
);
}
template
<
typename
T
>
static
inline
unsigned
int
wordOffsetToIndex
(
unsigned
int
offset
,
const
void
*
base
,
const
T
*
array
)
{
return
offsetToIndex
(
2
*
offset
,
base
,
array
);
}
};
struct
MorxTypes
{
...
...
@@ -574,6 +588,20 @@ struct MorxTypes
return
v
?
*
v
:
1
;
}
};
template
<
typename
T
>
static
inline
unsigned
int
offsetToIndex
(
unsigned
int
offset
,
const
void
*
base
,
const
T
*
array
)
{
return
offset
;
}
template
<
typename
T
>
static
inline
unsigned
int
wordOffsetToIndex
(
unsigned
int
offset
,
const
void
*
base
,
const
T
*
array
)
{
return
offset
;
}
};
template
<
typename
Types
,
typename
EntryData
>
...
...
src/hb-aat-layout-morx-table.hh
浏览文件 @
36e90ef5
...
...
@@ -45,14 +45,6 @@ namespace AAT {
using
namespace
OT
;
template
<
typename
T
>
static
inline
unsigned
int
offsetToIndex
(
unsigned
int
offset
,
const
void
*
base
,
const
T
*
array
)
{
return
(
offset
-
((
const
char
*
)
array
-
(
const
char
*
)
base
))
/
sizeof
(
T
);
}
template
<
typename
Types
>
struct
RearrangementSubtable
{
...
...
@@ -265,7 +257,7 @@ struct ContextualSubtable
{
unsigned
int
offset
=
entry
->
data
.
markIndex
+
buffer
->
info
[
mark
].
codepoint
;
const
UnsizedArrayOf
<
GlyphID
>
&
subs_old
=
(
const
UnsizedArrayOf
<
GlyphID
>
&
)
subs
;
replacement
=
&
subs_old
[
offsetToIndex
(
offset
*
2
,
table
,
subs_old
.
arrayZ
)];
replacement
=
&
subs_old
[
Types
::
wordOffsetToIndex
(
offset
,
table
,
subs_old
.
arrayZ
)];
if
(
!
replacement
->
sanitize
(
&
c
->
sanitizer
)
||
!*
replacement
)
replacement
=
nullptr
;
}
...
...
@@ -290,7 +282,7 @@ struct ContextualSubtable
{
unsigned
int
offset
=
entry
->
data
.
currentIndex
+
buffer
->
info
[
idx
].
codepoint
;
const
UnsizedArrayOf
<
GlyphID
>
&
subs_old
=
(
const
UnsizedArrayOf
<
GlyphID
>
&
)
subs
;
replacement
=
&
subs_old
[
offsetToIndex
(
offset
*
2
,
table
,
subs_old
.
arrayZ
)];
replacement
=
&
subs_old
[
Types
::
wordOffsetToIndex
(
offset
,
table
,
subs_old
.
arrayZ
)];
if
(
!
replacement
->
sanitize
(
&
c
->
sanitizer
)
||
!*
replacement
)
replacement
=
nullptr
;
}
...
...
@@ -503,8 +495,7 @@ struct LigatureSubtable
return
false
;
// TODO Work on previous instead?
unsigned
int
cursor
=
match_length
;
if
(
!
Types
::
extended
)
action_idx
=
offsetToIndex
(
action_idx
,
table
,
ligAction
.
arrayZ
);
action_idx
=
Types
::
offsetToIndex
(
action_idx
,
table
,
ligAction
.
arrayZ
);
const
HBUINT32
*
actionData
=
&
ligAction
[
action_idx
];
do
{
...
...
@@ -527,8 +518,7 @@ struct LigatureSubtable
uoffset
|=
0xC0000000
;
/* Sign-extend. */
int32_t
offset
=
(
int32_t
)
uoffset
;
unsigned
int
component_idx
=
buffer
->
cur
().
codepoint
+
offset
;
if
(
!
Types
::
extended
)
component_idx
=
offsetToIndex
(
component_idx
*
2
,
table
,
component
.
arrayZ
);
component_idx
=
Types
::
wordOffsetToIndex
(
component_idx
,
table
,
component
.
arrayZ
);
const
HBUINT16
&
componentData
=
component
[
component_idx
];
if
(
unlikely
(
!
componentData
.
sanitize
(
&
c
->
sanitizer
)))
return
false
;
ligature_idx
+=
componentData
;
...
...
@@ -538,8 +528,7 @@ struct LigatureSubtable
bool
(
action
&
LigActionLast
));
if
(
action
&
(
LigActionStore
|
LigActionLast
))
{
if
(
!
Types
::
extended
)
ligature_idx
=
offsetToIndex
(
ligature_idx
,
table
,
ligature
.
arrayZ
);
ligature_idx
=
Types
::
offsetToIndex
(
ligature_idx
,
table
,
ligature
.
arrayZ
);
const
GlyphID
&
ligatureData
=
ligature
[
ligature_idx
];
if
(
unlikely
(
!
ligatureData
.
sanitize
(
&
c
->
sanitizer
)))
return
false
;
hb_codepoint_t
lig
=
ligatureData
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录