Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
bb82f013
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
bb82f013
编写于
2月 25, 2018
作者:
E
Ebrahim Byagowi
提交者:
Behdad Esfahbod
2月 26, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[aat] trak sanitization
上级
becb1d9e
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
78 addition
and
25 deletion
+78
-25
src/dev-run.sh
src/dev-run.sh
+2
-2
src/hb-aat-layout-trak-table.hh
src/hb-aat-layout-trak-table.hh
+74
-21
src/hb-aat-layout.cc
src/hb-aat-layout.cc
+1
-1
util/options.hh
util/options.hh
+1
-1
未找到文件。
src/dev-run.sh
浏览文件 @
bb82f013
...
...
@@ -35,7 +35,7 @@ find src/ | entr printf '\0' | while read -d ""; do
fi
done
read
-n
1
-p
"[T]est, [D]ebug, [R]estart, [Q]uit?"
answer
read
-n
1
-p
"[T]est, [D]ebug, [R]estart, [Q]uit?
"
answer
case
"
$answer
"
in
t|T
)
if
[[
$CMAKENINJA
]]
;
then
...
...
@@ -48,7 +48,7 @@ d|D )
if
[[
$CMAKENINJA
]]
;
then
echo
"Not supported on cmake builds yet"
else
build/libtool
--mode
=
execute
$GDB
build/util/hb-shape
$@
build/libtool
--mode
=
execute
$GDB
--
build/util/hb-shape
$@
fi
;;
r|R
)
...
...
src/hb-aat-layout-trak-table.hh
浏览文件 @
bb82f013
...
...
@@ -39,11 +39,15 @@ namespace AAT {
struct
TrackTableEntry
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
const
void
*
base
,
uint16_t
size
)
const
{
TRACE_SANITIZE
(
this
);
/* XXX Sanitize values */
return_trace
(
c
->
check_struct
(
this
));
return_trace
(
c
->
check_struct
(
this
)
&&
((
base
+
values
).
sanitize
(
c
,
size
)));
}
inline
Fixed
get_track_value
()
const
{
return
track
;
}
inline
float
get_value
(
const
void
*
base
,
unsigned
int
index
)
const
...
...
@@ -64,11 +68,29 @@ struct TrackTableEntry
struct
TrackData
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
const
void
*
base
)
const
{
TRACE_SANITIZE
(
this
);
/* TODO */
return_trace
(
c
->
check_struct
(
this
));
if
(
!
(
c
->
check_struct
(
this
)))
return_trace
(
false
);
uint16_t
tracks
=
(
uint16_t
)
nTracks
;
uint16_t
sizes
=
(
uint16_t
)
nSizes
;
// It should have at least one track
if
(
tracks
<
1
)
return_trace
(
false
);
// We can not do interpolation with less than two
if
(
sizes
<
2
)
return_trace
(
false
);
if
(
!
((
base
+
sizeTable
).
sanitize
(
c
,
sizes
)))
return_trace
(
false
);
for
(
uint16_t
i
=
0
;
i
<
tracks
;
++
i
)
if
(
!
(
trackTable
[
i
].
sanitize
(
c
,
base
,
sizes
)))
return_trace
(
false
);
return_trace
(
true
);
}
inline
float
get_tracking
(
const
void
*
base
,
float
ptem
)
const
...
...
@@ -84,26 +106,37 @@ struct TrackData
/* TODO Clean this up. */
// TODO: Make indexing work and use only an entry with zero track
const
TrackTableEntry
&
trackTableEntry
=
trackTable
[
0
];
uint16_t
tracks
=
(
uint16_t
)
nTracks
;
uint16_t
sizes
=
(
uint16_t
)
nSizes
;
const
TrackTableEntry
*
trackTableEntry
=
nullptr
;
for
(
unsigned
int
i
=
0
;
i
<
sizes
;
++
i
)
// For now we only seek for track entries with zero tracking value
if
(
trackTable
[
i
].
get_track_value
()
==
0
)
trackTableEntry
=
&
trackTable
[
0
];
// We couldn't match any, exit
if
(
!
trackTableEntry
)
return
0.
;
/* TODO bfind() */
unsigned
int
size_index
;
for
(
size_index
=
0
;
size_index
<
nSizes
;
++
size_index
)
if
((
base
+
sizeTable
)[
size_index
]
>=
fixed_size
)
UnsizedArrayOf
<
Fixed
>
size_table
=
base
+
sizeTable
;
for
(
size_index
=
0
;
size_index
<
sizes
;
++
size_index
)
if
(
size_table
[
size_index
]
>=
fixed_size
)
break
;
// We don't attempt to extrapolate to larger or smaller values
if
(
size_index
==
nSizes
)
return
trackTableEntry
.
get_value
(
base
,
nSizes
-
1
);
if
(
size_index
==
0
||
(
base
+
sizeTable
)[
size_index
]
==
fixed_size
)
return
trackTableEntry
.
get_value
(
base
,
size_index
);
// 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
);
if
(
size_index
==
0
||
size_table
[
size_index
]
==
fixed_size
)
return
trackTableEntry
->
get_value
(
base
,
size_index
);
float
s0
=
(
base
+
sizeTable
)
[
size_index
-
1
].
to_float
();
float
s1
=
(
base
+
sizeTable
)
[
size_index
].
to_float
();
float
s0
=
size_table
[
size_index
-
1
].
to_float
();
float
s1
=
size_table
[
size_index
].
to_float
();
float
t
=
(
csspx
-
s0
)
/
(
s1
-
s0
);
return
t
*
trackTableEntry
.
get_value
(
base
,
size_index
)
+
(
1.0
-
t
)
*
trackTableEntry
.
get_value
(
base
,
size_index
-
1
);
return
t
*
trackTableEntry
->
get_value
(
base
,
size_index
)
+
(
1.0
-
t
)
*
trackTableEntry
->
get_value
(
base
,
size_index
-
1
);
}
protected:
...
...
@@ -124,8 +157,28 @@ struct trak
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
)
const
{
TRACE_SANITIZE
(
this
);
/* TODO */
return_trace
(
c
->
check_struct
(
this
));
if
(
!
(
c
->
check_struct
(
this
)))
return_trace
(
false
);
if
((
format
!=
0
)
||
(
reserved
!=
0
))
return_trace
(
false
);
if
(
horizData
)
{
const
TrackData
&
trackData
=
this
+
horizData
;
if
(
!
trackData
.
sanitize
(
c
,
this
))
return_trace
(
false
);
}
if
(
vertData
)
{
const
TrackData
&
trackData
=
this
+
horizData
;
if
(
!
trackData
.
sanitize
(
c
,
this
))
return_trace
(
false
);
}
return_trace
(
true
);
}
inline
bool
apply
(
hb_aat_apply_context_t
*
c
)
const
...
...
src/hb-aat-layout.cc
浏览文件 @
bb82f013
...
...
@@ -36,7 +36,7 @@
#include "hb-aat-layout-trak-table.hh"
/*
* mor
t/morx
* mor
x/kerx/trak
*/
static
inline
const
AAT
::
ankr
&
...
...
util/options.hh
浏览文件 @
bb82f013
...
...
@@ -454,7 +454,7 @@ struct font_options_t : option_group_t
default_font_size
=
default_font_size_
;
x_ppem
=
0
;
y_ppem
=
0
;
ptem
=
.0
;
ptem
=
0.
;
subpixel_bits
=
subpixel_bits_
;
font_file
=
nullptr
;
face_index
=
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录