Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
071a2cbc
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看板
提交
071a2cbc
编写于
10月 11, 2018
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[trak] Clean up
上级
fbbd926d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
37 addition
and
30 deletion
+37
-30
src/hb-aat-layout-trak-table.hh
src/hb-aat-layout-trak-table.hh
+37
-30
未找到文件。
src/hb-aat-layout-trak-table.hh
浏览文件 @
071a2cbc
...
...
@@ -46,28 +46,32 @@ struct TrackTableEntry
{
friend
struct
TrackData
;
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
const
void
*
base
,
unsigned
int
size
)
const
inline
float
get_track_value
()
const
{
TRACE_SANITIZE
(
this
);
return_trace
(
likely
(
c
->
check_struct
(
this
)
&&
(
valuesZ
.
sanitize
(
c
,
base
,
size
))));
return
track
.
to_float
();
}
private:
inline
float
get_track_value
()
const
inline
int
get_value
(
const
void
*
base
,
unsigned
int
index
,
unsigned
int
nSizes
)
const
{
return
track
.
to_float
()
;
return
hb_array_t
<
FWORD
>
((
base
+
valuesZ
).
arrayZ
,
nSizes
)[
index
]
;
}
inline
int
get_value
(
const
void
*
base
,
unsigned
int
index
)
const
public:
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
const
void
*
base
,
unsigned
int
nSizes
)
const
{
return
(
base
+
valuesZ
)[
index
];
TRACE_SANITIZE
(
this
);
return_trace
(
likely
(
c
->
check_struct
(
this
)
&&
(
valuesZ
.
sanitize
(
c
,
base
,
nSizes
))));
}
protected:
Fixed
track
;
/* Track value for this record. */
NameID
trackNameID
;
/* The 'name' table index for this track */
NameID
trackNameID
;
/* The 'name' table index for this track.
* (a short word or phrase like "loose"
* or "very tight") */
OffsetTo
<
UnsizedArrayOf
<
FWORD
>
,
HBUINT16
,
false
>
valuesZ
;
/* Offset from start of tracking table to
* per-size tracking values for this track. */
...
...
@@ -78,14 +82,6 @@ struct TrackTableEntry
struct
TrackData
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
const
void
*
base
)
const
{
TRACE_SANITIZE
(
this
);
return_trace
(
c
->
check_struct
(
this
)
&&
sizeTable
.
sanitize
(
c
,
base
,
nSizes
)
&&
trackTable
.
sanitize
(
c
,
nTracks
,
base
,
nSizes
));
}
inline
float
get_tracking
(
const
void
*
base
,
float
ptem
)
const
{
/* CoreText points are CSS pixels (96 per inch),
...
...
@@ -120,22 +116,31 @@ struct TrackData
// TODO(ebraminio): We don't attempt to extrapolate to larger or
// smaller values for now but we should do, per spec
if
(
size_index
==
sizes
)
return
trackTableEntry
->
get_value
(
base
,
sizes
-
1
);
return
trackTableEntry
->
get_value
(
base
,
sizes
-
1
,
nSizes
);
if
(
size_index
==
0
||
size_table
[
size_index
]
==
fixed_size
)
return
trackTableEntry
->
get_value
(
base
,
size_index
);
return
trackTableEntry
->
get_value
(
base
,
size_index
,
nSizes
);
float
s0
=
size_table
[
size_index
-
1
].
to_float
();
float
s1
=
size_table
[
size_index
].
to_float
();
float
t
=
(
csspx
-
s0
)
/
(
s1
-
s0
);
return
(
float
)
t
*
trackTableEntry
->
get_value
(
base
,
size_index
)
+
((
float
)
1.0
-
t
)
*
trackTableEntry
->
get_value
(
base
,
size_index
-
1
);
return
(
float
)
t
*
trackTableEntry
->
get_value
(
base
,
size_index
,
nSizes
)
+
((
float
)
1.0
-
t
)
*
trackTableEntry
->
get_value
(
base
,
size_index
-
1
,
nSizes
);
}
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
const
void
*
base
)
const
{
TRACE_SANITIZE
(
this
);
return_trace
(
c
->
check_struct
(
this
)
&&
sizeTable
.
sanitize
(
c
,
base
,
nSizes
)
&&
trackTable
.
sanitize
(
c
,
nTracks
,
base
,
nSizes
));
}
protected:
HBUINT16
nTracks
;
/* Number of separate tracks included in this table. */
HBUINT16
nSizes
;
/* Number of point sizes included in this table. */
LOffsetTo
<
UnsizedArrayOf
<
Fixed
>
,
false
>
sizeTable
;
/* Offset to array[nSizes] of size values. */
sizeTable
;
/* Offset from start of the tracking table to
* Array[nSizes] of size values.. */
UnsizedArrayOf
<
TrackTableEntry
>
trackTable
;
/* Array[nTracks] of TrackTableEntry records. */
...
...
@@ -194,15 +199,17 @@ struct trak
}
protected:
FixedVersion
<>
version
;
/* Version of the tracking table--currently
* 0x00010000u for version 1.0. */
HBUINT16
format
;
/* Format of the tracking table */
OffsetTo
<
TrackData
>
horizData
;
/* TrackData for horizontal text */
OffsetTo
<
TrackData
>
vertData
;
/* TrackData for vertical text */
FixedVersion
<>
version
;
/* Version of the tracking table
* (0x00010000u for version 1.0). */
HBUINT16
format
;
/* Format of the tracking table (set to 0). */
OffsetTo
<
TrackData
>
horizData
;
/* Offset from start of tracking table to TrackData
* for horizontal text (or 0 if none). */
OffsetTo
<
TrackData
>
vertData
;
/* Offset from start of tracking table to TrackData
* for vertical text (or 0 if none). */
HBUINT16
reserved
;
/* Reserved. Set to 0. */
public:
DEFINE_SIZE_
MIN
(
12
);
DEFINE_SIZE_
STATIC
(
12
);
};
}
/* namespace AAT */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录