diff --git a/src/hb-aat-fdsc-table.hh b/src/hb-aat-fdsc-table.hh index 604d5bcf0..c3a9790d6 100644 --- a/src/hb-aat-fdsc-table.hh +++ b/src/hb-aat-fdsc-table.hh @@ -80,10 +80,10 @@ struct fdsc Weight = HB_TAG ('w','g','h','t'), /* Percent weight relative to regular weight. * (defaul value: 1.0) */ - Width = HB_TAG ('w','d','t','h'), + Width = HB_TAG ('w','d','t','h'), /* Percent width relative to regular width. * (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 * is clockwise from straight up. * (default value: 0.0) */ diff --git a/src/hb-aat-layout-ankr-table.hh b/src/hb-aat-layout-ankr-table.hh index ef988841a..e1858a497 100644 --- a/src/hb-aat-layout-ankr-table.hh +++ b/src/hb-aat-layout-ankr-table.hh @@ -81,7 +81,7 @@ struct ankr } protected: - HBUINT16 version; /* Version number (set to zero) */ + HBUINT16 version; /* Version number (set to zero) */ HBUINT16 flags; /* Flags (currently unused; set to zero) */ LOffsetTo>> lookupTable; /* Offset to the table's lookup table */ diff --git a/src/hb-aat-layout-just-table.hh b/src/hb-aat-layout-just-table.hh index e1787d10c..6d8e667f6 100644 --- a/src/hb-aat-layout-just-table.hh +++ b/src/hb-aat-layout-just-table.hh @@ -51,10 +51,10 @@ struct ActionSubrecordHeader return_trace (likely (c->check_struct (this))); } - HBUINT16 actionClass; /* The JustClass value associated with this + HBUINT16 actionClass; /* The JustClass value associated with this * ActionSubrecord. */ - HBUINT16 actionType; /* The type of postcompensation action. */ - HBUINT16 actionLength; /* Length of this ActionSubrecord record, which + HBUINT16 actionType; /* The type of postcompensation action. */ + HBUINT16 actionLength; /* Length of this ActionSubrecord record, which * must be a multiple of 4. */ public: DEFINE_SIZE_STATIC (6); @@ -70,11 +70,11 @@ struct DecompositionAction ActionSubrecordHeader 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. */ - 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. */ - 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 * to decompose before more frequent ones. The ligatures * on the line of text will decompose in increasing @@ -118,14 +118,14 @@ struct ConditionalAddGlyphAction protected: ActionSubrecordHeader 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 * 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 * generally when a glyph is added, justification * 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 * substThreshold. */ public: @@ -143,16 +143,16 @@ struct DuctileGlyphAction protected: ActionSubrecordHeader 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'), * 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 * 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 * 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. */ public: DEFINE_SIZE_STATIC (22); @@ -169,8 +169,8 @@ struct RepeatedAddGlyphAction protected: ActionSubrecordHeader header; - HBUINT16 flags; /* Currently unused; set to 0. */ - HBGlyphID glyph; /* Glyph that should be added if the distance factor + HBUINT16 flags; /* Currently unused; set to 0. */ + HBGlyphID glyph; /* Glyph that should be added if the distance factor * is growing. */ public: DEFINE_SIZE_STATIC (10); @@ -361,7 +361,7 @@ struct JustificationHeader OffsetTo justClassTable; /* Offset to the justification category state table. */ OffsetTo - 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 * for the glyphs in your font. * @@ -372,7 +372,7 @@ struct JustificationHeader * * The postcompensation subtable, if present in the font. */ Lookup> - lookupTable; /* Lookup table associating glyphs with width delta + lookupTable; /* Lookup table associating glyphs with width delta * clusters. See the description of Width Delta Clusters * table for details on how to interpret the lookup values. */ @@ -397,7 +397,7 @@ struct just protected: FixedVersion<>version; /* Version of the justification table * (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 horizData; /* Byte offset from the start of the justification table * to the header for tables that contain justification diff --git a/src/hb-aat-layout-trak-table.hh b/src/hb-aat-layout-trak-table.hh index 99dddd882..f978baa84 100644 --- a/src/hb-aat-layout-trak-table.hh +++ b/src/hb-aat-layout-trak-table.hh @@ -210,8 +210,8 @@ struct trak protected: FixedVersion<>version; /* Version of the tracking table - * (0x00010000u for version 1.0). */ - HBUINT16 format; /* Format of the tracking table (set to 0). */ + * (0x00010000u for version 1.0). */ + HBUINT16 format; /* Format of the tracking table (set to 0). */ OffsetTo horizData; /* Offset from start of tracking table to TrackData * for horizontal text (or 0 if none). */ diff --git a/src/hb-debug.hh b/src/hb-debug.hh index bd807f641..5c13e5d1a 100644 --- a/src/hb-debug.hh +++ b/src/hb-debug.hh @@ -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 (#WHAT, (OBJ), nullptr, true, (LEVEL), (LEVEL_DIR), __VA_ARGS__) -#define DEBUG_MSG(WHAT, OBJ, ...) _hb_debug_msg (#WHAT, (OBJ), nullptr, false, 0, 0, __VA_ARGS__) +#define DEBUG_MSG(WHAT, OBJ, ...) _hb_debug_msg (#WHAT, (OBJ), nullptr, false, 0, 0, __VA_ARGS__) #define DEBUG_MSG_FUNC(WHAT, OBJ, ...) _hb_debug_msg (#WHAT, (OBJ), HB_FUNC, false, 0, 0, __VA_ARGS__) diff --git a/src/hb-ot-cff-common.hh b/src/hb-ot-cff-common.hh index 6735c74be..5bf1acc1c 100644 --- a/src/hb-ot-cff-common.hh +++ b/src/hb-ot-cff-common.hh @@ -139,7 +139,7 @@ struct CFFIndex /* serialize data */ 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 (bs.length); if (unlikely (dest == nullptr)) return_trace (false); @@ -459,7 +459,7 @@ struct FDArray : CFFIndexOf for (unsigned i = 0; i < fontDicts.length; i++) if (fdmap.has (i)) { - if (unlikely (fid >= fdCount)) return_trace (false); + if (unlikely (fid >= fdCount)) return_trace (false); CFFIndexOf::set_offset_at (fid++, offset); offset += FontDict::calculate_serialized_size (fontDicts[i], opszr); } @@ -544,7 +544,7 @@ struct FDSelect3_4 { TRACE_SANITIZE (this); 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); for (unsigned int i = 1; i < nRanges (); i++) diff --git a/src/hb-ot-cff1-table.hh b/src/hb-ot-cff1-table.hh index 61e203e13..67f4db306 100644 --- a/src/hb-ot-cff1-table.hh +++ b/src/hb-ot-cff1-table.hh @@ -420,7 +420,7 @@ struct Charset1_2 { for (unsigned int i = 0;; i++) { if (glyph >= num_glyphs) - return 0; + return 0; if ((ranges[i].first <= sid) && (sid <= ranges[i].first + ranges[i].nLeft)) return glyph + (sid - ranges[i].first); glyph += (ranges[i].nLeft + 1); @@ -500,7 +500,7 @@ struct Charset if (unlikely (fmt1 == nullptr)) return_trace (false); 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); fmt1->ranges[i].first = sid_ranges[i].code; fmt1->ranges[i].nLeft = sid_ranges[i].glyph; @@ -514,7 +514,7 @@ struct Charset if (unlikely (fmt2 == nullptr)) return_trace (false); 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); fmt2->ranges[i].first = sid_ranges[i].code; fmt2->ranges[i].nLeft = sid_ranges[i].glyph; @@ -1298,7 +1298,7 @@ struct cff1 void fini () { glyph_names.fini (); - + SUPER::fini (); } @@ -1335,7 +1335,7 @@ struct cff1 { if (len < 0) len = strlen (name); if (unlikely (!len)) return false; - + gname_t key = { hb_bytes_t (name, len), 0 }; const gname_t *gname = glyph_names.bsearch (key); if (gname == nullptr) return false; @@ -1366,7 +1366,7 @@ struct cff1 int cmp (const gname_t &a) const { return cmp (&a, this); } }; - + hb_sorted_vector_t glyph_names; typedef accelerator_templ_t SUPER; diff --git a/src/hb-ot-color-cbdt-table.hh b/src/hb-ot-color-cbdt-table.hh index 0914b5781..01af6e53e 100644 --- a/src/hb-ot-color-cbdt-table.hh +++ b/src/hb-ot-color-cbdt-table.hh @@ -145,7 +145,7 @@ struct IndexSubtableFormat1Or3 IndexSubtableHeader header; UnsizedArrayOf> - offsetArrayZ; + offsetArrayZ; public: DEFINE_SIZE_ARRAY(8, offsetArrayZ); }; diff --git a/src/hb-ot-gasp-table.hh b/src/hb-ot-gasp-table.hh index 94fff58a1..4f291924a 100644 --- a/src/hb-ot-gasp-table.hh +++ b/src/hb-ot-gasp-table.hh @@ -48,8 +48,8 @@ struct GaspRange } public: - HBUINT16 rangeMaxPPEM; /* Upper limit of range, in PPEM */ - HBUINT16 rangeGaspBehavior; + HBUINT16 rangeMaxPPEM; /* Upper limit of range, in PPEM */ + HBUINT16 rangeGaspBehavior; /* Flags describing desired rasterizer behavior. */ public: DEFINE_SIZE_STATIC (4); diff --git a/src/hb-ot-layout-common.hh b/src/hb-ot-layout-common.hh index abd88334c..4ac9c3ca2 100644 --- a/src/hb-ot-layout-common.hh +++ b/src/hb-ot-layout-common.hh @@ -1344,7 +1344,7 @@ static void ClassDef_remap_and_serialize (hb_serialize_context_t *c, hb_map_t *klass_map /*INOUT*/) { bool has_no_match = glyphset.get_population () > gid_klass_map.get_population (); - + hb_map_t 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); idx++; } - + auto it = + glyphs.iter () | hb_map_retains_sorting ([&] (const HBGlyphID& gid) -> hb_pair_t @@ -1366,7 +1366,7 @@ static void ClassDef_remap_and_serialize (hb_serialize_context_t *c, return hb_pair ((hb_codepoint_t)gid, new_klass); }) ; - + c->propagate_error (glyphs, klasses); ClassDef_serialize (c, it); } @@ -1412,7 +1412,7 @@ struct ClassDefFormat1 TRACE_SUBSET (this); const hb_set_t &glyphset = *c->plan->glyphset (); const hb_map_t &glyph_map = *c->plan->glyph_map; - + hb_sorted_vector_t glyphs; hb_sorted_vector_t orig_klasses; hb_map_t gid_org_klass_map; @@ -2031,8 +2031,8 @@ struct VarData for (r = 0; r < ri_count; r++) if (delta_sz[r]) { - ri_map[r] = (delta_sz[r] == kShort)? short_index++ : byte_index++; - new_ri_count++; + ri_map[r] = (delta_sz[r] == kShort)? short_index++ : byte_index++; + new_ri_count++; } shortCount = new_short_count; @@ -2145,7 +2145,7 @@ struct VariationStore bool serialize (hb_serialize_context_t *c, const VariationStore *src, - const hb_array_t &inner_maps) + const hb_array_t &inner_maps) { TRACE_SERIALIZE (this); unsigned int set_count = 0; diff --git a/src/hb-ot-layout-gsubgpos.hh b/src/hb-ot-layout-gsubgpos.hh index c9dc41717..785fe2077 100644 --- a/src/hb-ot-layout-gsubgpos.hh +++ b/src/hb-ot-layout-gsubgpos.hh @@ -1363,7 +1363,7 @@ struct Rule * glyph */ HBUINT16 lookupCount; /* Number of LookupRecords */ UnsizedArrayOf - inputZ; /* Array of match inputs--start with + inputZ; /* Array of match inputs--start with * second glyph */ /*UnsizedArrayOf lookupRecordX;*/ /* Array of LookupRecords--in @@ -2992,11 +2992,11 @@ struct GSUBGPOS FixedVersion<>version; /* Version of the GSUB/GPOS table--initially set * to 0x00010000u */ OffsetTo - scriptList; /* ScriptList table */ + scriptList; /* ScriptList table */ OffsetTo - featureList; /* FeatureList table */ + featureList; /* FeatureList table */ OffsetTo - lookupList; /* LookupList table */ + lookupList; /* LookupList table */ LOffsetTo featureVars; /* Offset to Feature Variations table--from beginning of table diff --git a/src/hb-ot-layout-jstf-table.hh b/src/hb-ot-layout-jstf-table.hh index 53eb623cf..ffd2bf457 100644 --- a/src/hb-ot-layout-jstf-table.hh +++ b/src/hb-ot-layout-jstf-table.hh @@ -222,7 +222,7 @@ struct JSTF FixedVersion<>version; /* Version of the JSTF table--initially set * to 0x00010000u */ RecordArrayOf - scriptList; /* Array of JstfScripts--listed + scriptList; /* Array of JstfScripts--listed * alphabetically by ScriptTag */ public: DEFINE_SIZE_ARRAY (6, scriptList); diff --git a/src/hb-ot-math-table.hh b/src/hb-ot-math-table.hh index 7529e0c08..519111276 100644 --- a/src/hb-ot-math-table.hh +++ b/src/hb-ot-math-table.hh @@ -645,27 +645,28 @@ struct MathVariants } protected: - HBUINT16 minConnectorOverlap; /* Minimum overlap of connecting - * glyphs during glyph construction, - * in design units. */ - OffsetTo vertGlyphCoverage; /* Offset to Coverage table - - * from the beginning of MathVariants - * table. */ - OffsetTo horizGlyphCoverage; /* Offset to Coverage table - - * from the beginning of MathVariants - * table. */ - HBUINT16 vertGlyphCount; /* Number of glyphs for which - * information is provided for - * vertically growing variants. */ - HBUINT16 horizGlyphCount; /* Number of glyphs for which - * information is provided for - * horizontally growing variants. */ + HBUINT16 minConnectorOverlap; + /* Minimum overlap of connecting + * glyphs during glyph construction, + * in design units. */ + OffsetTo vertGlyphCoverage; /* Offset to Coverage table - + * from the beginning of MathVariants + * table. */ + OffsetTo horizGlyphCoverage;/* Offset to Coverage table - + * from the beginning of MathVariants + * table. */ + HBUINT16 vertGlyphCount; /* Number of glyphs for which + * information is provided for + * vertically growing variants. */ + HBUINT16 horizGlyphCount;/* Number of glyphs for which + * information is provided for + * horizontally growing variants. */ /* Array of offsets to MathGlyphConstruction tables - from the beginning of the MathVariants table, for shapes growing in vertical/horizontal direction. */ UnsizedArrayOf> - glyphConstruction; + glyphConstruction; public: DEFINE_SIZE_ARRAY (10, glyphConstruction); diff --git a/src/hb-ot-shape-complex-indic-machine.rl b/src/hb-ot-shape-complex-indic-machine.rl index 5f819bd29..1613548a5 100644 --- a/src/hb-ot-shape-complex-indic-machine.rl +++ b/src/hb-ot-shape-complex-indic-machine.rl @@ -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; vowel_syllable = reph? V.n? (ZWJ | 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; other = any; diff --git a/src/hb-ot-shape-complex-myanmar-machine.rl b/src/hb-ot-shape-complex-myanmar-machine.rl index 67133cd73..098a63e53 100644 --- a/src/hb-ot-shape-complex-myanmar-machine.rl +++ b/src/hb-ot-shape-complex-myanmar-machine.rl @@ -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); 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; other = any; diff --git a/src/hb-ot-var-avar-table.hh b/src/hb-ot-var-avar-table.hh index ef8ba3f5a..b40ca7202 100644 --- a/src/hb-ot-var-avar-table.hh +++ b/src/hb-ot-var-avar-table.hh @@ -51,7 +51,7 @@ struct AxisValueMap public: F2DOT14 coords[2]; // F2DOT14 fromCoord; /* A normalized coordinate value obtained using -// * default normalization. */ +// * default normalization. */ // F2DOT14 toCoord; /* The modified, normalized coordinate value. */ public: diff --git a/src/hb-ot-var-gvar-table.hh b/src/hb-ot-var-gvar-table.hh index 96afc1db3..37e714874 100644 --- a/src/hb-ot-var-gvar-table.hh +++ b/src/hb-ot-var-gvar-table.hh @@ -106,7 +106,7 @@ struct TupleVarHeader { return StructAtOffset (this, get_size (axis_count)); } float calculate_scalar (const int *coords, unsigned int coord_count, - const hb_array_t shared_tuples) const + const hb_array_t shared_tuples) const { const F2DOT14 *peak_tuple; @@ -260,10 +260,10 @@ struct GlyphVarData }; static bool get_tuple_iterator (const GlyphVarData *var_data, - unsigned int length, - unsigned int axis_count, - hb_vector_t &shared_indices /* OUT */, - tuple_iterator_t *iterator /* OUT */) + unsigned int length, + unsigned int axis_count, + hb_vector_t &shared_indices /* OUT */, + tuple_iterator_t *iterator /* OUT */) { iterator->init (var_data, length, axis_count); if (!iterator->get_shared_indices (shared_indices)) @@ -513,7 +513,7 @@ struct gvar if (unlikely ((gvar_table->glyphCount != face->get_num_glyphs ()) || (gvar_table->axisCount != axis_count))) - fini (); + fini (); unsigned int num_shared_coord = gvar_table->sharedTupleCount * gvar_table->axisCount; shared_tuples.resize (num_shared_coord); @@ -543,11 +543,11 @@ struct gvar float next_delta = T::get (deltas[next]); 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)) - 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)) - return (prev_val > next_val) ? prev_delta : next_delta; + return (prev_val > next_val) ? prev_delta : next_delta; /* linear interpolation */ float r = (target_val - prev_val) / (next_val - prev_val); diff --git a/src/hb-ot-var-hvar-table.hh b/src/hb-ot-var-hvar-table.hh index eda74c714..006624d95 100644 --- a/src/hb-ot-var-hvar-table.hh +++ b/src/hb-ot-var-hvar-table.hh @@ -113,7 +113,7 @@ struct DeltaSetIndexMap * representation of delta-set indices. */ HBUINT16 mapCount; /* The number of mapping entries. */ UnsizedArrayOf - mapDataZ; /* The delta-set index mapping data. */ + mapDataZ; /* The delta-set index mapping data. */ public: DEFINE_SIZE_ARRAY (4, mapDataZ); @@ -128,10 +128,10 @@ struct index_map_subset_plan_t VORG_INDEX }; - void init (const DeltaSetIndexMap &index_map, - hb_inc_bimap_t &outer_map, - hb_vector_t &inner_sets, - const hb_subset_plan_t *plan) + void init (const DeltaSetIndexMap &index_map, + hb_inc_bimap_t &outer_map, + hb_vector_t &inner_sets, + const hb_subset_plan_t *plan) { map_count = 0; outer_bit_count = 0; @@ -288,7 +288,7 @@ struct hvarvvar_subset_plan_t if (retain_adv_map) { 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); else inner_maps[0].skip (); diff --git a/src/hb-subset-cff-common.cc b/src/hb-subset-cff-common.cc index c9a880ad5..1536c0d18 100644 --- a/src/hb-subset-cff-common.cc +++ b/src/hb-subset-cff-common.cc @@ -108,7 +108,7 @@ hb_plan_subset_cff_fdselect (const hb_subset_plan_t *plan, fdmap.add (fd); hb_set_destroy (set); if (unlikely (fdmap.get_population () != subset_fd_count)) - return false; + return false; } /* update each font dict index stored as "code" in fdselect_ranges */ diff --git a/src/hb-subset-cff-common.hh b/src/hb-subset-cff-common.hh index 1df9fb7b0..e9adb4278 100644 --- a/src/hb-subset-cff-common.hh +++ b/src/hb-subset-cff-common.hh @@ -300,14 +300,14 @@ struct subr_flattener_t hb_codepoint_t glyph; if (!plan->old_gid_for_new_gid (i, &glyph)) { - /* add an endchar only charstring for a missing glyph if CFF1 */ - if (endchar_op != OpCode_Invalid) flat_charstrings[i].push (endchar_op); - continue; + /* add an endchar only charstring for a missing glyph if CFF1 */ + if (endchar_op != OpCode_Invalid) flat_charstrings[i].push (endchar_op); + continue; } const byte_str_t str = (*acc.charStrings)[glyph]; unsigned int fd = acc.fdSelect->get_fd (glyph); if (unlikely (fd >= acc.fdCount)) - return false; + return false; cs_interpreter_t interp; interp.env.init (str, acc, fd); flatten_param_t param = { flat_charstrings[i], plan->drop_hints }; @@ -456,7 +456,7 @@ struct parsed_cs_str_t : parsed_values_t bool vsindex_dropped; bool has_prefix_; op_code_t prefix_op_; - number_t prefix_num_; + number_t prefix_num_; private: typedef parsed_values_t SUPER; @@ -523,9 +523,9 @@ struct subr_subset_param_t * it must be because we are calling it recursively. * Handle it as an error. */ if (unlikely (calling && !parsed_str->is_parsed () && (parsed_str->values.length > 0))) - env.set_error (); + env.set_error (); else - current_parsed_str = parsed_str; + current_parsed_str = parsed_str; } else env.set_error (); @@ -659,11 +659,11 @@ struct subr_subsetter_t { hb_codepoint_t glyph; if (!plan->old_gid_for_new_gid (i, &glyph)) - continue; + continue; const byte_str_t str = (*acc.charStrings)[glyph]; unsigned int fd = acc.fdSelect->get_fd (glyph); if (unlikely (fd >= acc.fdCount)) - return false; + return false; cs_interpreter_t interp; interp.env.init (str, acc, fd); @@ -740,13 +740,13 @@ struct subr_subsetter_t hb_codepoint_t glyph; if (!plan->old_gid_for_new_gid (i, &glyph)) { - /* add an endchar only charstring for a missing glyph if CFF1 */ - if (endchar_op != OpCode_Invalid) buffArray[i].push (endchar_op); - continue; + /* add an endchar only charstring for a missing glyph if CFF1 */ + if (endchar_op != OpCode_Invalid) buffArray[i].push (endchar_op); + continue; } unsigned int fd = acc.fdSelect->get_fd (glyph); if (unlikely (fd >= acc.fdCount)) - return false; + return false; if (unlikely (!encode_str (parsed_charstrings[i], fd, buffArray[i]))) return false; } @@ -900,11 +900,11 @@ struct subr_subsetter_t { parsed_cs_op_t &csop = str.values[pos]; if (csop.op == OpCode_return) - break; + break; if (!csop.for_drop ()) { - drop.all_dropped = false; - break; + drop.all_dropped = false; + break; } } @@ -986,7 +986,7 @@ struct subr_subsetter_t } protected: - const ACC &acc; + const ACC &acc; const hb_subset_plan_t *plan; subr_closures_t closures; diff --git a/src/hb-subset-cff1.cc b/src/hb-subset-cff1.cc index dda830295..6c3e2867d 100644 --- a/src/hb-subset-cff1.cc +++ b/src/hb-subset-cff1.cc @@ -484,7 +484,7 @@ struct cff_subset_plan { hb_codepoint_t 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; } code = acc.glyph_to_code (old_glyph); @@ -544,7 +544,7 @@ struct cff_subset_plan { hb_codepoint_t 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; } 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++) { if (!plan->old_gid_for_new_gid(new_glyph, &old_glyph)) - continue; + continue; if (new_glyph != old_glyph) { gid_renum = true; break; @@ -655,7 +655,7 @@ struct cff_subset_plan { unsigned int topDictSize = TopDict::calculate_serialized_size (topdict_mod, topSzr); offsets.topDictInfo.offSize = calcOffSize(topDictSize); if (unlikely (offsets.topDictInfo.offSize > 4)) - return false; + return false; final_size += CFF1IndexOf::calculate_serialized_size (offsets.topDictInfo.offSize, &topdict_mod, 1, topdict_sizes, topSzr); @@ -683,7 +683,7 @@ struct cff_subset_plan { if (unlikely (!collect_sids_in_dicts (acc))) return false; if (unlikely (sidmap.get_population () > 0x8000)) /* assumption: a dict won't reference that many strings */ - return false; + return false; if (subset_charset) offsets.charsetInfo.size = plan_subset_charset (acc, plan); @@ -727,7 +727,7 @@ struct cff_subset_plan { unsigned int dataSize = subset_globalsubrs.total_size (); offsets.globalSubrsInfo.offSize = calcOffSize (dataSize); if (unlikely (offsets.globalSubrsInfo.offSize > 4)) - return false; + return false; offsets.globalSubrsInfo.size = CFF1Subrs::calculate_serialized_size (offsets.globalSubrsInfo.offSize, subset_globalsubrs.length, dataSize); /* local subrs */ @@ -795,7 +795,7 @@ struct cff_subset_plan { offsets.FDArrayInfo.offSize = calcOffSize (dictsSize); if (unlikely (offsets.FDArrayInfo.offSize > 4)) - return false; + return false; 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 (); offsets.charStringsInfo.offSize = calcOffSize (dataSize); if (unlikely (offsets.charStringsInfo.offSize > 4)) - return false; + return false; final_size += CFF1CharStrings::calculate_serialized_size (offsets.charStringsInfo.offSize, plan->num_output_glyphs (), dataSize); } diff --git a/src/hb-subset-cff2.cc b/src/hb-subset-cff2.cc index 2117fd349..aaa213026 100644 --- a/src/hb-subset-cff2.cc +++ b/src/hb-subset-cff2.cc @@ -116,8 +116,8 @@ struct cff2_cs_opset_flatten_t : cff2_cs_opset_t 0) && (env.argStack.get_count () >= arg.numValues)))) - { + if (unlikely (!((arg.numValues > 0) && (env.argStack.get_count () >= arg.numValues)))) + { env.set_error (); return; } @@ -144,8 +144,8 @@ struct cff2_cs_opset_flatten_t : cff2_cs_opset_t