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'),
|
||||
/* 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) */
|
||||
|
|
|
@ -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<Lookup<NNOffsetTo<GlyphAnchors>>>
|
||||
lookupTable; /* Offset to the table's lookup table */
|
||||
|
|
|
@ -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<JustificationCategory>
|
||||
justClassTable; /* Offset to the justification category state table. */
|
||||
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
|
||||
* for the glyphs in your font.
|
||||
*
|
||||
|
@ -372,7 +372,7 @@ struct JustificationHeader
|
|||
*
|
||||
* The postcompensation subtable, if present in the font. */
|
||||
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
|
||||
* 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<JustificationHeader>
|
||||
horizData; /* Byte offset from the start of the justification table
|
||||
* to the header for tables that contain justification
|
||||
|
|
|
@ -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<TrackData>
|
||||
horizData; /* Offset from start of tracking table to TrackData
|
||||
* 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(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__)
|
||||
|
||||
|
||||
|
|
|
@ -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<unsigned char> (bs.length);
|
||||
if (unlikely (dest == nullptr))
|
||||
return_trace (false);
|
||||
|
@ -459,7 +459,7 @@ struct FDArray : CFFIndexOf<COUNT, FontDict>
|
|||
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<COUNT, FontDict>::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++)
|
||||
|
|
|
@ -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<gname_t> glyph_names;
|
||||
|
||||
typedef accelerator_templ_t<cff1_private_dict_opset_t, cff1_private_dict_values_t> SUPER;
|
||||
|
|
|
@ -145,7 +145,7 @@ struct IndexSubtableFormat1Or3
|
|||
|
||||
IndexSubtableHeader header;
|
||||
UnsizedArrayOf<Offset<OffsetType>>
|
||||
offsetArrayZ;
|
||||
offsetArrayZ;
|
||||
public:
|
||||
DEFINE_SIZE_ARRAY(8, offsetArrayZ);
|
||||
};
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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<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);
|
||||
})
|
||||
;
|
||||
|
||||
|
||||
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<HBGlyphID> glyphs;
|
||||
hb_sorted_vector_t<unsigned> 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 <hb_inc_bimap_t> &inner_maps)
|
||||
const hb_array_t <hb_inc_bimap_t> &inner_maps)
|
||||
{
|
||||
TRACE_SERIALIZE (this);
|
||||
unsigned int set_count = 0;
|
||||
|
|
|
@ -1363,7 +1363,7 @@ struct Rule
|
|||
* glyph */
|
||||
HBUINT16 lookupCount; /* Number of LookupRecords */
|
||||
UnsizedArrayOf<HBUINT16>
|
||||
inputZ; /* Array of match inputs--start with
|
||||
inputZ; /* Array of match inputs--start with
|
||||
* second glyph */
|
||||
/*UnsizedArrayOf<LookupRecord>
|
||||
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; /* ScriptList table */
|
||||
scriptList; /* ScriptList table */
|
||||
OffsetTo<FeatureList>
|
||||
featureList; /* FeatureList table */
|
||||
featureList; /* FeatureList table */
|
||||
OffsetTo<LookupList>
|
||||
lookupList; /* LookupList table */
|
||||
lookupList; /* LookupList table */
|
||||
LOffsetTo<FeatureVariations>
|
||||
featureVars; /* Offset to Feature Variations
|
||||
table--from beginning of table
|
||||
|
|
|
@ -222,7 +222,7 @@ struct JSTF
|
|||
FixedVersion<>version; /* Version of the JSTF table--initially set
|
||||
* to 0x00010000u */
|
||||
RecordArrayOf<JstfScript>
|
||||
scriptList; /* Array of JstfScripts--listed
|
||||
scriptList; /* Array of JstfScripts--listed
|
||||
* alphabetically by ScriptTag */
|
||||
public:
|
||||
DEFINE_SIZE_ARRAY (6, scriptList);
|
||||
|
|
|
@ -645,27 +645,28 @@ struct MathVariants
|
|||
}
|
||||
|
||||
protected:
|
||||
HBUINT16 minConnectorOverlap; /* Minimum overlap of connecting
|
||||
* glyphs during glyph construction,
|
||||
* in design units. */
|
||||
OffsetTo<Coverage> vertGlyphCoverage; /* Offset to Coverage table -
|
||||
* from the beginning of MathVariants
|
||||
* table. */
|
||||
OffsetTo<Coverage> 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<Coverage> vertGlyphCoverage; /* Offset to Coverage table -
|
||||
* from the beginning of MathVariants
|
||||
* table. */
|
||||
OffsetTo<Coverage> 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<OffsetTo<MathGlyphConstruction>>
|
||||
glyphConstruction;
|
||||
glyphConstruction;
|
||||
|
||||
public:
|
||||
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;
|
||||
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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -106,7 +106,7 @@ struct TupleVarHeader
|
|||
{ return StructAtOffset<TupleVarHeader> (this, get_size (axis_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;
|
||||
|
||||
|
@ -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<unsigned int> &shared_indices /* OUT */,
|
||||
tuple_iterator_t *iterator /* OUT */)
|
||||
unsigned int length,
|
||||
unsigned int axis_count,
|
||||
hb_vector_t<unsigned int> &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);
|
||||
|
|
|
@ -113,7 +113,7 @@ struct DeltaSetIndexMap
|
|||
* representation of delta-set indices. */
|
||||
HBUINT16 mapCount; /* The number of mapping entries. */
|
||||
UnsizedArrayOf<HBUINT8>
|
||||
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<hb_set_t *> &inner_sets,
|
||||
const hb_subset_plan_t *plan)
|
||||
void init (const DeltaSetIndexMap &index_map,
|
||||
hb_inc_bimap_t &outer_map,
|
||||
hb_vector_t<hb_set_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 ();
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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<ENV, OPSET, flatten_param_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<parsed_cs_op_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<parsed_cs_op_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<ENV, OPSET, subr_subset_param_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;
|
||||
|
|
|
@ -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<TopDict>::calculate_serialized_size<cff1_top_dict_values_mod_t>
|
||||
(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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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];
|
||||
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 ();
|
||||
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) &&
|
||||
(arg1.deltas.length == env.get_region_count ())))))
|
||||
{
|
||||
env.set_error ();
|
||||
return;
|
||||
env.set_error ();
|
||||
return;
|
||||
}
|
||||
encoder.encode_num (arg1);
|
||||
}
|
||||
|
|
|
@ -372,7 +372,7 @@ parse_unicodes (const char *name G_GNUC_UNUSED,
|
|||
{
|
||||
g_string_free (gs, TRUE);
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue