minor, tweak spaces
This commit is contained in:
parent
33c3d63a0a
commit
ce114d6b27
|
@ -80,10 +80,10 @@ struct fdsc
|
||||||
Weight = HB_TAG ('w','g','h','t'),
|
Weight = HB_TAG ('w','g','h','t'),
|
||||||
/* Percent weight relative to regular weight.
|
/* Percent weight relative to regular weight.
|
||||||
* (defaul value: 1.0) */
|
* (defaul value: 1.0) */
|
||||||
Width = HB_TAG ('w','d','t','h'),
|
Width = HB_TAG ('w','d','t','h'),
|
||||||
/* Percent width relative to regular width.
|
/* Percent width relative to regular width.
|
||||||
* (default value: 1.0) */
|
* (default value: 1.0) */
|
||||||
Slant = HB_TAG ('s','l','n','t'),
|
Slant = HB_TAG ('s','l','n','t'),
|
||||||
/* Angle of slant in degrees, where positive
|
/* Angle of slant in degrees, where positive
|
||||||
* is clockwise from straight up.
|
* is clockwise from straight up.
|
||||||
* (default value: 0.0) */
|
* (default value: 0.0) */
|
||||||
|
|
|
@ -81,7 +81,7 @@ struct ankr
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
HBUINT16 version; /* Version number (set to zero) */
|
HBUINT16 version; /* Version number (set to zero) */
|
||||||
HBUINT16 flags; /* Flags (currently unused; set to zero) */
|
HBUINT16 flags; /* Flags (currently unused; set to zero) */
|
||||||
LOffsetTo<Lookup<NNOffsetTo<GlyphAnchors>>>
|
LOffsetTo<Lookup<NNOffsetTo<GlyphAnchors>>>
|
||||||
lookupTable; /* Offset to the table's lookup table */
|
lookupTable; /* Offset to the table's lookup table */
|
||||||
|
|
|
@ -51,10 +51,10 @@ struct ActionSubrecordHeader
|
||||||
return_trace (likely (c->check_struct (this)));
|
return_trace (likely (c->check_struct (this)));
|
||||||
}
|
}
|
||||||
|
|
||||||
HBUINT16 actionClass; /* The JustClass value associated with this
|
HBUINT16 actionClass; /* The JustClass value associated with this
|
||||||
* ActionSubrecord. */
|
* ActionSubrecord. */
|
||||||
HBUINT16 actionType; /* The type of postcompensation action. */
|
HBUINT16 actionType; /* The type of postcompensation action. */
|
||||||
HBUINT16 actionLength; /* Length of this ActionSubrecord record, which
|
HBUINT16 actionLength; /* Length of this ActionSubrecord record, which
|
||||||
* must be a multiple of 4. */
|
* must be a multiple of 4. */
|
||||||
public:
|
public:
|
||||||
DEFINE_SIZE_STATIC (6);
|
DEFINE_SIZE_STATIC (6);
|
||||||
|
@ -70,11 +70,11 @@ struct DecompositionAction
|
||||||
|
|
||||||
ActionSubrecordHeader
|
ActionSubrecordHeader
|
||||||
header;
|
header;
|
||||||
HBFixed lowerLimit; /* If the distance factor is less than this value,
|
HBFixed lowerLimit; /* If the distance factor is less than this value,
|
||||||
* then the ligature is decomposed. */
|
* then the ligature is decomposed. */
|
||||||
HBFixed upperLimit; /* If the distance factor is greater than this value,
|
HBFixed upperLimit; /* If the distance factor is greater than this value,
|
||||||
* then the ligature is decomposed. */
|
* then the ligature is decomposed. */
|
||||||
HBUINT16 order; /* Numerical order in which this ligature will
|
HBUINT16 order; /* Numerical order in which this ligature will
|
||||||
* be decomposed; you may want infrequent ligatures
|
* be decomposed; you may want infrequent ligatures
|
||||||
* to decompose before more frequent ones. The ligatures
|
* to decompose before more frequent ones. The ligatures
|
||||||
* on the line of text will decompose in increasing
|
* on the line of text will decompose in increasing
|
||||||
|
@ -118,14 +118,14 @@ struct ConditionalAddGlyphAction
|
||||||
protected:
|
protected:
|
||||||
ActionSubrecordHeader
|
ActionSubrecordHeader
|
||||||
header;
|
header;
|
||||||
HBFixed substThreshold; /* Distance growth factor (in ems) at which
|
HBFixed substThreshold; /* Distance growth factor (in ems) at which
|
||||||
* this glyph is replaced and the growth factor
|
* this glyph is replaced and the growth factor
|
||||||
* recalculated. */
|
* recalculated. */
|
||||||
HBGlyphID addGlyph; /* Glyph to be added as kashida. If this value is
|
HBGlyphID addGlyph; /* Glyph to be added as kashida. If this value is
|
||||||
* 0xFFFF, no extra glyph will be added. Note that
|
* 0xFFFF, no extra glyph will be added. Note that
|
||||||
* generally when a glyph is added, justification
|
* generally when a glyph is added, justification
|
||||||
* will need to be redone. */
|
* will need to be redone. */
|
||||||
HBGlyphID substGlyph; /* Glyph to be substituted for this glyph if the
|
HBGlyphID substGlyph; /* Glyph to be substituted for this glyph if the
|
||||||
* growth factor equals or exceeds the value of
|
* growth factor equals or exceeds the value of
|
||||||
* substThreshold. */
|
* substThreshold. */
|
||||||
public:
|
public:
|
||||||
|
@ -143,16 +143,16 @@ struct DuctileGlyphAction
|
||||||
protected:
|
protected:
|
||||||
ActionSubrecordHeader
|
ActionSubrecordHeader
|
||||||
header;
|
header;
|
||||||
HBUINT32 variationAxis; /* The 4-byte tag identifying the ductile axis.
|
HBUINT32 variationAxis; /* The 4-byte tag identifying the ductile axis.
|
||||||
* This would normally be 0x64756374 ('duct'),
|
* This would normally be 0x64756374 ('duct'),
|
||||||
* but you may use any axis the font contains. */
|
* but you may use any axis the font contains. */
|
||||||
HBFixed minimumLimit; /* The lowest value for the ductility axis tha
|
HBFixed minimumLimit; /* The lowest value for the ductility axis tha
|
||||||
* still yields an acceptable appearance. Normally
|
* still yields an acceptable appearance. Normally
|
||||||
* this will be 1.0. */
|
* this will be 1.0. */
|
||||||
HBFixed noStretchValue; /* This is the default value that corresponds to
|
HBFixed noStretchValue; /* This is the default value that corresponds to
|
||||||
* no change in appearance. Normally, this will
|
* no change in appearance. Normally, this will
|
||||||
* be 1.0. */
|
* be 1.0. */
|
||||||
HBFixed maximumLimit; /* The highest value for the ductility axis that
|
HBFixed maximumLimit; /* The highest value for the ductility axis that
|
||||||
* still yields an acceptable appearance. */
|
* still yields an acceptable appearance. */
|
||||||
public:
|
public:
|
||||||
DEFINE_SIZE_STATIC (22);
|
DEFINE_SIZE_STATIC (22);
|
||||||
|
@ -169,8 +169,8 @@ struct RepeatedAddGlyphAction
|
||||||
protected:
|
protected:
|
||||||
ActionSubrecordHeader
|
ActionSubrecordHeader
|
||||||
header;
|
header;
|
||||||
HBUINT16 flags; /* Currently unused; set to 0. */
|
HBUINT16 flags; /* Currently unused; set to 0. */
|
||||||
HBGlyphID glyph; /* Glyph that should be added if the distance factor
|
HBGlyphID glyph; /* Glyph that should be added if the distance factor
|
||||||
* is growing. */
|
* is growing. */
|
||||||
public:
|
public:
|
||||||
DEFINE_SIZE_STATIC (10);
|
DEFINE_SIZE_STATIC (10);
|
||||||
|
@ -361,7 +361,7 @@ struct JustificationHeader
|
||||||
OffsetTo<JustificationCategory>
|
OffsetTo<JustificationCategory>
|
||||||
justClassTable; /* Offset to the justification category state table. */
|
justClassTable; /* Offset to the justification category state table. */
|
||||||
OffsetTo<WidthDeltaCluster>
|
OffsetTo<WidthDeltaCluster>
|
||||||
wdcTable; /* Offset from start of justification table to start
|
wdcTable; /* Offset from start of justification table to start
|
||||||
* of the subtable containing the width delta factors
|
* of the subtable containing the width delta factors
|
||||||
* for the glyphs in your font.
|
* for the glyphs in your font.
|
||||||
*
|
*
|
||||||
|
@ -372,7 +372,7 @@ struct JustificationHeader
|
||||||
*
|
*
|
||||||
* The postcompensation subtable, if present in the font. */
|
* The postcompensation subtable, if present in the font. */
|
||||||
Lookup<OffsetTo<WidthDeltaCluster>>
|
Lookup<OffsetTo<WidthDeltaCluster>>
|
||||||
lookupTable; /* Lookup table associating glyphs with width delta
|
lookupTable; /* Lookup table associating glyphs with width delta
|
||||||
* clusters. See the description of Width Delta Clusters
|
* clusters. See the description of Width Delta Clusters
|
||||||
* table for details on how to interpret the lookup values. */
|
* table for details on how to interpret the lookup values. */
|
||||||
|
|
||||||
|
@ -397,7 +397,7 @@ struct just
|
||||||
protected:
|
protected:
|
||||||
FixedVersion<>version; /* Version of the justification table
|
FixedVersion<>version; /* Version of the justification table
|
||||||
* (0x00010000u for version 1.0). */
|
* (0x00010000u for version 1.0). */
|
||||||
HBUINT16 format; /* Format of the justification table (set to 0). */
|
HBUINT16 format; /* Format of the justification table (set to 0). */
|
||||||
OffsetTo<JustificationHeader>
|
OffsetTo<JustificationHeader>
|
||||||
horizData; /* Byte offset from the start of the justification table
|
horizData; /* Byte offset from the start of the justification table
|
||||||
* to the header for tables that contain justification
|
* to the header for tables that contain justification
|
||||||
|
|
|
@ -210,8 +210,8 @@ struct trak
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
FixedVersion<>version; /* Version of the tracking table
|
FixedVersion<>version; /* Version of the tracking table
|
||||||
* (0x00010000u for version 1.0). */
|
* (0x00010000u for version 1.0). */
|
||||||
HBUINT16 format; /* Format of the tracking table (set to 0). */
|
HBUINT16 format; /* Format of the tracking table (set to 0). */
|
||||||
OffsetTo<TrackData>
|
OffsetTo<TrackData>
|
||||||
horizData; /* Offset from start of tracking table to TrackData
|
horizData; /* Offset from start of tracking table to TrackData
|
||||||
* for horizontal text (or 0 if none). */
|
* for horizontal text (or 0 if none). */
|
||||||
|
|
|
@ -229,7 +229,7 @@ _hb_debug_msg<0> (const char *what HB_UNUSED,
|
||||||
...) {}
|
...) {}
|
||||||
|
|
||||||
#define DEBUG_MSG_LEVEL(WHAT, OBJ, LEVEL, LEVEL_DIR, ...) _hb_debug_msg<HB_DEBUG_##WHAT> (#WHAT, (OBJ), nullptr, true, (LEVEL), (LEVEL_DIR), __VA_ARGS__)
|
#define DEBUG_MSG_LEVEL(WHAT, OBJ, LEVEL, LEVEL_DIR, ...) _hb_debug_msg<HB_DEBUG_##WHAT> (#WHAT, (OBJ), nullptr, true, (LEVEL), (LEVEL_DIR), __VA_ARGS__)
|
||||||
#define DEBUG_MSG(WHAT, OBJ, ...) _hb_debug_msg<HB_DEBUG_##WHAT> (#WHAT, (OBJ), nullptr, false, 0, 0, __VA_ARGS__)
|
#define DEBUG_MSG(WHAT, OBJ, ...) _hb_debug_msg<HB_DEBUG_##WHAT> (#WHAT, (OBJ), nullptr, false, 0, 0, __VA_ARGS__)
|
||||||
#define DEBUG_MSG_FUNC(WHAT, OBJ, ...) _hb_debug_msg<HB_DEBUG_##WHAT> (#WHAT, (OBJ), HB_FUNC, false, 0, 0, __VA_ARGS__)
|
#define DEBUG_MSG_FUNC(WHAT, OBJ, ...) _hb_debug_msg<HB_DEBUG_##WHAT> (#WHAT, (OBJ), HB_FUNC, false, 0, 0, __VA_ARGS__)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -139,7 +139,7 @@ struct CFFIndex
|
||||||
/* serialize data */
|
/* serialize data */
|
||||||
for (unsigned int i = 0; i < byteArray.length; i++)
|
for (unsigned int i = 0; i < byteArray.length; i++)
|
||||||
{
|
{
|
||||||
const byte_str_t &bs = byteArray[i];
|
const byte_str_t &bs = byteArray[i];
|
||||||
unsigned char *dest = c->allocate_size<unsigned char> (bs.length);
|
unsigned char *dest = c->allocate_size<unsigned char> (bs.length);
|
||||||
if (unlikely (dest == nullptr))
|
if (unlikely (dest == nullptr))
|
||||||
return_trace (false);
|
return_trace (false);
|
||||||
|
@ -459,7 +459,7 @@ struct FDArray : CFFIndexOf<COUNT, FontDict>
|
||||||
for (unsigned i = 0; i < fontDicts.length; i++)
|
for (unsigned i = 0; i < fontDicts.length; i++)
|
||||||
if (fdmap.has (i))
|
if (fdmap.has (i))
|
||||||
{
|
{
|
||||||
if (unlikely (fid >= fdCount)) return_trace (false);
|
if (unlikely (fid >= fdCount)) return_trace (false);
|
||||||
CFFIndexOf<COUNT, FontDict>::set_offset_at (fid++, offset);
|
CFFIndexOf<COUNT, FontDict>::set_offset_at (fid++, offset);
|
||||||
offset += FontDict::calculate_serialized_size (fontDicts[i], opszr);
|
offset += FontDict::calculate_serialized_size (fontDicts[i], opszr);
|
||||||
}
|
}
|
||||||
|
@ -544,7 +544,7 @@ struct FDSelect3_4
|
||||||
{
|
{
|
||||||
TRACE_SANITIZE (this);
|
TRACE_SANITIZE (this);
|
||||||
if (unlikely (!c->check_struct (this) || !ranges.sanitize (c, nullptr, fdcount) ||
|
if (unlikely (!c->check_struct (this) || !ranges.sanitize (c, nullptr, fdcount) ||
|
||||||
(nRanges () == 0) || ranges[0].first != 0))
|
(nRanges () == 0) || ranges[0].first != 0))
|
||||||
return_trace (false);
|
return_trace (false);
|
||||||
|
|
||||||
for (unsigned int i = 1; i < nRanges (); i++)
|
for (unsigned int i = 1; i < nRanges (); i++)
|
||||||
|
|
|
@ -420,7 +420,7 @@ struct Charset1_2 {
|
||||||
for (unsigned int i = 0;; i++)
|
for (unsigned int i = 0;; i++)
|
||||||
{
|
{
|
||||||
if (glyph >= num_glyphs)
|
if (glyph >= num_glyphs)
|
||||||
return 0;
|
return 0;
|
||||||
if ((ranges[i].first <= sid) && (sid <= ranges[i].first + ranges[i].nLeft))
|
if ((ranges[i].first <= sid) && (sid <= ranges[i].first + ranges[i].nLeft))
|
||||||
return glyph + (sid - ranges[i].first);
|
return glyph + (sid - ranges[i].first);
|
||||||
glyph += (ranges[i].nLeft + 1);
|
glyph += (ranges[i].nLeft + 1);
|
||||||
|
@ -500,7 +500,7 @@ struct Charset
|
||||||
if (unlikely (fmt1 == nullptr)) return_trace (false);
|
if (unlikely (fmt1 == nullptr)) return_trace (false);
|
||||||
for (unsigned int i = 0; i < sid_ranges.length; i++)
|
for (unsigned int i = 0; i < sid_ranges.length; i++)
|
||||||
{
|
{
|
||||||
if (unlikely (!(sid_ranges[i].glyph <= 0xFF)))
|
if (unlikely (!(sid_ranges[i].glyph <= 0xFF)))
|
||||||
return_trace (false);
|
return_trace (false);
|
||||||
fmt1->ranges[i].first = sid_ranges[i].code;
|
fmt1->ranges[i].first = sid_ranges[i].code;
|
||||||
fmt1->ranges[i].nLeft = sid_ranges[i].glyph;
|
fmt1->ranges[i].nLeft = sid_ranges[i].glyph;
|
||||||
|
@ -514,7 +514,7 @@ struct Charset
|
||||||
if (unlikely (fmt2 == nullptr)) return_trace (false);
|
if (unlikely (fmt2 == nullptr)) return_trace (false);
|
||||||
for (unsigned int i = 0; i < sid_ranges.length; i++)
|
for (unsigned int i = 0; i < sid_ranges.length; i++)
|
||||||
{
|
{
|
||||||
if (unlikely (!(sid_ranges[i].glyph <= 0xFFFF)))
|
if (unlikely (!(sid_ranges[i].glyph <= 0xFFFF)))
|
||||||
return_trace (false);
|
return_trace (false);
|
||||||
fmt2->ranges[i].first = sid_ranges[i].code;
|
fmt2->ranges[i].first = sid_ranges[i].code;
|
||||||
fmt2->ranges[i].nLeft = sid_ranges[i].glyph;
|
fmt2->ranges[i].nLeft = sid_ranges[i].glyph;
|
||||||
|
@ -1298,7 +1298,7 @@ struct cff1
|
||||||
void fini ()
|
void fini ()
|
||||||
{
|
{
|
||||||
glyph_names.fini ();
|
glyph_names.fini ();
|
||||||
|
|
||||||
SUPER::fini ();
|
SUPER::fini ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1335,7 +1335,7 @@ struct cff1
|
||||||
{
|
{
|
||||||
if (len < 0) len = strlen (name);
|
if (len < 0) len = strlen (name);
|
||||||
if (unlikely (!len)) return false;
|
if (unlikely (!len)) return false;
|
||||||
|
|
||||||
gname_t key = { hb_bytes_t (name, len), 0 };
|
gname_t key = { hb_bytes_t (name, len), 0 };
|
||||||
const gname_t *gname = glyph_names.bsearch (key);
|
const gname_t *gname = glyph_names.bsearch (key);
|
||||||
if (gname == nullptr) return false;
|
if (gname == nullptr) return false;
|
||||||
|
@ -1366,7 +1366,7 @@ struct cff1
|
||||||
|
|
||||||
int cmp (const gname_t &a) const { return cmp (&a, this); }
|
int cmp (const gname_t &a) const { return cmp (&a, this); }
|
||||||
};
|
};
|
||||||
|
|
||||||
hb_sorted_vector_t<gname_t> glyph_names;
|
hb_sorted_vector_t<gname_t> glyph_names;
|
||||||
|
|
||||||
typedef accelerator_templ_t<cff1_private_dict_opset_t, cff1_private_dict_values_t> SUPER;
|
typedef accelerator_templ_t<cff1_private_dict_opset_t, cff1_private_dict_values_t> SUPER;
|
||||||
|
|
|
@ -145,7 +145,7 @@ struct IndexSubtableFormat1Or3
|
||||||
|
|
||||||
IndexSubtableHeader header;
|
IndexSubtableHeader header;
|
||||||
UnsizedArrayOf<Offset<OffsetType>>
|
UnsizedArrayOf<Offset<OffsetType>>
|
||||||
offsetArrayZ;
|
offsetArrayZ;
|
||||||
public:
|
public:
|
||||||
DEFINE_SIZE_ARRAY(8, offsetArrayZ);
|
DEFINE_SIZE_ARRAY(8, offsetArrayZ);
|
||||||
};
|
};
|
||||||
|
|
|
@ -48,8 +48,8 @@ struct GaspRange
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
HBUINT16 rangeMaxPPEM; /* Upper limit of range, in PPEM */
|
HBUINT16 rangeMaxPPEM; /* Upper limit of range, in PPEM */
|
||||||
HBUINT16 rangeGaspBehavior;
|
HBUINT16 rangeGaspBehavior;
|
||||||
/* Flags describing desired rasterizer behavior. */
|
/* Flags describing desired rasterizer behavior. */
|
||||||
public:
|
public:
|
||||||
DEFINE_SIZE_STATIC (4);
|
DEFINE_SIZE_STATIC (4);
|
||||||
|
|
|
@ -1344,7 +1344,7 @@ static void ClassDef_remap_and_serialize (hb_serialize_context_t *c,
|
||||||
hb_map_t *klass_map /*INOUT*/)
|
hb_map_t *klass_map /*INOUT*/)
|
||||||
{
|
{
|
||||||
bool has_no_match = glyphset.get_population () > gid_klass_map.get_population ();
|
bool has_no_match = glyphset.get_population () > gid_klass_map.get_population ();
|
||||||
|
|
||||||
hb_map_t m;
|
hb_map_t m;
|
||||||
if (!klass_map) klass_map = &m;
|
if (!klass_map) klass_map = &m;
|
||||||
|
|
||||||
|
@ -1356,7 +1356,7 @@ static void ClassDef_remap_and_serialize (hb_serialize_context_t *c,
|
||||||
klass_map->set (k, idx);
|
klass_map->set (k, idx);
|
||||||
idx++;
|
idx++;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto it =
|
auto it =
|
||||||
+ glyphs.iter ()
|
+ glyphs.iter ()
|
||||||
| hb_map_retains_sorting ([&] (const HBGlyphID& gid) -> hb_pair_t<hb_codepoint_t, HBUINT16>
|
| hb_map_retains_sorting ([&] (const HBGlyphID& gid) -> hb_pair_t<hb_codepoint_t, HBUINT16>
|
||||||
|
@ -1366,7 +1366,7 @@ static void ClassDef_remap_and_serialize (hb_serialize_context_t *c,
|
||||||
return hb_pair ((hb_codepoint_t)gid, new_klass);
|
return hb_pair ((hb_codepoint_t)gid, new_klass);
|
||||||
})
|
})
|
||||||
;
|
;
|
||||||
|
|
||||||
c->propagate_error (glyphs, klasses);
|
c->propagate_error (glyphs, klasses);
|
||||||
ClassDef_serialize (c, it);
|
ClassDef_serialize (c, it);
|
||||||
}
|
}
|
||||||
|
@ -1412,7 +1412,7 @@ struct ClassDefFormat1
|
||||||
TRACE_SUBSET (this);
|
TRACE_SUBSET (this);
|
||||||
const hb_set_t &glyphset = *c->plan->glyphset ();
|
const hb_set_t &glyphset = *c->plan->glyphset ();
|
||||||
const hb_map_t &glyph_map = *c->plan->glyph_map;
|
const hb_map_t &glyph_map = *c->plan->glyph_map;
|
||||||
|
|
||||||
hb_sorted_vector_t<HBGlyphID> glyphs;
|
hb_sorted_vector_t<HBGlyphID> glyphs;
|
||||||
hb_sorted_vector_t<unsigned> orig_klasses;
|
hb_sorted_vector_t<unsigned> orig_klasses;
|
||||||
hb_map_t gid_org_klass_map;
|
hb_map_t gid_org_klass_map;
|
||||||
|
@ -2031,8 +2031,8 @@ struct VarData
|
||||||
for (r = 0; r < ri_count; r++)
|
for (r = 0; r < ri_count; r++)
|
||||||
if (delta_sz[r])
|
if (delta_sz[r])
|
||||||
{
|
{
|
||||||
ri_map[r] = (delta_sz[r] == kShort)? short_index++ : byte_index++;
|
ri_map[r] = (delta_sz[r] == kShort)? short_index++ : byte_index++;
|
||||||
new_ri_count++;
|
new_ri_count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
shortCount = new_short_count;
|
shortCount = new_short_count;
|
||||||
|
@ -2145,7 +2145,7 @@ struct VariationStore
|
||||||
|
|
||||||
bool serialize (hb_serialize_context_t *c,
|
bool serialize (hb_serialize_context_t *c,
|
||||||
const VariationStore *src,
|
const VariationStore *src,
|
||||||
const hb_array_t <hb_inc_bimap_t> &inner_maps)
|
const hb_array_t <hb_inc_bimap_t> &inner_maps)
|
||||||
{
|
{
|
||||||
TRACE_SERIALIZE (this);
|
TRACE_SERIALIZE (this);
|
||||||
unsigned int set_count = 0;
|
unsigned int set_count = 0;
|
||||||
|
|
|
@ -1363,7 +1363,7 @@ struct Rule
|
||||||
* glyph */
|
* glyph */
|
||||||
HBUINT16 lookupCount; /* Number of LookupRecords */
|
HBUINT16 lookupCount; /* Number of LookupRecords */
|
||||||
UnsizedArrayOf<HBUINT16>
|
UnsizedArrayOf<HBUINT16>
|
||||||
inputZ; /* Array of match inputs--start with
|
inputZ; /* Array of match inputs--start with
|
||||||
* second glyph */
|
* second glyph */
|
||||||
/*UnsizedArrayOf<LookupRecord>
|
/*UnsizedArrayOf<LookupRecord>
|
||||||
lookupRecordX;*/ /* Array of LookupRecords--in
|
lookupRecordX;*/ /* Array of LookupRecords--in
|
||||||
|
@ -2992,11 +2992,11 @@ struct GSUBGPOS
|
||||||
FixedVersion<>version; /* Version of the GSUB/GPOS table--initially set
|
FixedVersion<>version; /* Version of the GSUB/GPOS table--initially set
|
||||||
* to 0x00010000u */
|
* to 0x00010000u */
|
||||||
OffsetTo<ScriptList>
|
OffsetTo<ScriptList>
|
||||||
scriptList; /* ScriptList table */
|
scriptList; /* ScriptList table */
|
||||||
OffsetTo<FeatureList>
|
OffsetTo<FeatureList>
|
||||||
featureList; /* FeatureList table */
|
featureList; /* FeatureList table */
|
||||||
OffsetTo<LookupList>
|
OffsetTo<LookupList>
|
||||||
lookupList; /* LookupList table */
|
lookupList; /* LookupList table */
|
||||||
LOffsetTo<FeatureVariations>
|
LOffsetTo<FeatureVariations>
|
||||||
featureVars; /* Offset to Feature Variations
|
featureVars; /* Offset to Feature Variations
|
||||||
table--from beginning of table
|
table--from beginning of table
|
||||||
|
|
|
@ -222,7 +222,7 @@ struct JSTF
|
||||||
FixedVersion<>version; /* Version of the JSTF table--initially set
|
FixedVersion<>version; /* Version of the JSTF table--initially set
|
||||||
* to 0x00010000u */
|
* to 0x00010000u */
|
||||||
RecordArrayOf<JstfScript>
|
RecordArrayOf<JstfScript>
|
||||||
scriptList; /* Array of JstfScripts--listed
|
scriptList; /* Array of JstfScripts--listed
|
||||||
* alphabetically by ScriptTag */
|
* alphabetically by ScriptTag */
|
||||||
public:
|
public:
|
||||||
DEFINE_SIZE_ARRAY (6, scriptList);
|
DEFINE_SIZE_ARRAY (6, scriptList);
|
||||||
|
|
|
@ -645,27 +645,28 @@ struct MathVariants
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
HBUINT16 minConnectorOverlap; /* Minimum overlap of connecting
|
HBUINT16 minConnectorOverlap;
|
||||||
* glyphs during glyph construction,
|
/* Minimum overlap of connecting
|
||||||
* in design units. */
|
* glyphs during glyph construction,
|
||||||
OffsetTo<Coverage> vertGlyphCoverage; /* Offset to Coverage table -
|
* in design units. */
|
||||||
* from the beginning of MathVariants
|
OffsetTo<Coverage> vertGlyphCoverage; /* Offset to Coverage table -
|
||||||
* table. */
|
* from the beginning of MathVariants
|
||||||
OffsetTo<Coverage> horizGlyphCoverage; /* Offset to Coverage table -
|
* table. */
|
||||||
* from the beginning of MathVariants
|
OffsetTo<Coverage> horizGlyphCoverage;/* Offset to Coverage table -
|
||||||
* table. */
|
* from the beginning of MathVariants
|
||||||
HBUINT16 vertGlyphCount; /* Number of glyphs for which
|
* table. */
|
||||||
* information is provided for
|
HBUINT16 vertGlyphCount; /* Number of glyphs for which
|
||||||
* vertically growing variants. */
|
* information is provided for
|
||||||
HBUINT16 horizGlyphCount; /* Number of glyphs for which
|
* vertically growing variants. */
|
||||||
* information is provided for
|
HBUINT16 horizGlyphCount;/* Number of glyphs for which
|
||||||
* horizontally growing variants. */
|
* information is provided for
|
||||||
|
* horizontally growing variants. */
|
||||||
|
|
||||||
/* Array of offsets to MathGlyphConstruction tables - from the beginning of
|
/* Array of offsets to MathGlyphConstruction tables - from the beginning of
|
||||||
the MathVariants table, for shapes growing in vertical/horizontal
|
the MathVariants table, for shapes growing in vertical/horizontal
|
||||||
direction. */
|
direction. */
|
||||||
UnsizedArrayOf<OffsetTo<MathGlyphConstruction>>
|
UnsizedArrayOf<OffsetTo<MathGlyphConstruction>>
|
||||||
glyphConstruction;
|
glyphConstruction;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DEFINE_SIZE_ARRAY (10, glyphConstruction);
|
DEFINE_SIZE_ARRAY (10, glyphConstruction);
|
||||||
|
|
|
@ -76,7 +76,7 @@ complex_syllable_tail = (halant_group.cn)* medial_group halant_or_matra_group sy
|
||||||
consonant_syllable = (Repha|CS)? cn complex_syllable_tail;
|
consonant_syllable = (Repha|CS)? cn complex_syllable_tail;
|
||||||
vowel_syllable = reph? V.n? (ZWJ | complex_syllable_tail);
|
vowel_syllable = reph? V.n? (ZWJ | complex_syllable_tail);
|
||||||
standalone_cluster = ((Repha|CS)? PLACEHOLDER | reph? DOTTEDCIRCLE).n? complex_syllable_tail;
|
standalone_cluster = ((Repha|CS)? PLACEHOLDER | reph? DOTTEDCIRCLE).n? complex_syllable_tail;
|
||||||
symbol_cluster = symbol syllable_tail;
|
symbol_cluster = symbol syllable_tail;
|
||||||
broken_cluster = reph? n? complex_syllable_tail;
|
broken_cluster = reph? n? complex_syllable_tail;
|
||||||
other = any;
|
other = any;
|
||||||
|
|
||||||
|
|
|
@ -78,7 +78,7 @@ complex_syllable_tail = As* medial_group main_vowel_group post_vowel_group* pwo_
|
||||||
syllable_tail = (H (c|IV).VS?)* (H | complex_syllable_tail);
|
syllable_tail = (H (c|IV).VS?)* (H | complex_syllable_tail);
|
||||||
|
|
||||||
consonant_syllable = (k|CS)? (c|IV|D|GB).VS? syllable_tail;
|
consonant_syllable = (k|CS)? (c|IV|D|GB).VS? syllable_tail;
|
||||||
punctuation_cluster = P V;
|
punctuation_cluster = P V;
|
||||||
broken_cluster = k? VS? syllable_tail;
|
broken_cluster = k? VS? syllable_tail;
|
||||||
other = any;
|
other = any;
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ struct AxisValueMap
|
||||||
public:
|
public:
|
||||||
F2DOT14 coords[2];
|
F2DOT14 coords[2];
|
||||||
// F2DOT14 fromCoord; /* A normalized coordinate value obtained using
|
// F2DOT14 fromCoord; /* A normalized coordinate value obtained using
|
||||||
// * default normalization. */
|
// * default normalization. */
|
||||||
// F2DOT14 toCoord; /* The modified, normalized coordinate value. */
|
// F2DOT14 toCoord; /* The modified, normalized coordinate value. */
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -106,7 +106,7 @@ struct TupleVarHeader
|
||||||
{ return StructAtOffset<TupleVarHeader> (this, get_size (axis_count)); }
|
{ return StructAtOffset<TupleVarHeader> (this, get_size (axis_count)); }
|
||||||
|
|
||||||
float calculate_scalar (const int *coords, unsigned int coord_count,
|
float calculate_scalar (const int *coords, unsigned int coord_count,
|
||||||
const hb_array_t<const F2DOT14> shared_tuples) const
|
const hb_array_t<const F2DOT14> shared_tuples) const
|
||||||
{
|
{
|
||||||
const F2DOT14 *peak_tuple;
|
const F2DOT14 *peak_tuple;
|
||||||
|
|
||||||
|
@ -260,10 +260,10 @@ struct GlyphVarData
|
||||||
};
|
};
|
||||||
|
|
||||||
static bool get_tuple_iterator (const GlyphVarData *var_data,
|
static bool get_tuple_iterator (const GlyphVarData *var_data,
|
||||||
unsigned int length,
|
unsigned int length,
|
||||||
unsigned int axis_count,
|
unsigned int axis_count,
|
||||||
hb_vector_t<unsigned int> &shared_indices /* OUT */,
|
hb_vector_t<unsigned int> &shared_indices /* OUT */,
|
||||||
tuple_iterator_t *iterator /* OUT */)
|
tuple_iterator_t *iterator /* OUT */)
|
||||||
{
|
{
|
||||||
iterator->init (var_data, length, axis_count);
|
iterator->init (var_data, length, axis_count);
|
||||||
if (!iterator->get_shared_indices (shared_indices))
|
if (!iterator->get_shared_indices (shared_indices))
|
||||||
|
@ -513,7 +513,7 @@ struct gvar
|
||||||
|
|
||||||
if (unlikely ((gvar_table->glyphCount != face->get_num_glyphs ()) ||
|
if (unlikely ((gvar_table->glyphCount != face->get_num_glyphs ()) ||
|
||||||
(gvar_table->axisCount != axis_count)))
|
(gvar_table->axisCount != axis_count)))
|
||||||
fini ();
|
fini ();
|
||||||
|
|
||||||
unsigned int num_shared_coord = gvar_table->sharedTupleCount * gvar_table->axisCount;
|
unsigned int num_shared_coord = gvar_table->sharedTupleCount * gvar_table->axisCount;
|
||||||
shared_tuples.resize (num_shared_coord);
|
shared_tuples.resize (num_shared_coord);
|
||||||
|
@ -543,11 +543,11 @@ struct gvar
|
||||||
float next_delta = T::get (deltas[next]);
|
float next_delta = T::get (deltas[next]);
|
||||||
|
|
||||||
if (prev_val == next_val)
|
if (prev_val == next_val)
|
||||||
return (prev_delta == next_delta) ? prev_delta : 0.f;
|
return (prev_delta == next_delta) ? prev_delta : 0.f;
|
||||||
else if (target_val <= hb_min (prev_val, next_val))
|
else if (target_val <= hb_min (prev_val, next_val))
|
||||||
return (prev_val < next_val) ? prev_delta : next_delta;
|
return (prev_val < next_val) ? prev_delta : next_delta;
|
||||||
else if (target_val >= hb_max (prev_val, next_val))
|
else if (target_val >= hb_max (prev_val, next_val))
|
||||||
return (prev_val > next_val) ? prev_delta : next_delta;
|
return (prev_val > next_val) ? prev_delta : next_delta;
|
||||||
|
|
||||||
/* linear interpolation */
|
/* linear interpolation */
|
||||||
float r = (target_val - prev_val) / (next_val - prev_val);
|
float r = (target_val - prev_val) / (next_val - prev_val);
|
||||||
|
|
|
@ -113,7 +113,7 @@ struct DeltaSetIndexMap
|
||||||
* representation of delta-set indices. */
|
* representation of delta-set indices. */
|
||||||
HBUINT16 mapCount; /* The number of mapping entries. */
|
HBUINT16 mapCount; /* The number of mapping entries. */
|
||||||
UnsizedArrayOf<HBUINT8>
|
UnsizedArrayOf<HBUINT8>
|
||||||
mapDataZ; /* The delta-set index mapping data. */
|
mapDataZ; /* The delta-set index mapping data. */
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DEFINE_SIZE_ARRAY (4, mapDataZ);
|
DEFINE_SIZE_ARRAY (4, mapDataZ);
|
||||||
|
@ -128,10 +128,10 @@ struct index_map_subset_plan_t
|
||||||
VORG_INDEX
|
VORG_INDEX
|
||||||
};
|
};
|
||||||
|
|
||||||
void init (const DeltaSetIndexMap &index_map,
|
void init (const DeltaSetIndexMap &index_map,
|
||||||
hb_inc_bimap_t &outer_map,
|
hb_inc_bimap_t &outer_map,
|
||||||
hb_vector_t<hb_set_t *> &inner_sets,
|
hb_vector_t<hb_set_t *> &inner_sets,
|
||||||
const hb_subset_plan_t *plan)
|
const hb_subset_plan_t *plan)
|
||||||
{
|
{
|
||||||
map_count = 0;
|
map_count = 0;
|
||||||
outer_bit_count = 0;
|
outer_bit_count = 0;
|
||||||
|
@ -288,7 +288,7 @@ struct hvarvvar_subset_plan_t
|
||||||
if (retain_adv_map)
|
if (retain_adv_map)
|
||||||
{
|
{
|
||||||
for (hb_codepoint_t gid = 0; gid < plan->num_output_glyphs (); gid++)
|
for (hb_codepoint_t gid = 0; gid < plan->num_output_glyphs (); gid++)
|
||||||
if (hb_set_has (inner_sets[0], gid))
|
if (hb_set_has (inner_sets[0], gid))
|
||||||
inner_maps[0].add (gid);
|
inner_maps[0].add (gid);
|
||||||
else
|
else
|
||||||
inner_maps[0].skip ();
|
inner_maps[0].skip ();
|
||||||
|
|
|
@ -108,7 +108,7 @@ hb_plan_subset_cff_fdselect (const hb_subset_plan_t *plan,
|
||||||
fdmap.add (fd);
|
fdmap.add (fd);
|
||||||
hb_set_destroy (set);
|
hb_set_destroy (set);
|
||||||
if (unlikely (fdmap.get_population () != subset_fd_count))
|
if (unlikely (fdmap.get_population () != subset_fd_count))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* update each font dict index stored as "code" in fdselect_ranges */
|
/* update each font dict index stored as "code" in fdselect_ranges */
|
||||||
|
|
|
@ -300,14 +300,14 @@ struct subr_flattener_t
|
||||||
hb_codepoint_t glyph;
|
hb_codepoint_t glyph;
|
||||||
if (!plan->old_gid_for_new_gid (i, &glyph))
|
if (!plan->old_gid_for_new_gid (i, &glyph))
|
||||||
{
|
{
|
||||||
/* add an endchar only charstring for a missing glyph if CFF1 */
|
/* add an endchar only charstring for a missing glyph if CFF1 */
|
||||||
if (endchar_op != OpCode_Invalid) flat_charstrings[i].push (endchar_op);
|
if (endchar_op != OpCode_Invalid) flat_charstrings[i].push (endchar_op);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const byte_str_t str = (*acc.charStrings)[glyph];
|
const byte_str_t str = (*acc.charStrings)[glyph];
|
||||||
unsigned int fd = acc.fdSelect->get_fd (glyph);
|
unsigned int fd = acc.fdSelect->get_fd (glyph);
|
||||||
if (unlikely (fd >= acc.fdCount))
|
if (unlikely (fd >= acc.fdCount))
|
||||||
return false;
|
return false;
|
||||||
cs_interpreter_t<ENV, OPSET, flatten_param_t> interp;
|
cs_interpreter_t<ENV, OPSET, flatten_param_t> interp;
|
||||||
interp.env.init (str, acc, fd);
|
interp.env.init (str, acc, fd);
|
||||||
flatten_param_t param = { flat_charstrings[i], plan->drop_hints };
|
flatten_param_t param = { flat_charstrings[i], plan->drop_hints };
|
||||||
|
@ -456,7 +456,7 @@ struct parsed_cs_str_t : parsed_values_t<parsed_cs_op_t>
|
||||||
bool vsindex_dropped;
|
bool vsindex_dropped;
|
||||||
bool has_prefix_;
|
bool has_prefix_;
|
||||||
op_code_t prefix_op_;
|
op_code_t prefix_op_;
|
||||||
number_t prefix_num_;
|
number_t prefix_num_;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
typedef parsed_values_t<parsed_cs_op_t> SUPER;
|
typedef parsed_values_t<parsed_cs_op_t> SUPER;
|
||||||
|
@ -523,9 +523,9 @@ struct subr_subset_param_t
|
||||||
* it must be because we are calling it recursively.
|
* it must be because we are calling it recursively.
|
||||||
* Handle it as an error. */
|
* Handle it as an error. */
|
||||||
if (unlikely (calling && !parsed_str->is_parsed () && (parsed_str->values.length > 0)))
|
if (unlikely (calling && !parsed_str->is_parsed () && (parsed_str->values.length > 0)))
|
||||||
env.set_error ();
|
env.set_error ();
|
||||||
else
|
else
|
||||||
current_parsed_str = parsed_str;
|
current_parsed_str = parsed_str;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
env.set_error ();
|
env.set_error ();
|
||||||
|
@ -659,11 +659,11 @@ struct subr_subsetter_t
|
||||||
{
|
{
|
||||||
hb_codepoint_t glyph;
|
hb_codepoint_t glyph;
|
||||||
if (!plan->old_gid_for_new_gid (i, &glyph))
|
if (!plan->old_gid_for_new_gid (i, &glyph))
|
||||||
continue;
|
continue;
|
||||||
const byte_str_t str = (*acc.charStrings)[glyph];
|
const byte_str_t str = (*acc.charStrings)[glyph];
|
||||||
unsigned int fd = acc.fdSelect->get_fd (glyph);
|
unsigned int fd = acc.fdSelect->get_fd (glyph);
|
||||||
if (unlikely (fd >= acc.fdCount))
|
if (unlikely (fd >= acc.fdCount))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
cs_interpreter_t<ENV, OPSET, subr_subset_param_t> interp;
|
cs_interpreter_t<ENV, OPSET, subr_subset_param_t> interp;
|
||||||
interp.env.init (str, acc, fd);
|
interp.env.init (str, acc, fd);
|
||||||
|
@ -740,13 +740,13 @@ struct subr_subsetter_t
|
||||||
hb_codepoint_t glyph;
|
hb_codepoint_t glyph;
|
||||||
if (!plan->old_gid_for_new_gid (i, &glyph))
|
if (!plan->old_gid_for_new_gid (i, &glyph))
|
||||||
{
|
{
|
||||||
/* add an endchar only charstring for a missing glyph if CFF1 */
|
/* add an endchar only charstring for a missing glyph if CFF1 */
|
||||||
if (endchar_op != OpCode_Invalid) buffArray[i].push (endchar_op);
|
if (endchar_op != OpCode_Invalid) buffArray[i].push (endchar_op);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
unsigned int fd = acc.fdSelect->get_fd (glyph);
|
unsigned int fd = acc.fdSelect->get_fd (glyph);
|
||||||
if (unlikely (fd >= acc.fdCount))
|
if (unlikely (fd >= acc.fdCount))
|
||||||
return false;
|
return false;
|
||||||
if (unlikely (!encode_str (parsed_charstrings[i], fd, buffArray[i])))
|
if (unlikely (!encode_str (parsed_charstrings[i], fd, buffArray[i])))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -900,11 +900,11 @@ struct subr_subsetter_t
|
||||||
{
|
{
|
||||||
parsed_cs_op_t &csop = str.values[pos];
|
parsed_cs_op_t &csop = str.values[pos];
|
||||||
if (csop.op == OpCode_return)
|
if (csop.op == OpCode_return)
|
||||||
break;
|
break;
|
||||||
if (!csop.for_drop ())
|
if (!csop.for_drop ())
|
||||||
{
|
{
|
||||||
drop.all_dropped = false;
|
drop.all_dropped = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -986,7 +986,7 @@ struct subr_subsetter_t
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
const ACC &acc;
|
const ACC &acc;
|
||||||
const hb_subset_plan_t *plan;
|
const hb_subset_plan_t *plan;
|
||||||
|
|
||||||
subr_closures_t closures;
|
subr_closures_t closures;
|
||||||
|
|
|
@ -484,7 +484,7 @@ struct cff_subset_plan {
|
||||||
hb_codepoint_t old_glyph;
|
hb_codepoint_t old_glyph;
|
||||||
if (!plan->old_gid_for_new_gid (glyph, &old_glyph))
|
if (!plan->old_gid_for_new_gid (glyph, &old_glyph))
|
||||||
{
|
{
|
||||||
/* Retain the code for the old missing glyph ID */
|
/* Retain the code for the old missing glyph ID */
|
||||||
old_glyph = glyph;
|
old_glyph = glyph;
|
||||||
}
|
}
|
||||||
code = acc.glyph_to_code (old_glyph);
|
code = acc.glyph_to_code (old_glyph);
|
||||||
|
@ -544,7 +544,7 @@ struct cff_subset_plan {
|
||||||
hb_codepoint_t old_glyph;
|
hb_codepoint_t old_glyph;
|
||||||
if (!plan->old_gid_for_new_gid (glyph, &old_glyph))
|
if (!plan->old_gid_for_new_gid (glyph, &old_glyph))
|
||||||
{
|
{
|
||||||
/* Retain the SID for the old missing glyph ID */
|
/* Retain the SID for the old missing glyph ID */
|
||||||
old_glyph = glyph;
|
old_glyph = glyph;
|
||||||
}
|
}
|
||||||
sid = acc.glyph_to_sid (old_glyph);
|
sid = acc.glyph_to_sid (old_glyph);
|
||||||
|
@ -620,7 +620,7 @@ struct cff_subset_plan {
|
||||||
for (hb_codepoint_t new_glyph = 0; new_glyph < plan->num_output_glyphs (); new_glyph++)
|
for (hb_codepoint_t new_glyph = 0; new_glyph < plan->num_output_glyphs (); new_glyph++)
|
||||||
{
|
{
|
||||||
if (!plan->old_gid_for_new_gid(new_glyph, &old_glyph))
|
if (!plan->old_gid_for_new_gid(new_glyph, &old_glyph))
|
||||||
continue;
|
continue;
|
||||||
if (new_glyph != old_glyph) {
|
if (new_glyph != old_glyph) {
|
||||||
gid_renum = true;
|
gid_renum = true;
|
||||||
break;
|
break;
|
||||||
|
@ -655,7 +655,7 @@ struct cff_subset_plan {
|
||||||
unsigned int topDictSize = TopDict::calculate_serialized_size (topdict_mod, topSzr);
|
unsigned int topDictSize = TopDict::calculate_serialized_size (topdict_mod, topSzr);
|
||||||
offsets.topDictInfo.offSize = calcOffSize(topDictSize);
|
offsets.topDictInfo.offSize = calcOffSize(topDictSize);
|
||||||
if (unlikely (offsets.topDictInfo.offSize > 4))
|
if (unlikely (offsets.topDictInfo.offSize > 4))
|
||||||
return false;
|
return false;
|
||||||
final_size += CFF1IndexOf<TopDict>::calculate_serialized_size<cff1_top_dict_values_mod_t>
|
final_size += CFF1IndexOf<TopDict>::calculate_serialized_size<cff1_top_dict_values_mod_t>
|
||||||
(offsets.topDictInfo.offSize,
|
(offsets.topDictInfo.offSize,
|
||||||
&topdict_mod, 1, topdict_sizes, topSzr);
|
&topdict_mod, 1, topdict_sizes, topSzr);
|
||||||
|
@ -683,7 +683,7 @@ struct cff_subset_plan {
|
||||||
if (unlikely (!collect_sids_in_dicts (acc)))
|
if (unlikely (!collect_sids_in_dicts (acc)))
|
||||||
return false;
|
return false;
|
||||||
if (unlikely (sidmap.get_population () > 0x8000)) /* assumption: a dict won't reference that many strings */
|
if (unlikely (sidmap.get_population () > 0x8000)) /* assumption: a dict won't reference that many strings */
|
||||||
return false;
|
return false;
|
||||||
if (subset_charset)
|
if (subset_charset)
|
||||||
offsets.charsetInfo.size = plan_subset_charset (acc, plan);
|
offsets.charsetInfo.size = plan_subset_charset (acc, plan);
|
||||||
|
|
||||||
|
@ -727,7 +727,7 @@ struct cff_subset_plan {
|
||||||
unsigned int dataSize = subset_globalsubrs.total_size ();
|
unsigned int dataSize = subset_globalsubrs.total_size ();
|
||||||
offsets.globalSubrsInfo.offSize = calcOffSize (dataSize);
|
offsets.globalSubrsInfo.offSize = calcOffSize (dataSize);
|
||||||
if (unlikely (offsets.globalSubrsInfo.offSize > 4))
|
if (unlikely (offsets.globalSubrsInfo.offSize > 4))
|
||||||
return false;
|
return false;
|
||||||
offsets.globalSubrsInfo.size = CFF1Subrs::calculate_serialized_size (offsets.globalSubrsInfo.offSize, subset_globalsubrs.length, dataSize);
|
offsets.globalSubrsInfo.size = CFF1Subrs::calculate_serialized_size (offsets.globalSubrsInfo.offSize, subset_globalsubrs.length, dataSize);
|
||||||
|
|
||||||
/* local subrs */
|
/* local subrs */
|
||||||
|
@ -795,7 +795,7 @@ struct cff_subset_plan {
|
||||||
|
|
||||||
offsets.FDArrayInfo.offSize = calcOffSize (dictsSize);
|
offsets.FDArrayInfo.offSize = calcOffSize (dictsSize);
|
||||||
if (unlikely (offsets.FDArrayInfo.offSize > 4))
|
if (unlikely (offsets.FDArrayInfo.offSize > 4))
|
||||||
return false;
|
return false;
|
||||||
final_size += CFF1Index::calculate_serialized_size (offsets.FDArrayInfo.offSize, subset_fdcount, dictsSize);
|
final_size += CFF1Index::calculate_serialized_size (offsets.FDArrayInfo.offSize, subset_fdcount, dictsSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -805,7 +805,7 @@ struct cff_subset_plan {
|
||||||
unsigned int dataSize = subset_charstrings.total_size ();
|
unsigned int dataSize = subset_charstrings.total_size ();
|
||||||
offsets.charStringsInfo.offSize = calcOffSize (dataSize);
|
offsets.charStringsInfo.offSize = calcOffSize (dataSize);
|
||||||
if (unlikely (offsets.charStringsInfo.offSize > 4))
|
if (unlikely (offsets.charStringsInfo.offSize > 4))
|
||||||
return false;
|
return false;
|
||||||
final_size += CFF1CharStrings::calculate_serialized_size (offsets.charStringsInfo.offSize, plan->num_output_glyphs (), dataSize);
|
final_size += CFF1CharStrings::calculate_serialized_size (offsets.charStringsInfo.offSize, plan->num_output_glyphs (), dataSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -116,8 +116,8 @@ struct cff2_cs_opset_flatten_t : cff2_cs_opset_t<cff2_cs_opset_flatten_t, flatte
|
||||||
const blend_arg_t &arg = env.argStack[i];
|
const blend_arg_t &arg = env.argStack[i];
|
||||||
if (arg.blending ())
|
if (arg.blending ())
|
||||||
{
|
{
|
||||||
if (unlikely (!((arg.numValues > 0) && (env.argStack.get_count () >= arg.numValues))))
|
if (unlikely (!((arg.numValues > 0) && (env.argStack.get_count () >= arg.numValues))))
|
||||||
{
|
{
|
||||||
env.set_error ();
|
env.set_error ();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -144,8 +144,8 @@ struct cff2_cs_opset_flatten_t : cff2_cs_opset_t<cff2_cs_opset_flatten_t, flatte
|
||||||
if (unlikely (!((arg1.blending () && (arg.numValues == arg1.numValues) && (arg1.valueIndex == j) &&
|
if (unlikely (!((arg1.blending () && (arg.numValues == arg1.numValues) && (arg1.valueIndex == j) &&
|
||||||
(arg1.deltas.length == env.get_region_count ())))))
|
(arg1.deltas.length == env.get_region_count ())))))
|
||||||
{
|
{
|
||||||
env.set_error ();
|
env.set_error ();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
encoder.encode_num (arg1);
|
encoder.encode_num (arg1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -372,7 +372,7 @@ parse_unicodes (const char *name G_GNUC_UNUSED,
|
||||||
{
|
{
|
||||||
g_string_free (gs, TRUE);
|
g_string_free (gs, TRUE);
|
||||||
g_set_error (error, G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE,
|
g_set_error (error, G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE,
|
||||||
"Failed parsing Unicode values at: '%s'", s);
|
"Failed parsing Unicode values at: '%s'", s);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue