reject nested seac
This commit is contained in:
parent
c37aecd41c
commit
13735570f0
|
@ -44,6 +44,7 @@ struct CFF1CSInterpEnv : CSInterpEnv<Number, CFF1Subrs>
|
||||||
processed_width = false;
|
processed_width = false;
|
||||||
has_width = false;
|
has_width = false;
|
||||||
arg_start = 0;
|
arg_start = 0;
|
||||||
|
in_seac = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void fini (void)
|
inline void fini (void)
|
||||||
|
@ -71,10 +72,13 @@ struct CFF1CSInterpEnv : CSInterpEnv<Number, CFF1Subrs>
|
||||||
SUPER::clear_args ();
|
SUPER::clear_args ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline void set_in_seac (bool _in_seac) { in_seac = _in_seac; }
|
||||||
|
|
||||||
bool processed_width;
|
bool processed_width;
|
||||||
bool has_width;
|
bool has_width;
|
||||||
unsigned int arg_start;
|
unsigned int arg_start;
|
||||||
Number width;
|
Number width;
|
||||||
|
bool in_seac;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef CSInterpEnv<Number, CFF1Subrs> SUPER;
|
typedef CSInterpEnv<Number, CFF1Subrs> SUPER;
|
||||||
|
|
|
@ -261,7 +261,7 @@ struct CFF1PathProcs_Extents : PathProcs<CFF1PathProcs_Extents, CFF1CSInterpEnv,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
static bool _get_bounds (const OT::cff1::accelerator_t *cff, hb_codepoint_t glyph, Bounds &bounds);
|
static bool _get_bounds (const OT::cff1::accelerator_t *cff, hb_codepoint_t glyph, Bounds &bounds, bool in_seac=false);
|
||||||
|
|
||||||
struct CFF1CSOpSet_Extents : CFF1CSOpSet<CFF1CSOpSet_Extents, ExtentsParam, CFF1PathProcs_Extents>
|
struct CFF1CSOpSet_Extents : CFF1CSOpSet<CFF1CSOpSet_Extents, ExtentsParam, CFF1PathProcs_Extents>
|
||||||
{
|
{
|
||||||
|
@ -275,9 +275,9 @@ struct CFF1CSOpSet_Extents : CFF1CSOpSet<CFF1CSOpSet_Extents, ExtentsParam, CFF1
|
||||||
hb_codepoint_t accent = param.cff->std_code_to_glyph (env.argStack[n-1].to_int ());
|
hb_codepoint_t accent = param.cff->std_code_to_glyph (env.argStack[n-1].to_int ());
|
||||||
|
|
||||||
Bounds base_bounds, accent_bounds;
|
Bounds base_bounds, accent_bounds;
|
||||||
if (likely (base && accent
|
if (likely (!env.in_seac && base && accent
|
||||||
&& _get_bounds (param.cff, base, base_bounds)
|
&& _get_bounds (param.cff, base, base_bounds, true)
|
||||||
&& _get_bounds (param.cff, accent, accent_bounds)))
|
&& _get_bounds (param.cff, accent, accent_bounds, true)))
|
||||||
{
|
{
|
||||||
param.bounds.merge (base_bounds);
|
param.bounds.merge (base_bounds);
|
||||||
accent_bounds.offset (delta);
|
accent_bounds.offset (delta);
|
||||||
|
@ -288,7 +288,7 @@ struct CFF1CSOpSet_Extents : CFF1CSOpSet<CFF1CSOpSet_Extents, ExtentsParam, CFF1
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
bool _get_bounds (const OT::cff1::accelerator_t *cff, hb_codepoint_t glyph, Bounds &bounds)
|
bool _get_bounds (const OT::cff1::accelerator_t *cff, hb_codepoint_t glyph, Bounds &bounds, bool in_seac)
|
||||||
{
|
{
|
||||||
bounds.init ();
|
bounds.init ();
|
||||||
if (unlikely (!cff->is_valid () || (glyph >= cff->num_glyphs))) return false;
|
if (unlikely (!cff->is_valid () || (glyph >= cff->num_glyphs))) return false;
|
||||||
|
@ -297,6 +297,7 @@ bool _get_bounds (const OT::cff1::accelerator_t *cff, hb_codepoint_t glyph, Boun
|
||||||
CFF1CSInterpreter<CFF1CSOpSet_Extents, ExtentsParam> interp;
|
CFF1CSInterpreter<CFF1CSOpSet_Extents, ExtentsParam> interp;
|
||||||
const ByteStr str = (*cff->charStrings)[glyph];
|
const ByteStr str = (*cff->charStrings)[glyph];
|
||||||
interp.env.init (str, *cff, fd);
|
interp.env.init (str, *cff, fd);
|
||||||
|
interp.env.set_in_seac (in_seac);
|
||||||
ExtentsParam param;
|
ExtentsParam param;
|
||||||
param.init (cff);
|
param.init (cff);
|
||||||
if (unlikely (!interp.interpret (param))) return false;
|
if (unlikely (!interp.interpret (param))) return false;
|
||||||
|
|
Loading…
Reference in New Issue