Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
fcf17788
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看板
提交
fcf17788
编写于
8月 31, 2018
作者:
M
Michiharu Ariza
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
templatized ArgStack as a prep to store blends
上级
968168bf
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
142 addition
and
99 deletion
+142
-99
src/hb-cff-interp-common.hh
src/hb-cff-interp-common.hh
+27
-19
src/hb-cff-interp-cs-common.hh
src/hb-cff-interp-cs-common.hh
+24
-17
src/hb-cff-interp-dict-common.hh
src/hb-cff-interp-dict-common.hh
+21
-14
src/hb-cff1-interp-cs.hh
src/hb-cff1-interp-cs.hh
+9
-6
src/hb-cff2-interp-cs.hh
src/hb-cff2-interp-cs.hh
+9
-5
src/hb-ot-cff1-table.hh
src/hb-ot-cff1-table.hh
+16
-16
src/hb-ot-cff2-table.hh
src/hb-ot-cff2-table.hh
+33
-18
src/hb-subset-cff-common.hh
src/hb-subset-cff-common.hh
+2
-2
src/hb-subset-cff1.cc
src/hb-subset-cff1.cc
+0
-1
src/hb-subset-cff2.cc
src/hb-subset-cff2.cc
+1
-1
未找到文件。
src/hb-cff-interp-common.hh
浏览文件 @
fcf17788
...
@@ -417,23 +417,24 @@ struct Stack
...
@@ -417,23 +417,24 @@ struct Stack
};
};
/* argument stack */
/* argument stack */
struct
ArgStack
:
Stack
<
Number
,
513
>
template
<
typename
ARG
=
Number
>
struct
ArgStack
:
Stack
<
ARG
,
513
>
{
{
inline
void
push_int
(
int
v
)
inline
void
push_int
(
int
v
)
{
{
Number
n
;
ARG
n
;
n
.
set_int
(
v
);
n
.
set_int
(
v
);
push
(
n
);
S
::
push
(
n
);
}
}
inline
void
push_real
(
float
v
)
inline
void
push_real
(
float
v
)
{
{
Number
n
;
ARG
n
;
n
.
set_real
(
v
);
n
.
set_real
(
v
);
push
(
n
);
S
::
push
(
n
);
}
}
inline
bool
check_pop_num
(
Number
&
n
)
inline
bool
check_pop_num
(
ARG
&
n
)
{
{
if
(
unlikely
(
!
this
->
check_underflow
()))
if
(
unlikely
(
!
this
->
check_underflow
()))
return
false
;
return
false
;
...
@@ -441,7 +442,7 @@ struct ArgStack : Stack<Number, 513>
...
@@ -441,7 +442,7 @@ struct ArgStack : Stack<Number, 513>
return
true
;
return
true
;
}
}
inline
bool
check_pop_num2
(
Number
&
n1
,
Number
&
n2
)
inline
bool
check_pop_num2
(
ARG
&
n1
,
ARG
&
n2
)
{
{
if
(
unlikely
(
!
this
->
check_underflow
(
2
)))
if
(
unlikely
(
!
this
->
check_underflow
(
2
)))
return
false
;
return
false
;
...
@@ -467,15 +468,15 @@ struct ArgStack : Stack<Number, 513>
...
@@ -467,15 +468,15 @@ struct ArgStack : Stack<Number, 513>
return
true
;
return
true
;
}
}
inline
bool
check_pop_delta
(
hb_vector_t
<
Number
>&
vec
,
bool
even
=
false
)
inline
bool
check_pop_delta
(
hb_vector_t
<
ARG
>&
vec
,
bool
even
=
false
)
{
{
if
(
even
&&
unlikely
((
this
->
count
&
1
)
!=
0
))
if
(
even
&&
unlikely
((
this
->
count
&
1
)
!=
0
))
return
false
;
return
false
;
float
val
=
0.0
f
;
float
val
=
0.0
f
;
for
(
unsigned
int
i
=
0
;
i
<
count
;
i
++
)
{
for
(
unsigned
int
i
=
0
;
i
<
S
::
count
;
i
++
)
{
val
+=
elements
[
i
].
to_real
();
val
+=
S
::
elements
[
i
].
to_real
();
Number
*
n
=
vec
.
push
();
ARG
*
n
=
vec
.
push
();
n
->
set_real
(
val
);
n
->
set_real
(
val
);
}
}
return
true
;
return
true
;
...
@@ -483,7 +484,7 @@ struct ArgStack : Stack<Number, 513>
...
@@ -483,7 +484,7 @@ struct ArgStack : Stack<Number, 513>
inline
bool
push_longint_from_substr
(
SubByteStr
&
substr
)
inline
bool
push_longint_from_substr
(
SubByteStr
&
substr
)
{
{
if
(
unlikely
(
!
substr
.
avail
(
4
)
||
!
check_overflow
(
1
)))
if
(
unlikely
(
!
substr
.
avail
(
4
)
||
!
S
::
check_overflow
(
1
)))
return
false
;
return
false
;
push_int
((
int32_t
)
*
(
const
HBUINT32
*
)
&
substr
[
0
]);
push_int
((
int32_t
)
*
(
const
HBUINT32
*
)
&
substr
[
0
]);
substr
.
inc
(
4
);
substr
.
inc
(
4
);
...
@@ -492,7 +493,7 @@ struct ArgStack : Stack<Number, 513>
...
@@ -492,7 +493,7 @@ struct ArgStack : Stack<Number, 513>
inline
bool
push_fixed_from_substr
(
SubByteStr
&
substr
)
inline
bool
push_fixed_from_substr
(
SubByteStr
&
substr
)
{
{
if
(
unlikely
(
!
substr
.
avail
(
4
)
||
!
check_overflow
(
1
)))
if
(
unlikely
(
!
substr
.
avail
(
4
)
||
!
S
::
check_overflow
(
1
)))
return
false
;
return
false
;
push_real
((
int32_t
)
*
(
const
HBUINT32
*
)
&
substr
[
0
]
/
65536.0
);
push_real
((
int32_t
)
*
(
const
HBUINT32
*
)
&
substr
[
0
]
/
65536.0
);
substr
.
inc
(
4
);
substr
.
inc
(
4
);
...
@@ -502,14 +503,17 @@ struct ArgStack : Stack<Number, 513>
...
@@ -502,14 +503,17 @@ struct ArgStack : Stack<Number, 513>
inline
void
reverse_range
(
int
i
,
int
j
)
inline
void
reverse_range
(
int
i
,
int
j
)
{
{
assert
(
i
>=
0
&&
i
<
j
);
assert
(
i
>=
0
&&
i
<
j
);
Number
tmp
;
ARG
tmp
;
while
(
i
<
j
)
while
(
i
<
j
)
{
{
tmp
=
elements
[
i
];
tmp
=
S
::
elements
[
i
];
elements
[
i
++
]
=
elements
[
j
];
S
::
elements
[
i
++
]
=
S
::
elements
[
j
];
elements
[
j
++
]
=
tmp
;
S
::
elements
[
j
++
]
=
tmp
;
}
}
}
}
private:
typedef
Stack
<
ARG
,
513
>
S
;
};
};
/* an operator prefixed by its operands in a byte string */
/* an operator prefixed by its operands in a byte string */
...
@@ -536,6 +540,7 @@ struct OpSerializer
...
@@ -536,6 +540,7 @@ struct OpSerializer
}
}
};
};
template
<
typename
ARG
=
Number
>
struct
InterpEnv
struct
InterpEnv
{
{
inline
void
init
(
const
ByteStr
&
str_
)
inline
void
init
(
const
ByteStr
&
str_
)
...
@@ -576,12 +581,15 @@ struct InterpEnv
...
@@ -576,12 +581,15 @@ struct InterpEnv
}
}
SubByteStr
substr
;
SubByteStr
substr
;
ArgStack
argStack
;
ArgStack
<
ARG
>
argStack
;
};
};
typedef
InterpEnv
<>
NumInterpEnv
;
template
<
typename
ARG
=
Number
>
struct
OpSet
struct
OpSet
{
{
static
inline
bool
process_op
(
OpCode
op
,
InterpEnv
&
env
)
static
inline
bool
process_op
(
OpCode
op
,
InterpEnv
<
ARG
>
&
env
)
{
{
switch
(
op
)
{
switch
(
op
)
{
case
OpCode_shortint
:
case
OpCode_shortint
:
...
...
src/hb-cff-interp-cs-common.hh
浏览文件 @
fcf17788
...
@@ -57,12 +57,12 @@ struct BiasedSubrs
...
@@ -57,12 +57,12 @@ struct BiasedSubrs
unsigned
int
bias
;
unsigned
int
bias
;
};
};
template
<
typename
SUBRS
>
template
<
typename
ARG
,
typename
SUBRS
>
struct
CSInterpEnv
:
InterpEnv
struct
CSInterpEnv
:
InterpEnv
<
ARG
>
{
{
inline
void
init
(
const
ByteStr
&
str
,
const
SUBRS
&
globalSubrs_
,
const
SUBRS
&
localSubrs_
)
inline
void
init
(
const
ByteStr
&
str
,
const
SUBRS
&
globalSubrs_
,
const
SUBRS
&
localSubrs_
)
{
{
InterpEnv
::
init
(
str
);
InterpEnv
<
ARG
>
::
init
(
str
);
seen_moveto
=
true
;
seen_moveto
=
true
;
seen_hintmask
=
false
;
seen_hintmask
=
false
;
...
@@ -74,7 +74,7 @@ struct CSInterpEnv : InterpEnv
...
@@ -74,7 +74,7 @@ struct CSInterpEnv : InterpEnv
}
}
inline
void
fini
(
void
)
inline
void
fini
(
void
)
{
{
InterpEnv
::
fini
();
InterpEnv
<
ARG
>
::
fini
();
callStack
.
fini
();
callStack
.
fini
();
globalSubrs
.
fini
();
globalSubrs
.
fini
();
...
@@ -85,7 +85,7 @@ struct CSInterpEnv : InterpEnv
...
@@ -85,7 +85,7 @@ struct CSInterpEnv : InterpEnv
{
{
int
n
;
int
n
;
if
(
unlikely
((
!
callStack
.
check_overflow
(
1
)
||
if
(
unlikely
((
!
callStack
.
check_overflow
(
1
)
||
!
argStack
.
check_pop_int
(
n
))))
!
SUPER
::
argStack
.
check_pop_int
(
n
))))
return
false
;
return
false
;
n
+=
biasedSubrs
.
bias
;
n
+=
biasedSubrs
.
bias
;
if
(
unlikely
((
n
<
0
)
||
(
n
>=
biasedSubrs
.
subrs
->
count
)))
if
(
unlikely
((
n
<
0
)
||
(
n
>=
biasedSubrs
.
subrs
->
count
)))
...
@@ -101,8 +101,8 @@ struct CSInterpEnv : InterpEnv
...
@@ -101,8 +101,8 @@ struct CSInterpEnv : InterpEnv
if
(
unlikely
(
!
popSubrNum
(
biasedSubrs
,
subr_num
)))
if
(
unlikely
(
!
popSubrNum
(
biasedSubrs
,
subr_num
)))
return
false
;
return
false
;
callStack
.
push
(
substr
);
callStack
.
push
(
SUPER
::
substr
);
substr
=
(
*
biasedSubrs
.
subrs
)[
subr_num
];
SUPER
::
substr
=
(
*
biasedSubrs
.
subrs
)[
subr_num
];
return
true
;
return
true
;
}
}
...
@@ -112,7 +112,7 @@ struct CSInterpEnv : InterpEnv
...
@@ -112,7 +112,7 @@ struct CSInterpEnv : InterpEnv
if
(
unlikely
(
!
callStack
.
check_underflow
()))
if
(
unlikely
(
!
callStack
.
check_underflow
()))
return
false
;
return
false
;
substr
=
callStack
.
pop
();
SUPER
::
substr
=
callStack
.
pop
();
return
true
;
return
true
;
}
}
...
@@ -120,7 +120,7 @@ struct CSInterpEnv : InterpEnv
...
@@ -120,7 +120,7 @@ struct CSInterpEnv : InterpEnv
{
{
if
(
!
seen_hintmask
)
if
(
!
seen_hintmask
)
{
{
vstem_count
+=
argStack
.
get_count
()
/
2
;
vstem_count
+=
SUPER
::
argStack
.
get_count
()
/
2
;
hintmask_size
=
(
hstem_count
+
vstem_count
+
7
)
>>
3
;
hintmask_size
=
(
hstem_count
+
vstem_count
+
7
)
>>
3
;
seen_hintmask
=
true
;
seen_hintmask
=
true
;
}
}
...
@@ -140,10 +140,13 @@ struct CSInterpEnv : InterpEnv
...
@@ -140,10 +140,13 @@ struct CSInterpEnv : InterpEnv
CallStack
callStack
;
CallStack
callStack
;
BiasedSubrs
<
SUBRS
>
globalSubrs
;
BiasedSubrs
<
SUBRS
>
globalSubrs
;
BiasedSubrs
<
SUBRS
>
localSubrs
;
BiasedSubrs
<
SUBRS
>
localSubrs
;
private:
typedef
InterpEnv
<
ARG
>
SUPER
;
};
};
template
<
typename
OPSET
,
typename
ENV
,
typename
PARAM
>
template
<
typename
ARG
,
typename
OPSET
,
typename
ENV
,
typename
PARAM
>
struct
CSOpSet
:
OpSet
struct
CSOpSet
:
OpSet
<
ARG
>
{
{
static
inline
bool
process_op
(
OpCode
op
,
ENV
&
env
,
PARAM
&
param
)
static
inline
bool
process_op
(
OpCode
op
,
ENV
&
env
,
PARAM
&
param
)
{
{
...
@@ -204,7 +207,7 @@ struct CSOpSet : OpSet
...
@@ -204,7 +207,7 @@ struct CSOpSet : OpSet
break
;
break
;
default:
default:
return
OpSet
::
process_op
(
op
,
env
);
return
SUPER
::
process_op
(
op
,
env
);
}
}
return
true
;
return
true
;
}
}
...
@@ -293,6 +296,8 @@ struct CSOpSet : OpSet
...
@@ -293,6 +296,8 @@ struct CSOpSet : OpSet
return
false
;
return
false
;
}
}
}
}
typedef
OpSet
<
ARG
>
SUPER
;
};
};
template
<
typename
ENV
,
typename
OPSET
,
typename
PARAM
>
template
<
typename
ENV
,
typename
OPSET
,
typename
PARAM
>
...
@@ -300,20 +305,22 @@ struct CSInterpreter : Interpreter<ENV>
...
@@ -300,20 +305,22 @@ struct CSInterpreter : Interpreter<ENV>
{
{
inline
bool
interpret
(
PARAM
&
param
)
inline
bool
interpret
(
PARAM
&
param
)
{
{
Interpreter
<
ENV
>
&
super
=
*
this
;
SUPER
::
env
.
set_endchar
(
false
);
super
.
env
.
set_endchar
(
false
);
for
(;;)
{
for
(;;)
{
OpCode
op
;
OpCode
op
;
if
(
unlikely
(
!
super
.
env
.
fetch_op
(
op
)
||
if
(
unlikely
(
!
SUPER
::
env
.
fetch_op
(
op
)
||
!
OPSET
::
process_op
(
op
,
super
.
env
,
param
)))
!
OPSET
::
process_op
(
op
,
SUPER
::
env
,
param
)))
return
false
;
return
false
;
if
(
super
.
env
.
is_endchar
())
if
(
SUPER
::
env
.
is_endchar
())
break
;
break
;
}
}
return
true
;
return
true
;
}
}
private:
typedef
Interpreter
<
ENV
>
SUPER
;
};
};
}
/* namespace CFF */
}
/* namespace CFF */
...
...
src/hb-cff-interp-dict-common.hh
浏览文件 @
fcf17788
...
@@ -33,6 +33,7 @@ namespace CFF {
...
@@ -33,6 +33,7 @@ namespace CFF {
using
namespace
OT
;
using
namespace
OT
;
/* an opstr and the parsed out dict value(s) */
/* an opstr and the parsed out dict value(s) */
template
<
typename
ARG
=
Number
>
struct
DictVal
:
OpStr
struct
DictVal
:
OpStr
{
{
inline
void
init
(
void
)
inline
void
init
(
void
)
...
@@ -46,10 +47,12 @@ struct DictVal : OpStr
...
@@ -46,10 +47,12 @@ struct DictVal : OpStr
multi_val
.
fini
();
multi_val
.
fini
();
}
}
Number
single_val
;
ARG
single_val
;
hb_vector_t
<
Number
>
multi_val
;
hb_vector_t
<
ARG
>
multi_val
;
};
};
typedef
DictVal
<>
NumDictVal
;
template
<
typename
VAL
>
template
<
typename
VAL
>
struct
DictValues
struct
DictValues
{
{
...
@@ -115,9 +118,10 @@ struct TopDictValues : DictValues<OpStr>
...
@@ -115,9 +118,10 @@ struct TopDictValues : DictValues<OpStr>
unsigned
int
FDArrayOffset
;
unsigned
int
FDArrayOffset
;
};
};
struct
DictOpSet
:
OpSet
template
<
typename
ARG
=
Number
>
struct
DictOpSet
:
OpSet
<
ARG
>
{
{
static
inline
bool
process_op
(
OpCode
op
,
InterpEnv
&
env
)
static
inline
bool
process_op
(
OpCode
op
,
InterpEnv
<
ARG
>
&
env
)
{
{
switch
(
op
)
{
switch
(
op
)
{
case
OpCode_longintdict
:
/* 5-byte integer */
case
OpCode_longintdict
:
/* 5-byte integer */
...
@@ -130,7 +134,7 @@ struct DictOpSet : OpSet
...
@@ -130,7 +134,7 @@ struct DictOpSet : OpSet
return
true
;
return
true
;
default:
default:
return
OpSet
::
process_op
(
op
,
env
);
return
OpSet
<
ARG
>
::
process_op
(
op
,
env
);
}
}
return
true
;
return
true
;
...
@@ -161,9 +165,10 @@ struct DictOpSet : OpSet
...
@@ -161,9 +165,10 @@ struct DictOpSet : OpSet
}
}
};
};
struct
TopDictOpSet
:
DictOpSet
template
<
typename
ARG
=
Number
>
struct
TopDictOpSet
:
DictOpSet
<
ARG
>
{
{
static
inline
bool
process_op
(
OpCode
op
,
InterpEnv
&
env
,
TopDictValues
&
dictval
)
static
inline
bool
process_op
(
OpCode
op
,
InterpEnv
<
ARG
>
&
env
,
TopDictValues
&
dictval
)
{
{
switch
(
op
)
{
switch
(
op
)
{
case
OpCode_CharStrings
:
case
OpCode_CharStrings
:
...
@@ -177,30 +182,32 @@ struct TopDictOpSet : DictOpSet
...
@@ -177,30 +182,32 @@ struct TopDictOpSet : DictOpSet
env
.
clear_args
();
env
.
clear_args
();
break
;
break
;
default:
default:
return
DictOpSet
::
process_op
(
op
,
env
);
return
DictOpSet
<
ARG
>
::
process_op
(
op
,
env
);
}
}
return
true
;
return
true
;
}
}
};
};
template
<
typename
OPSET
,
typename
PARAM
>
template
<
typename
OPSET
,
typename
PARAM
,
typename
ENV
=
NumInterpEnv
>
struct
DictInterpreter
:
Interpreter
<
InterpEnv
>
struct
DictInterpreter
:
Interpreter
<
ENV
>
{
{
inline
bool
interpret
(
PARAM
&
param
)
inline
bool
interpret
(
PARAM
&
param
)
{
{
param
.
init
();
param
.
init
();
Interpreter
<
InterpEnv
>
&
super
=
*
this
;
do
do
{
{
OpCode
op
;
OpCode
op
;
if
(
unlikely
(
!
super
.
env
.
fetch_op
(
op
)
||
if
(
unlikely
(
!
SUPER
::
env
.
fetch_op
(
op
)
||
!
OPSET
::
process_op
(
op
,
super
.
env
,
param
)))
!
OPSET
::
process_op
(
op
,
SUPER
::
env
,
param
)))
return
false
;
return
false
;
}
while
(
super
.
env
.
substr
.
avail
());
}
while
(
SUPER
::
env
.
substr
.
avail
());
return
true
;
return
true
;
}
}
private:
typedef
Interpreter
<
ENV
>
SUPER
;
};
};
}
/* namespace CFF */
}
/* namespace CFF */
...
...
src/hb-cff1-interp-cs.hh
浏览文件 @
fcf17788
...
@@ -33,11 +33,11 @@ namespace CFF {
...
@@ -33,11 +33,11 @@ namespace CFF {
using
namespace
OT
;
using
namespace
OT
;
struct
CFF1CSInterpEnv
:
CSInterpEnv
<
CFF1Subrs
>
struct
CFF1CSInterpEnv
:
CSInterpEnv
<
Number
,
CFF1Subrs
>
{
{
inline
void
init
(
const
ByteStr
&
str
,
const
CFF1Subrs
&
globalSubrs
,
const
CFF1Subrs
&
localSubrs
)
inline
void
init
(
const
ByteStr
&
str
,
const
CFF1Subrs
&
globalSubrs
,
const
CFF1Subrs
&
localSubrs
)
{
{
CSInterpEnv
<
CFF1Subrs
>
::
init
(
str
,
globalSubrs
,
localSubrs
);
SUPER
::
init
(
str
,
globalSubrs
,
localSubrs
);
processed_width
=
false
;
processed_width
=
false
;
has_width
=
false
;
has_width
=
false
;
for
(
unsigned
int
i
=
0
;
i
<
kTransientArraySize
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
kTransientArraySize
;
i
++
)
...
@@ -51,9 +51,9 @@ struct CFF1CSInterpEnv : CSInterpEnv<CFF1Subrs>
...
@@ -51,9 +51,9 @@ struct CFF1CSInterpEnv : CSInterpEnv<CFF1Subrs>
{
{
if
(
!
processed_width
)
if
(
!
processed_width
)
{
{
if
((
this
->
argStack
.
count
&
1
)
!=
0
)
if
((
SUPER
::
argStack
.
count
&
1
)
!=
0
)
{
{
width
=
this
->
argStack
.
elements
[
0
];
width
=
SUPER
::
argStack
.
elements
[
0
];
has_width
=
true
;
has_width
=
true
;
}
}
processed_width
=
true
;
processed_width
=
true
;
...
@@ -66,10 +66,13 @@ struct CFF1CSInterpEnv : CSInterpEnv<CFF1Subrs>
...
@@ -66,10 +66,13 @@ struct CFF1CSInterpEnv : CSInterpEnv<CFF1Subrs>
static
const
unsigned
int
kTransientArraySize
=
32
;
static
const
unsigned
int
kTransientArraySize
=
32
;
Number
transient_array
[
kTransientArraySize
];
Number
transient_array
[
kTransientArraySize
];
private:
typedef
CSInterpEnv
<
Number
,
CFF1Subrs
>
SUPER
;
};
};
template
<
typename
OPSET
,
typename
PARAM
>
template
<
typename
OPSET
,
typename
PARAM
>
struct
CFF1CSOpSet
:
CSOpSet
<
OPSET
,
CFF1CSInterpEnv
,
PARAM
>
struct
CFF1CSOpSet
:
CSOpSet
<
Number
,
OPSET
,
CFF1CSInterpEnv
,
PARAM
>
{
{
static
inline
bool
process_op
(
OpCode
op
,
CFF1CSInterpEnv
&
env
,
PARAM
&
param
)
static
inline
bool
process_op
(
OpCode
op
,
CFF1CSInterpEnv
&
env
,
PARAM
&
param
)
{
{
...
@@ -201,7 +204,7 @@ struct CFF1CSOpSet : CSOpSet<OPSET, CFF1CSInterpEnv, PARAM>
...
@@ -201,7 +204,7 @@ struct CFF1CSOpSet : CSOpSet<OPSET, CFF1CSInterpEnv, PARAM>
}
}
private:
private:
typedef
CSOpSet
<
OPSET
,
CFF1CSInterpEnv
,
PARAM
>
SUPER
;
typedef
CSOpSet
<
Number
,
OPSET
,
CFF1CSInterpEnv
,
PARAM
>
SUPER
;
};
};
template
<
typename
OPSET
,
typename
PARAM
>
template
<
typename
OPSET
,
typename
PARAM
>
...
...
src/hb-cff2-interp-cs.hh
浏览文件 @
fcf17788
...
@@ -33,18 +33,18 @@ namespace CFF {
...
@@ -33,18 +33,18 @@ namespace CFF {
using
namespace
OT
;
using
namespace
OT
;
struct
CFF2CSInterpEnv
:
CSInterpEnv
<
CFF2Subrs
>
struct
CFF2CSInterpEnv
:
CSInterpEnv
<
BlendArg
,
CFF2Subrs
>
{
{
inline
void
init
(
const
ByteStr
&
str
,
const
CFF2Subrs
&
globalSubrs_
,
const
CFF2Subrs
&
localSubrs_
)
inline
void
init
(
const
ByteStr
&
str
,
const
CFF2Subrs
&
globalSubrs_
,
const
CFF2Subrs
&
localSubrs_
)
{
{
CSInterpEnv
<
CFF2Subrs
>
::
init
(
str
,
globalSubrs_
,
localSubrs_
);
SUPER
::
init
(
str
,
globalSubrs_
,
localSubrs_
);
ivs
=
0
;
ivs
=
0
;
}
}
inline
bool
fetch_op
(
OpCode
&
op
)
inline
bool
fetch_op
(
OpCode
&
op
)
{
{
if
(
unlikely
(
this
->
substr
.
avail
()))
if
(
unlikely
(
this
->
substr
.
avail
()))
return
CSInterpEnv
<
CFF2Subrs
>
::
fetch_op
(
op
);
return
SUPER
::
fetch_op
(
op
);
/* make up return or endchar op */
/* make up return or endchar op */
if
(
this
->
callStack
.
check_underflow
())
if
(
this
->
callStack
.
check_underflow
())
...
@@ -66,10 +66,12 @@ struct CFF2CSInterpEnv : CSInterpEnv<CFF2Subrs>
...
@@ -66,10 +66,12 @@ struct CFF2CSInterpEnv : CSInterpEnv<CFF2Subrs>
protected:
protected:
unsigned
int
ivs
;
unsigned
int
ivs
;
typedef
CSInterpEnv
<
BlendArg
,
CFF2Subrs
>
SUPER
;
};
};
template
<
typename
OPSET
,
typename
PARAM
>
template
<
typename
OPSET
,
typename
PARAM
>
struct
CFF2CSOpSet
:
CSOpSet
<
OPSET
,
CFF2CSInterpEnv
,
PARAM
>
struct
CFF2CSOpSet
:
CSOpSet
<
BlendArg
,
OPSET
,
CFF2CSInterpEnv
,
PARAM
>
{
{
static
inline
bool
process_op
(
OpCode
op
,
CFF2CSInterpEnv
&
env
,
PARAM
&
param
)
static
inline
bool
process_op
(
OpCode
op
,
CFF2CSInterpEnv
&
env
,
PARAM
&
param
)
{
{
...
@@ -83,7 +85,6 @@ struct CFF2CSOpSet : CSOpSet<OPSET, CFF2CSInterpEnv, PARAM>
...
@@ -83,7 +85,6 @@ struct CFF2CSOpSet : CSOpSet<OPSET, CFF2CSInterpEnv, PARAM>
break
;
break
;
default:
default:
typedef
CSOpSet
<
OPSET
,
CFF2CSInterpEnv
,
PARAM
>
SUPER
;
if
(
unlikely
(
!
SUPER
::
process_op
(
op
,
env
,
param
)))
if
(
unlikely
(
!
SUPER
::
process_op
(
op
,
env
,
param
)))
return
false
;
return
false
;
break
;
break
;
...
@@ -103,6 +104,9 @@ struct CFF2CSOpSet : CSOpSet<OPSET, CFF2CSInterpEnv, PARAM>
...
@@ -103,6 +104,9 @@ struct CFF2CSOpSet : CSOpSet<OPSET, CFF2CSInterpEnv, PARAM>
env
.
process_vsindex
();
env
.
process_vsindex
();
OPSET
::
flush_n_args_and_op
(
OpCode_vsindexcs
,
1
,
env
,
param
);
OPSET
::
flush_n_args_and_op
(
OpCode_vsindexcs
,
1
,
env
,
param
);
}
}
private:
typedef
CSOpSet
<
BlendArg
,
OPSET
,
CFF2CSInterpEnv
,
PARAM
>
SUPER
;
};
};
template
<
typename
OPSET
,
typename
PARAM
>
template
<
typename
OPSET
,
typename
PARAM
>
...
...
src/hb-ot-cff1-table.hh
浏览文件 @
fcf17788
...
@@ -407,9 +407,9 @@ struct CFF1TopDictValues : TopDictValues
...
@@ -407,9 +407,9 @@ struct CFF1TopDictValues : TopDictValues
TableInfo
privateDictInfo
;
TableInfo
privateDictInfo
;
};
};
struct
CFF1TopDictOpSet
:
TopDictOpSet
struct
CFF1TopDictOpSet
:
TopDictOpSet
<>
{
{
static
inline
bool
process_op
(
OpCode
op
,
InterpEnv
&
env
,
CFF1TopDictValues
&
dictval
)
static
inline
bool
process_op
(
OpCode
op
,
Num
InterpEnv
&
env
,
CFF1TopDictValues
&
dictval
)
{
{
switch
(
op
)
{
switch
(
op
)
{
...
@@ -509,9 +509,9 @@ struct CFF1FontDictValues : DictValues<OpStr>
...
@@ -509,9 +509,9 @@ struct CFF1FontDictValues : DictValues<OpStr>
TableInfo
privateDictInfo
;
TableInfo
privateDictInfo
;
};
};
struct
CFF1FontDictOpSet
:
DictOpSet
struct
CFF1FontDictOpSet
:
DictOpSet
<>
{
{
static
inline
bool
process_op
(
OpCode
op
,
InterpEnv
&
env
,
CFF1FontDictValues
&
dictval
)
static
inline
bool
process_op
(
OpCode
op
,
Num
InterpEnv
&
env
,
CFF1FontDictValues
&
dictval
)
{
{
switch
(
op
)
{
switch
(
op
)
{
case
OpCode_FontName
:
case
OpCode_FontName
:
...
@@ -570,13 +570,13 @@ struct CFF1PrivateDictValues_Base : DictValues<VAL>
...
@@ -570,13 +570,13 @@ struct CFF1PrivateDictValues_Base : DictValues<VAL>
};
};
typedef
CFF1PrivateDictValues_Base
<
OpStr
>
CFF1PrivateDictValues_Subset
;
typedef
CFF1PrivateDictValues_Base
<
OpStr
>
CFF1PrivateDictValues_Subset
;
typedef
CFF1PrivateDictValues_Base
<
DictVal
>
CFF1PrivateDictValues
;
typedef
CFF1PrivateDictValues_Base
<
Num
DictVal
>
CFF1PrivateDictValues
;
struct
CFF1PrivateDictOpSet
:
DictOpSet
struct
CFF1PrivateDictOpSet
:
DictOpSet
<>
{
{
static
inline
bool
process_op
(
OpCode
op
,
InterpEnv
&
env
,
CFF1PrivateDictValues
&
dictval
)
static
inline
bool
process_op
(
OpCode
op
,
Num
InterpEnv
&
env
,
CFF1PrivateDictValues
&
dictval
)
{
{
DictVal
val
;
Num
DictVal
val
;
val
.
init
();
val
.
init
();
switch
(
op
)
{
switch
(
op
)
{
...
@@ -622,9 +622,9 @@ struct CFF1PrivateDictOpSet : DictOpSet
...
@@ -622,9 +622,9 @@ struct CFF1PrivateDictOpSet : DictOpSet
}
}
};
};
struct
CFF1PrivateDictOpSet_Subset
:
DictOpSet
struct
CFF1PrivateDictOpSet_Subset
:
DictOpSet
<>
{
{
static
inline
bool
process_op
(
OpCode
op
,
InterpEnv
&
env
,
CFF1PrivateDictValues_Subset
&
dictval
)
static
inline
bool
process_op
(
OpCode
op
,
Num
InterpEnv
&
env
,
CFF1PrivateDictValues_Subset
&
dictval
)
{
{
switch
(
op
)
{
switch
(
op
)
{
case
OpCode_BlueValues
:
case
OpCode_BlueValues
:
...
@@ -690,7 +690,7 @@ struct cff1
...
@@ -690,7 +690,7 @@ struct cff1
likely
(
version
.
major
==
1
));
likely
(
version
.
major
==
1
));
}
}
template
<
typename
P
rivOpSet
,
typename
PrivDictVal
>
template
<
typename
P
RIVOPSET
,
typename
PRIVDICTVAL
>
struct
accelerator_templ_t
struct
accelerator_templ_t
{
{
inline
void
init
(
hb_face_t
*
face
)
inline
void
init
(
hb_face_t
*
face
)
...
@@ -788,10 +788,10 @@ struct cff1
...
@@ -788,10 +788,10 @@ struct cff1
font_interp
.
env
.
init
(
fontDictStr
);
font_interp
.
env
.
init
(
fontDictStr
);
font
=
fontDicts
.
push
();
font
=
fontDicts
.
push
();
if
(
unlikely
(
!
font_interp
.
interpret
(
*
font
)))
{
fini
();
return
;
}
if
(
unlikely
(
!
font_interp
.
interpret
(
*
font
)))
{
fini
();
return
;
}
P
rivDictVal
*
priv
=
&
privateDicts
[
i
];
P
RIVDICTVAL
*
priv
=
&
privateDicts
[
i
];
const
ByteStr
privDictStr
(
StructAtOffset
<
UnsizedByteStr
>
(
cff
,
font
->
privateDictInfo
.
offset
),
font
->
privateDictInfo
.
size
);
const
ByteStr
privDictStr
(
StructAtOffset
<
UnsizedByteStr
>
(
cff
,
font
->
privateDictInfo
.
offset
),
font
->
privateDictInfo
.
size
);
if
(
unlikely
(
!
privDictStr
.
sanitize
(
&
sc
)))
{
fini
();
return
;
}
if
(
unlikely
(
!
privDictStr
.
sanitize
(
&
sc
)))
{
fini
();
return
;
}
DictInterpreter
<
P
rivOpSet
,
PrivDictVal
>
priv_interp
;
DictInterpreter
<
P
RIVOPSET
,
PRIVDICTVAL
>
priv_interp
;
priv_interp
.
env
.
init
(
privDictStr
);
priv_interp
.
env
.
init
(
privDictStr
);
if
(
unlikely
(
!
priv_interp
.
interpret
(
*
priv
)))
{
fini
();
return
;
}
if
(
unlikely
(
!
priv_interp
.
interpret
(
*
priv
)))
{
fini
();
return
;
}
...
@@ -804,11 +804,11 @@ struct cff1
...
@@ -804,11 +804,11 @@ struct cff1
else
/* non-CID */
else
/* non-CID */
{
{
CFF1TopDictValues
*
font
=
&
topDicts
[
0
];
CFF1TopDictValues
*
font
=
&
topDicts
[
0
];
P
rivDictVal
*
priv
=
&
privateDicts
[
0
];
P
RIVDICTVAL
*
priv
=
&
privateDicts
[
0
];
const
ByteStr
privDictStr
(
StructAtOffset
<
UnsizedByteStr
>
(
cff
,
font
->
privateDictInfo
.
offset
),
font
->
privateDictInfo
.
size
);
const
ByteStr
privDictStr
(
StructAtOffset
<
UnsizedByteStr
>
(
cff
,
font
->
privateDictInfo
.
offset
),
font
->
privateDictInfo
.
size
);
if
(
unlikely
(
!
privDictStr
.
sanitize
(
&
sc
)))
{
fini
();
return
;
}
if
(
unlikely
(
!
privDictStr
.
sanitize
(
&
sc
)))
{
fini
();
return
;
}
DictInterpreter
<
P
rivOpSet
,
PrivDictVal
>
priv_interp
;
DictInterpreter
<
P
RIVOPSET
,
PRIVDICTVAL
>
priv_interp
;
priv_interp
.
env
.
init
(
privDictStr
);
priv_interp
.
env
.
init
(
privDictStr
);
if
(
unlikely
(
!
priv_interp
.
interpret
(
*
priv
)))
{
fini
();
return
;
}
if
(
unlikely
(
!
priv_interp
.
interpret
(
*
priv
)))
{
fini
();
return
;
}
...
@@ -861,7 +861,7 @@ struct cff1
...
@@ -861,7 +861,7 @@ struct cff1
hb_vector_t
<
CFF1TopDictValues
>
topDicts
;
hb_vector_t
<
CFF1TopDictValues
>
topDicts
;
hb_vector_t
<
CFF1FontDictValues
>
fontDicts
;
hb_vector_t
<
CFF1FontDictValues
>
fontDicts
;
hb_vector_t
<
P
rivDictVal
>
privateDicts
;
hb_vector_t
<
P
RIVDICTVAL
>
privateDicts
;
unsigned
int
num_glyphs
;
unsigned
int
num_glyphs
;
};
};
...
...
src/hb-ot-cff2-table.hh
浏览文件 @
fcf17788
...
@@ -48,6 +48,13 @@ typedef Subrs<HBUINT32> CFF2Subrs;
...
@@ -48,6 +48,13 @@ typedef Subrs<HBUINT32> CFF2Subrs;
typedef
FDSelect3_4
<
HBUINT32
,
HBUINT16
>
FDSelect4
;
typedef
FDSelect3_4
<
HBUINT32
,
HBUINT16
>
FDSelect4
;
typedef
FDSelect3_4_Range
<
HBUINT32
,
HBUINT16
>
FDSelect4_Range
;
typedef
FDSelect3_4_Range
<
HBUINT32
,
HBUINT16
>
FDSelect4_Range
;
struct
BlendArg
:
Number
{
// XXX: TODO
};
typedef
InterpEnv
<
BlendArg
>
BlendInterpEnv
;
struct
CFF2FDSelect
struct
CFF2FDSelect
{
{
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
unsigned
int
fdcount
)
const
inline
bool
sanitize
(
hb_sanitize_context_t
*
c
,
unsigned
int
fdcount
)
const
...
@@ -173,14 +180,14 @@ struct CFF2TopDictValues : TopDictValues
...
@@ -173,14 +180,14 @@ struct CFF2TopDictValues : TopDictValues
unsigned
int
FDSelectOffset
;
unsigned
int
FDSelectOffset
;
};
};
struct
CFF2TopDictOpSet
:
TopDictOpSet
struct
CFF2TopDictOpSet
:
TopDictOpSet
<>
{
{
static
inline
bool
process_op
(
OpCode
op
,
InterpEnv
&
env
,
CFF2TopDictValues
&
dictval
)
static
inline
bool
process_op
(
OpCode
op
,
Num
InterpEnv
&
env
,
CFF2TopDictValues
&
dictval
)
{
{
switch
(
op
)
{
switch
(
op
)
{
case
OpCode_FontMatrix
:
case
OpCode_FontMatrix
:
{
{
DictVal
val
;
DictVal
<>
val
;
val
.
init
();
val
.
init
();
dictval
.
pushVal
(
op
,
env
.
substr
);
dictval
.
pushVal
(
op
,
env
.
substr
);
env
.
clear_args
();
env
.
clear_args
();
...
@@ -199,7 +206,7 @@ struct CFF2TopDictOpSet : TopDictOpSet
...
@@ -199,7 +206,7 @@ struct CFF2TopDictOpSet : TopDictOpSet
break
;
break
;
default:
default:
if
(
unlikely
(
!
TopDictOpSet
::
process_op
(
op
,
env
,
dictval
)))
if
(
unlikely
(
!
SUPER
::
process_op
(
op
,
env
,
dictval
)))
return
false
;
return
false
;
/* Record this operand below if stack is empty, otherwise done */
/* Record this operand below if stack is empty, otherwise done */
if
(
!
env
.
argStack
.
is_empty
())
return
true
;
if
(
!
env
.
argStack
.
is_empty
())
return
true
;
...
@@ -208,6 +215,8 @@ struct CFF2TopDictOpSet : TopDictOpSet
...
@@ -208,6 +215,8 @@ struct CFF2TopDictOpSet : TopDictOpSet
dictval
.
pushVal
(
op
,
env
.
substr
);
dictval
.
pushVal
(
op
,
env
.
substr
);
return
true
;
return
true
;
}
}
typedef
TopDictOpSet
<>
SUPER
;
};
};
struct
CFF2FontDictValues
:
DictValues
<
OpStr
>
struct
CFF2FontDictValues
:
DictValues
<
OpStr
>
...
@@ -226,9 +235,9 @@ struct CFF2FontDictValues : DictValues<OpStr>
...
@@ -226,9 +235,9 @@ struct CFF2FontDictValues : DictValues<OpStr>
TableInfo
privateDictInfo
;
TableInfo
privateDictInfo
;
};
};
struct
CFF2FontDictOpSet
:
DictOpSet
struct
CFF2FontDictOpSet
:
DictOpSet
<>
{
{
static
inline
bool
process_op
(
OpCode
op
,
InterpEnv
&
env
,
CFF2FontDictValues
&
dictval
)
static
inline
bool
process_op
(
OpCode
op
,
Num
InterpEnv
&
env
,
CFF2FontDictValues
&
dictval
)
{
{
switch
(
op
)
{
switch
(
op
)
{
case
OpCode_Private
:
case
OpCode_Private
:
...
@@ -240,7 +249,7 @@ struct CFF2FontDictOpSet : DictOpSet
...
@@ -240,7 +249,7 @@ struct CFF2FontDictOpSet : DictOpSet
break
;
break
;
default:
default:
if
(
unlikely
(
!
DictOpSet
::
process_op
(
op
,
env
)))
if
(
unlikely
(
!
SUPER
::
process_op
(
op
,
env
)))
return
false
;
return
false
;
if
(
!
env
.
argStack
.
is_empty
())
if
(
!
env
.
argStack
.
is_empty
())
return
true
;
return
true
;
...
@@ -249,6 +258,9 @@ struct CFF2FontDictOpSet : DictOpSet
...
@@ -249,6 +258,9 @@ struct CFF2FontDictOpSet : DictOpSet
dictval
.
pushVal
(
op
,
env
.
substr
);
dictval
.
pushVal
(
op
,
env
.
substr
);
return
true
;
return
true
;
}
}
private:
typedef
DictOpSet
<>
SUPER
;
};
};
template
<
typename
VAL
>
template
<
typename
VAL
>
...
@@ -281,14 +293,15 @@ struct CFF2PrivateDictValues_Base : DictValues<VAL>
...
@@ -281,14 +293,15 @@ struct CFF2PrivateDictValues_Base : DictValues<VAL>
const
CFF2Subrs
*
localSubrs
;
const
CFF2Subrs
*
localSubrs
;
};
};
typedef
DictVal
<
BlendArg
>
BlendDictVal
;
typedef
CFF2PrivateDictValues_Base
<
OpStr
>
CFF2PrivateDictValues_Subset
;
typedef
CFF2PrivateDictValues_Base
<
OpStr
>
CFF2PrivateDictValues_Subset
;
typedef
CFF2PrivateDictValues_Base
<
DictVal
>
CFF2PrivateDictValues
;
typedef
CFF2PrivateDictValues_Base
<
Num
DictVal
>
CFF2PrivateDictValues
;
struct
CFF2PrivateDictOpSet
:
DictOpSet
struct
CFF2PrivateDictOpSet
:
DictOpSet
<>
{
{
static
inline
bool
process_op
(
OpCode
op
,
InterpEnv
&
env
,
CFF2PrivateDictValues
&
dictval
)
static
inline
bool
process_op
(
OpCode
op
,
Num
InterpEnv
&
env
,
CFF2PrivateDictValues
&
dictval
)
{
{
DictVal
val
;
Num
DictVal
val
;
val
.
init
();
val
.
init
();
switch
(
op
)
{
switch
(
op
)
{
...
@@ -335,9 +348,9 @@ struct CFF2PrivateDictOpSet : DictOpSet
...
@@ -335,9 +348,9 @@ struct CFF2PrivateDictOpSet : DictOpSet
}
}
};
};
struct
CFF2PrivateDictOpSet_Subset
:
DictOpSet
struct
CFF2PrivateDictOpSet_Subset
:
DictOpSet
<
Number
>
{
{
static
inline
bool
process_op
(
OpCode
op
,
InterpEnv
&
env
,
CFF2PrivateDictValues_Subset
&
dictval
)
static
inline
bool
process_op
(
OpCode
op
,
Num
InterpEnv
&
env
,
CFF2PrivateDictValues_Subset
&
dictval
)
{
{
switch
(
op
)
{
switch
(
op
)
{
case
OpCode_BlueValues
:
case
OpCode_BlueValues
:
...
@@ -367,7 +380,7 @@ struct CFF2PrivateDictOpSet_Subset : DictOpSet
...
@@ -367,7 +380,7 @@ struct CFF2PrivateDictOpSet_Subset : DictOpSet
break
;
break
;
default:
default:
if
(
unlikely
(
!
DictOpSet
::
process_op
(
op
,
env
)))
if
(
unlikely
(
!
SUPER
::
process_op
(
op
,
env
)))
return
false
;
return
false
;
if
(
!
env
.
argStack
.
is_empty
())
return
true
;
if
(
!
env
.
argStack
.
is_empty
())
return
true
;
break
;
break
;
...
@@ -376,11 +389,13 @@ struct CFF2PrivateDictOpSet_Subset : DictOpSet
...
@@ -376,11 +389,13 @@ struct CFF2PrivateDictOpSet_Subset : DictOpSet
dictval
.
pushVal
(
op
,
env
.
substr
);
dictval
.
pushVal
(
op
,
env
.
substr
);
return
true
;
return
true
;
}
}
private:
typedef
DictOpSet
<
Number
>
SUPER
;
};
};
typedef
DictInterpreter
<
CFF2TopDictOpSet
,
CFF2TopDictValues
>
CFF2TopDict_Interpreter
;
typedef
DictInterpreter
<
CFF2TopDictOpSet
,
CFF2TopDictValues
>
CFF2TopDict_Interpreter
;
typedef
DictInterpreter
<
CFF2FontDictOpSet
,
CFF2FontDictValues
>
CFF2FontDict_Interpreter
;
typedef
DictInterpreter
<
CFF2FontDictOpSet
,
CFF2FontDictValues
>
CFF2FontDict_Interpreter
;
typedef
DictInterpreter
<
CFF2PrivateDictOpSet
,
CFF2PrivateDictValues
>
CFF2PrivateDict_Interpreter
;
};
/* namespace CFF */
};
/* namespace CFF */
...
@@ -399,7 +414,7 @@ struct cff2
...
@@ -399,7 +414,7 @@ struct cff2
likely
(
version
.
major
==
2
));
likely
(
version
.
major
==
2
));
}
}
template
<
typename
P
rivOpSet
,
typename
PrivDictVal
>
template
<
typename
P
RIVOPSET
,
typename
PRIVDICTVAL
>
struct
accelerator_templ_t
struct
accelerator_templ_t
{
{
inline
void
init
(
hb_face_t
*
face
)
inline
void
init
(
hb_face_t
*
face
)
...
@@ -459,7 +474,7 @@ struct cff2
...
@@ -459,7 +474,7 @@ struct cff2
const
ByteStr
privDictStr
(
StructAtOffsetOrNull
<
UnsizedByteStr
>
(
cff2
,
font
->
privateDictInfo
.
offset
),
font
->
privateDictInfo
.
size
);
const
ByteStr
privDictStr
(
StructAtOffsetOrNull
<
UnsizedByteStr
>
(
cff2
,
font
->
privateDictInfo
.
offset
),
font
->
privateDictInfo
.
size
);
if
(
unlikely
(
!
privDictStr
.
sanitize
(
&
sc
)))
{
fini
();
return
;
}
if
(
unlikely
(
!
privDictStr
.
sanitize
(
&
sc
)))
{
fini
();
return
;
}
DictInterpreter
<
P
rivOpSet
,
PrivDictVal
>
priv_interp
;
DictInterpreter
<
P
RIVOPSET
,
PRIVDICTVAL
>
priv_interp
;
priv_interp
.
env
.
init
(
privDictStr
);
priv_interp
.
env
.
init
(
privDictStr
);
if
(
unlikely
(
!
priv_interp
.
interpret
(
privateDicts
[
i
])))
{
fini
();
return
;
}
if
(
unlikely
(
!
priv_interp
.
interpret
(
privateDicts
[
i
])))
{
fini
();
return
;
}
...
@@ -505,7 +520,7 @@ struct cff2
...
@@ -505,7 +520,7 @@ struct cff2
unsigned
int
fdCount
;
unsigned
int
fdCount
;
hb_vector_t
<
CFF2FontDictValues
>
fontDicts
;
hb_vector_t
<
CFF2FontDictValues
>
fontDicts
;
hb_vector_t
<
P
rivDictVal
>
privateDicts
;
hb_vector_t
<
P
RIVDICTVAL
>
privateDicts
;
unsigned
int
num_glyphs
;
unsigned
int
num_glyphs
;
};
};
...
...
src/hb-subset-cff-common.hh
浏览文件 @
fcf17788
...
@@ -219,7 +219,7 @@ struct CFFPrivateDict_OpSerializer : OpSerializer
...
@@ -219,7 +219,7 @@ struct CFFPrivateDict_OpSerializer : OpSerializer
{
{
TRACE_SERIALIZE
(
this
);
TRACE_SERIALIZE
(
this
);
if
(
drop_hints
&&
DictOpSet
::
is_hint_op
(
opstr
.
op
))
if
(
drop_hints
&&
DictOpSet
<>
::
is_hint_op
(
opstr
.
op
))
return
true
;
return
true
;
if
(
opstr
.
op
==
OpCode_Subrs
)
if
(
opstr
.
op
==
OpCode_Subrs
)
{
{
...
@@ -234,7 +234,7 @@ struct CFFPrivateDict_OpSerializer : OpSerializer
...
@@ -234,7 +234,7 @@ struct CFFPrivateDict_OpSerializer : OpSerializer
inline
unsigned
int
calculate_serialized_size
(
const
OpStr
&
opstr
)
const
inline
unsigned
int
calculate_serialized_size
(
const
OpStr
&
opstr
)
const
{
{
if
(
drop_hints
&&
DictOpSet
::
is_hint_op
(
opstr
.
op
))
if
(
drop_hints
&&
DictOpSet
<>
::
is_hint_op
(
opstr
.
op
))
return
0
;
return
0
;
if
(
opstr
.
op
==
OpCode_Subrs
)
if
(
opstr
.
op
==
OpCode_Subrs
)
{
{
...
...
src/hb-subset-cff1.cc
浏览文件 @
fcf17788
...
@@ -154,7 +154,6 @@ struct CFF1CSOpSet_Flatten : CFF1CSOpSet<CFF1CSOpSet_Flatten, FlattenParam>
...
@@ -154,7 +154,6 @@ struct CFF1CSOpSet_Flatten : CFF1CSOpSet<CFF1CSOpSet_Flatten, FlattenParam>
private:
private:
typedef
CFF1CSOpSet
<
CFF1CSOpSet_Flatten
,
FlattenParam
>
SUPER
;
typedef
CFF1CSOpSet
<
CFF1CSOpSet_Flatten
,
FlattenParam
>
SUPER
;
typedef
CSOpSet
<
CFF1CSOpSet_Flatten
,
CFF1CSInterpEnv
,
FlattenParam
>
CSOPSET
;
};
};
struct
CFF1CSOpSet_SubsetSubrs
:
CFF1CSOpSet
<
CFF1CSOpSet_SubsetSubrs
,
SubrRefMapPair
>
struct
CFF1CSOpSet_SubsetSubrs
:
CFF1CSOpSet
<
CFF1CSOpSet_SubsetSubrs
,
SubrRefMapPair
>
...
...
src/hb-subset-cff2.cc
浏览文件 @
fcf17788
...
@@ -129,7 +129,7 @@ struct CFF2CSOpSet_Flatten : CFF2CSOpSet<CFF2CSOpSet_Flatten, FlattenParam>
...
@@ -129,7 +129,7 @@ struct CFF2CSOpSet_Flatten : CFF2CSOpSet<CFF2CSOpSet_Flatten, FlattenParam>
private:
private:
typedef
CFF2CSOpSet
<
CFF2CSOpSet_Flatten
,
FlattenParam
>
SUPER
;
typedef
CFF2CSOpSet
<
CFF2CSOpSet_Flatten
,
FlattenParam
>
SUPER
;
typedef
CSOpSet
<
CFF2CSOpSet_Flatten
,
CFF2CSInterpEnv
,
FlattenParam
>
CSOPSET
;
typedef
CSOpSet
<
BlendArg
,
CFF2CSOpSet_Flatten
,
CFF2CSInterpEnv
,
FlattenParam
>
CSOPSET
;
};
};
struct
CFF2CSOpSet_SubsetSubrs
:
CFF2CSOpSet
<
CFF2CSOpSet_SubsetSubrs
,
SubrRefMapPair
>
struct
CFF2CSOpSet_SubsetSubrs
:
CFF2CSOpSet
<
CFF2CSOpSet_SubsetSubrs
,
SubrRefMapPair
>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录