struct AxisValueFormat1
{
+ hb_ot_name_id_t get_value_name_id () const { return valueNameID; }
+
bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
return_trace (likely (c->check_struct (this)));
}
- hb_ot_name_id_t get_value_name_id () const { return valueNameID; }
-
protected:
HBUINT16 format; /* Format identifier — set to 1. */
HBUINT16 axisIndex; /* Zero-base index into the axis record array
struct AxisValueFormat2
{
+ hb_ot_name_id_t get_value_name_id () const { return valueNameID; }
+
bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
return_trace (likely (c->check_struct (this)));
}
- hb_ot_name_id_t get_value_name_id () const { return valueNameID; }
-
protected:
HBUINT16 format; /* Format identifier — set to 2. */
HBUINT16 axisIndex; /* Zero-base index into the axis record array
struct AxisValueFormat3
{
+ hb_ot_name_id_t get_value_name_id () const { return valueNameID; }
+
bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
return_trace (likely (c->check_struct (this)));
}
- hb_ot_name_id_t get_value_name_id () const { return valueNameID; }
-
protected:
HBUINT16 format; /* Format identifier — set to 3. */
HBUINT16 axisIndex; /* Zero-base index into the axis record array
struct AxisValueFormat4
{
+ hb_ot_name_id_t get_value_name_id () const { return valueNameID; }
+
bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
return_trace (likely (c->check_struct (this)));
}
- hb_ot_name_id_t get_value_name_id () const { return valueNameID; }
-
protected:
HBUINT16 format; /* Format identifier — set to 4. */
HBUINT16 axisCount; /* The total number of axes contributing to
struct AxisValue
{
- bool sanitize (hb_sanitize_context_t *c) const
+ hb_ot_name_id_t get_value_name_id () const
{
- TRACE_SANITIZE (this);
- if (unlikely (!c->check_struct (this)))
- return_trace (false);
-
switch (u.format)
{
- case 1: return_trace (u.format1.sanitize (c));
- case 2: return_trace (u.format2.sanitize (c));
- case 3: return_trace (u.format3.sanitize (c));
- case 4: return_trace (u.format4.sanitize (c));
- default: return_trace (true);
+ case 1: return u.format1.get_value_name_id ();
+ case 2: return u.format2.get_value_name_id ();
+ case 3: return u.format3.get_value_name_id ();
+ case 4: return u.format4.get_value_name_id ();
+ default:return HB_OT_NAME_ID_INVALID;
}
}
- hb_ot_name_id_t get_value_name_id () const
+ bool sanitize (hb_sanitize_context_t *c) const
{
+ TRACE_SANITIZE (this);
+ if (unlikely (!c->check_struct (this)))
+ return_trace (false);
+
switch (u.format)
{
- case 1: return u.format1.get_value_name_id ();
- case 2: return u.format2.get_value_name_id ();
- case 3: return u.format3.get_value_name_id ();
- case 4: return u.format4.get_value_name_id ();
- default: return HB_OT_NAME_ID_INVALID;
+ case 1: return_trace (u.format1.sanitize (c));
+ case 2: return_trace (u.format2.sanitize (c));
+ case 3: return_trace (u.format3.sanitize (c));
+ case 4: return_trace (u.format4.sanitize (c));
+ default:return_trace (true);
}
}
struct StatAxisRecord
{
+ hb_ot_name_id_t get_name_id () const { return nameID; }
+
bool sanitize (hb_sanitize_context_t *c) const
{
TRACE_SANITIZE (this);
return_trace (likely (c->check_struct (this)));
}
- hb_ot_name_id_t get_name_id () const { return nameID; }
-
protected:
Tag tag; /* A tag identifying the axis of design variation. */
NameID nameID; /* The name ID for entries in the 'name' table that
{
static constexpr hb_tag_t tableTag = HB_OT_TAG_STAT;
- bool sanitize (hb_sanitize_context_t *c) const
- {
- TRACE_SANITIZE (this);
- return_trace (likely (c->check_struct (this) &&
- version.major == 1 &&
- version.minor > 0 &&
- designAxesOffset.sanitize (c, this, designAxisCount) &&
- offsetToAxisValueOffsets.sanitize (c, this, axisValueCount, &(this+offsetToAxisValueOffsets))));
- }
-
bool has_data () const { return version.to_int (); }
unsigned get_design_axis_count () const { return designAxisCount; }
;
}
+ bool sanitize (hb_sanitize_context_t *c) const
+ {
+ TRACE_SANITIZE (this);
+ return_trace (likely (c->check_struct (this) &&
+ version.major == 1 &&
+ version.minor > 0 &&
+ designAxesOffset.sanitize (c, this, designAxisCount) &&
+ offsetToAxisValueOffsets.sanitize (c, this, axisValueCount, &(this+offsetToAxisValueOffsets))));
+ }
+
protected:
hb_array_t<const StatAxisRecord> const get_design_axes () const
{ return (this+designAxesOffset).as_array (designAxisCount); }