Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
be746009
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看板
提交
be746009
编写于
10月 25, 2018
作者:
M
Michiharu Ariza
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
dropped support of legacy CFF CharString ops
along with test & font
上级
2ebf3601
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
1 addition
and
157 deletion
+1
-157
src/hb-cff1-interp-cs.hh
src/hb-cff1-interp-cs.hh
+1
-134
test/api/fonts/cff1_legacyops.otf
test/api/fonts/cff1_legacyops.otf
+0
-0
test/api/test-ot-extents-cff.c
test/api/test-ot-extents-cff.c
+0
-23
未找到文件。
src/hb-cff1-interp-cs.hh
浏览文件 @
be746009
...
...
@@ -41,15 +41,10 @@ struct CFF1CSInterpEnv : CSInterpEnv<Number, CFF1Subrs>
SUPER
::
init
(
str
,
*
acc
.
globalSubrs
,
*
acc
.
privateDicts
[
fd
].
localSubrs
);
processed_width
=
false
;
has_width
=
false
;
transient_array
.
init
();
transient_array
.
resize
(
kTransientArraySize
);
for
(
unsigned
int
i
=
0
;
i
<
kTransientArraySize
;
i
++
)
transient_array
[
i
].
set_int
(
0
);
}
inline
void
fini
(
void
)
{
transient_array
.
fini
();
SUPER
::
fini
();
}
...
...
@@ -73,9 +68,6 @@ struct CFF1CSInterpEnv : CSInterpEnv<Number, CFF1Subrs>
bool
has_width
;
Number
width
;
static
const
unsigned
int
kTransientArraySize
=
32
;
hb_vector_t
<
Number
,
kTransientArraySize
>
transient_array
;
private:
typedef
CSInterpEnv
<
Number
,
CFF1Subrs
>
SUPER
;
};
...
...
@@ -83,132 +75,7 @@ struct CFF1CSInterpEnv : CSInterpEnv<Number, CFF1Subrs>
template
<
typename
OPSET
,
typename
PARAM
,
typename
PATH
=
PathProcsNull
<
CFF1CSInterpEnv
,
PARAM
>
>
struct
CFF1CSOpSet
:
CSOpSet
<
Number
,
OPSET
,
CFF1CSInterpEnv
,
PARAM
,
PATH
>
{
static
inline
void
process_op
(
OpCode
op
,
CFF1CSInterpEnv
&
env
,
PARAM
&
param
)
{
Number
n1
,
n2
;
switch
(
op
)
{
case
OpCode_and
:
env
.
argStack
.
pop_num2
(
n1
,
n2
);
env
.
argStack
.
push_int
((
n1
.
to_real
()
!=
0.0
f
)
&&
(
n2
.
to_real
()
!=
0.0
f
));
break
;
case
OpCode_or
:
env
.
argStack
.
pop_num2
(
n1
,
n2
);
env
.
argStack
.
push_int
((
n1
.
to_real
()
!=
0.0
f
)
||
(
n2
.
to_real
()
!=
0.0
f
));
break
;
case
OpCode_not
:
n1
=
env
.
argStack
.
pop_num
();
env
.
argStack
.
push_int
(
n1
.
to_real
()
==
0.0
f
);
break
;
case
OpCode_abs
:
n1
=
env
.
argStack
.
pop_num
();
env
.
argStack
.
push_real
(
fabs
(
n1
.
to_real
()));
break
;
case
OpCode_add
:
env
.
argStack
.
pop_num2
(
n1
,
n2
);
env
.
argStack
.
push_real
(
n1
.
to_real
()
+
n2
.
to_real
());
break
;
case
OpCode_sub
:
env
.
argStack
.
pop_num2
(
n1
,
n2
);
env
.
argStack
.
push_real
(
n1
.
to_real
()
-
n2
.
to_real
());
break
;
case
OpCode_div
:
env
.
argStack
.
pop_num2
(
n1
,
n2
);
if
(
unlikely
(
n2
.
to_real
()
==
0.0
f
))
env
.
argStack
.
push_int
(
0
);
else
env
.
argStack
.
push_real
(
n1
.
to_real
()
/
n2
.
to_real
());
break
;
case
OpCode_neg
:
n1
=
env
.
argStack
.
pop_num
();
env
.
argStack
.
push_real
(
-
n1
.
to_real
());
break
;
case
OpCode_eq
:
env
.
argStack
.
pop_num2
(
n1
,
n2
);
env
.
argStack
.
push_int
(
n1
.
to_real
()
==
n2
.
to_real
());
break
;
case
OpCode_drop
:
n1
=
env
.
argStack
.
pop_num
();
break
;
case
OpCode_put
:
env
.
argStack
.
pop_num2
(
n1
,
n2
);
env
.
transient_array
[
n2
.
to_int
()]
=
n1
;
break
;
case
OpCode_get
:
n1
=
env
.
argStack
.
pop_num
();
env
.
argStack
.
push
(
env
.
transient_array
[
n1
.
to_int
()]);
break
;
case
OpCode_ifelse
:
{
env
.
argStack
.
pop_num2
(
n1
,
n2
);
bool
test
=
n1
.
to_real
()
<=
n2
.
to_real
();
env
.
argStack
.
pop_num2
(
n1
,
n2
);
env
.
argStack
.
push
(
test
?
n1
:
n2
);
}
break
;
case
OpCode_random
:
env
.
argStack
.
push_int
(
1
);
/* we can't deal with random behavior; make it constant */
break
;
case
OpCode_mul
:
env
.
argStack
.
pop_num2
(
n1
,
n2
);
env
.
argStack
.
push_real
(
n1
.
to_real
()
*
n2
.
to_real
());
break
;
case
OpCode_sqrt
:
n1
=
env
.
argStack
.
pop_num
();
env
.
argStack
.
push_real
((
float
)
sqrt
(
n1
.
to_real
()));
break
;
case
OpCode_dup
:
n1
=
env
.
argStack
.
pop_num
();
env
.
argStack
.
push
(
n1
);
env
.
argStack
.
push
(
n1
);
break
;
case
OpCode_exch
:
env
.
argStack
.
pop_num2
(
n1
,
n2
);
env
.
argStack
.
push
(
n2
);
env
.
argStack
.
push
(
n1
);
break
;
case
OpCode_index
:
{
n1
=
env
.
argStack
.
pop_num
();
int
i
=
n1
.
to_int
();
if
(
i
<
0
)
i
=
0
;
if
(
unlikely
((
unsigned
int
)
i
>=
env
.
argStack
.
get_count
()))
{
env
.
set_error
();
return
;
}
env
.
argStack
.
push
(
env
.
argStack
[
env
.
argStack
.
get_count
()
-
i
-
1
]);
}
break
;
case
OpCode_roll
:
{
env
.
argStack
.
pop_num2
(
n1
,
n2
);
int
n
=
n1
.
to_int
();
int
j
=
n2
.
to_int
();
if
(
unlikely
(
n
<
0
||
(
unsigned
int
)
n
>
env
.
argStack
.
get_count
()))
{
env
.
set_error
();
return
;
}
if
(
likely
(
n
>
0
))
{
if
(
j
<
0
)
j
=
n
-
(
-
j
%
n
);
j
%=
n
;
unsigned
int
top
=
env
.
argStack
.
get_count
()
-
1
;
unsigned
int
bot
=
top
-
n
+
1
;
env
.
argStack
.
reverse_range
(
top
-
j
+
1
,
top
);
env
.
argStack
.
reverse_range
(
bot
,
top
-
j
);
env
.
argStack
.
reverse_range
(
bot
,
top
);
}
}
break
;
default:
SUPER
::
process_op
(
op
,
env
,
param
);
break
;
}
}
/* PostScript-originated legacy opcodes (OpCode_add etc) are unsupported */
static
inline
void
flush_args
(
CFF1CSInterpEnv
&
env
,
PARAM
&
param
,
unsigned
int
start_arg
=
0
)
{
...
...
test/api/fonts/cff1_legacyops.otf
已删除
100644 → 0
浏览文件 @
2ebf3601
文件已删除
test/api/test-ot-extents-cff.c
浏览文件 @
be746009
...
...
@@ -68,28 +68,6 @@ test_extents_cff1 (void)
hb_font_destroy
(
font_j
);
}
static
void
test_extents_cff1_legacyops
(
void
)
{
hb_face_t
*
face
=
hb_test_open_font_file
(
"fonts/cff1_legacyops.otf"
);
g_assert
(
face
);
hb_font_t
*
font
=
hb_font_create
(
face
);
hb_face_destroy
(
face
);
g_assert
(
font
);
hb_ot_font_set_funcs
(
font
);
hb_glyph_extents_t
extents
;
hb_bool_t
result
=
hb_font_get_glyph_extents
(
font
,
0
,
&
extents
);
g_assert
(
result
);
g_assert_cmpint
(
extents
.
x_bearing
,
==
,
20
);
g_assert_cmpint
(
extents
.
y_bearing
,
==
,
800
);
g_assert_cmpint
(
extents
.
width
,
==
,
160
);
g_assert_cmpint
(
extents
.
height
,
==
,
-
810
);
hb_font_destroy
(
font
);
}
static
void
test_extents_cff1_flex
(
void
)
{
...
...
@@ -182,7 +160,6 @@ main (int argc, char **argv)
hb_test_init
(
&
argc
,
&
argv
);
hb_test_add
(
test_extents_cff1
);
hb_test_add
(
test_extents_cff1_legacyops
);
hb_test_add
(
test_extents_cff1_flex
);
hb_test_add
(
test_extents_cff2
);
hb_test_add
(
test_extents_cff2_vsindex
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录