Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
28f0367a
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看板
提交
28f0367a
编写于
10月 11, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[kerx] Flesh out Format4
Doesn't apply actions yet.
上级
947962a2
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
118 addition
and
4 deletion
+118
-4
src/hb-aat-layout-kerx-table.hh
src/hb-aat-layout-kerx-table.hh
+118
-4
未找到文件。
src/hb-aat-layout-kerx-table.hh
浏览文件 @
28f0367a
...
...
@@ -293,11 +293,121 @@ struct KerxSubTableFormat2
struct
KerxSubTableFormat4
{
struct
EntryData
{
HBUINT16
ankrActionIndex
;
/* Either 0xFFFF (for no action) or the index of
* the action to perform. */
public:
DEFINE_SIZE_STATIC
(
2
);
};
struct
driver_context_t
{
static
const
bool
in_place
=
true
;
enum
Flags
{
Mark
=
0x8000
,
/* If set, remember this glyph as the marked glyph. */
DontAdvance
=
0x4000
,
/* If set, don't advance to the next glyph before
* going to the new state. */
Reserved
=
0x3FFF
,
/* Not used; set to 0. */
};
enum
SubTableFlags
{
ActionType
=
0xC0000000
,
/* A two-bit field containing the action type. */
Unused
=
0x3F000000
,
/* Unused - must be zero. */
Offset
=
0x00FFFFFF
,
/* Masks the offset in bytes from the beginning
* of the subtable to the beginning of the control
* point table. */
};
inline
driver_context_t
(
const
KerxSubTableFormat4
*
table
,
hb_aat_apply_context_t
*
c_
)
:
c
(
c_
),
action_type
((
table
->
flags
&
ActionType
)
>>
30
),
ankrData
((
HBUINT16
*
)
((
const
char
*
)
&
table
->
machine
+
(
table
->
flags
&
Offset
))),
mark_set
(
false
),
mark
(
0
)
{}
inline
bool
is_actionable
(
StateTableDriver
<
EntryData
>
*
driver
,
const
Entry
<
EntryData
>
*
entry
)
{
return
entry
->
data
.
ankrActionIndex
!=
0xFFFF
;
}
inline
bool
transition
(
StateTableDriver
<
EntryData
>
*
driver
,
const
Entry
<
EntryData
>
*
entry
)
{
hb_buffer_t
*
buffer
=
driver
->
buffer
;
unsigned
int
flags
=
entry
->
flags
;
if
(
mark_set
&&
entry
->
data
.
ankrActionIndex
!=
0xFFFF
)
{
switch
(
action_type
)
{
case
0
:
/* Control Point Actions.*/
{
/* indexed into glyph outline. */
const
HBUINT16
*
data
=
&
ankrData
[
entry
->
data
.
ankrActionIndex
];
if
(
!
c
->
sanitizer
.
check_array
(
data
,
2
))
return
false
;
HB_UNUSED
unsigned
int
markControlPoint
=
*
data
++
;
HB_UNUSED
unsigned
int
currControlPoint
=
*
data
++
;
/* TODO */
}
break
;
case
1
:
/* Anchor Point Actions. */
{
/* Indexed into 'ankr' table. */
const
HBUINT16
*
data
=
&
ankrData
[
entry
->
data
.
ankrActionIndex
];
if
(
!
c
->
sanitizer
.
check_array
(
data
,
2
))
return
false
;
HB_UNUSED
unsigned
int
markAnchorPoint
=
*
data
++
;
HB_UNUSED
unsigned
int
currAnchorPoint
=
*
data
++
;
/* TODO */
}
break
;
case
2
:
/* Control Point Coordinate Actions. */
{
const
FWORD
*
data
=
(
const
FWORD
*
)
&
ankrData
[
entry
->
data
.
ankrActionIndex
];
if
(
!
c
->
sanitizer
.
check_array
(
data
,
4
))
return
false
;
HB_UNUSED
int
markX
=
*
data
++
;
HB_UNUSED
int
markY
=
*
data
++
;
HB_UNUSED
int
currX
=
*
data
++
;
HB_UNUSED
int
currY
=
*
data
++
;
/* TODO */
}
break
;
}
}
if
(
flags
&
Mark
)
{
mark_set
=
true
;
mark
=
buffer
->
idx
;
}
return
true
;
}
private:
hb_aat_apply_context_t
*
c
;
unsigned
int
action_type
;
const
HBUINT16
*
ankrData
;
bool
mark_set
;
unsigned
int
mark
;
};
inline
bool
apply
(
hb_aat_apply_context_t
*
c
)
const
{
TRACE_APPLY
(
this
);
/* TODO */
driver_context_t
dc
(
this
,
c
);
StateTableDriver
<
EntryData
>
driver
(
machine
,
c
->
buffer
,
c
->
font
->
face
);
driver
.
drive
(
&
dc
);
return_trace
(
true
);
}
...
...
@@ -306,14 +416,18 @@ struct KerxSubTableFormat4
{
TRACE_SANITIZE
(
this
);
/* TODO */
return_trace
(
likely
(
c
->
check_struct
(
this
)));
/* The rest of array sanitizations are done at run-time. */
return_trace
(
c
->
check_struct
(
this
)
&&
machine
.
sanitize
(
c
)
&&
flags
.
sanitize
(
c
));
}
protected:
KerxSubTableHeader
header
;
StateTable
<
EntryData
>
machine
;
HBUINT32
flags
;
public:
DEFINE_SIZE_STATIC
(
1
2
);
DEFINE_SIZE_STATIC
(
3
2
);
};
struct
KerxSubTableFormat6
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录