minor
This commit is contained in:
parent
7e3edfa454
commit
d0e2addd43
|
@ -101,7 +101,7 @@ struct BaselineTableFormat3Part
|
|||
bool sanitize (hb_sanitize_context_t *c) const
|
||||
{
|
||||
TRACE_SANITIZE (this);
|
||||
return_trace (c->check_struct (this) && lookupTable.sanitize (c));
|
||||
return_trace (likely (c->check_struct (this) && lookupTable.sanitize (c)));
|
||||
}
|
||||
|
||||
protected:
|
||||
|
|
|
@ -484,7 +484,7 @@ struct KerxSubTableFormat4
|
|||
};
|
||||
|
||||
driver_context_t (const KerxSubTableFormat4 *table,
|
||||
hb_aat_apply_context_t *c_) :
|
||||
hb_aat_apply_context_t *c_) :
|
||||
c (c_),
|
||||
action_type ((table->flags & ActionType) >> 30),
|
||||
ankrData ((HBUINT16 *) ((const char *) &table->machine + (table->flags & Offset))),
|
||||
|
@ -493,9 +493,7 @@ struct KerxSubTableFormat4
|
|||
|
||||
bool is_actionable (StateTableDriver<Types, EntryData> *driver HB_UNUSED,
|
||||
const Entry<EntryData> &entry)
|
||||
{
|
||||
return entry.data.ankrActionIndex != 0xFFFF;
|
||||
}
|
||||
{ return entry.data.ankrActionIndex != 0xFFFF; }
|
||||
void transition (StateTableDriver<Types, EntryData> *driver,
|
||||
const Entry<EntryData> &entry)
|
||||
{
|
||||
|
@ -630,7 +628,7 @@ struct KerxSubTableFormat6
|
|||
bool is_long () const { return flags & ValuesAreLong; }
|
||||
|
||||
int get_kerning (hb_codepoint_t left, hb_codepoint_t right,
|
||||
hb_aat_apply_context_t *c) const
|
||||
hb_aat_apply_context_t *c) const
|
||||
{
|
||||
unsigned int num_glyphs = c->sanitizer.get_num_glyphs ();
|
||||
if (is_long ())
|
||||
|
|
|
@ -971,7 +971,7 @@ struct Chain
|
|||
}
|
||||
|
||||
void apply (hb_aat_apply_context_t *c,
|
||||
hb_mask_t flags) const
|
||||
hb_mask_t flags) const
|
||||
{
|
||||
const ChainSubtable<Types> *subtable = &StructAfter<ChainSubtable<Types>> (featureZ.as_array (featureCount));
|
||||
unsigned int count = subtableCount;
|
||||
|
|
|
@ -1096,8 +1096,8 @@ hb_buffer_get_flags (hb_buffer_t *buffer)
|
|||
* Since: 0.9.42
|
||||
**/
|
||||
void
|
||||
hb_buffer_set_cluster_level (hb_buffer_t *buffer,
|
||||
hb_buffer_cluster_level_t cluster_level)
|
||||
hb_buffer_set_cluster_level (hb_buffer_t *buffer,
|
||||
hb_buffer_cluster_level_t cluster_level)
|
||||
{
|
||||
if (unlikely (hb_object_is_immutable (buffer)))
|
||||
return;
|
||||
|
|
|
@ -318,7 +318,7 @@ struct hb_buffer_t
|
|||
HB_INTERNAL void delete_glyph ();
|
||||
|
||||
void unsafe_to_break (unsigned int start,
|
||||
unsigned int end)
|
||||
unsigned int end)
|
||||
{
|
||||
if (end - start < 2)
|
||||
return;
|
||||
|
|
|
@ -52,7 +52,7 @@ struct blend_arg_t : number_t
|
|||
void set_real (double v) { reset_blends (); number_t::set_real (v); }
|
||||
|
||||
void set_blends (unsigned int numValues_, unsigned int valueIndex_,
|
||||
unsigned int numBlends, hb_array_t<const blend_arg_t> blends_)
|
||||
unsigned int numBlends, hb_array_t<const blend_arg_t> blends_)
|
||||
{
|
||||
numValues = numValues_;
|
||||
valueIndex = valueIndex_;
|
||||
|
|
|
@ -339,7 +339,7 @@ struct hb_font_t
|
|||
}
|
||||
|
||||
hb_bool_t get_glyph_contour_point (hb_codepoint_t glyph, unsigned int point_index,
|
||||
hb_position_t *x, hb_position_t *y)
|
||||
hb_position_t *x, hb_position_t *y)
|
||||
{
|
||||
*x = *y = 0;
|
||||
return klass->get.f.glyph_contour_point (this, user_data,
|
||||
|
|
|
@ -157,10 +157,10 @@ struct CmapSubtableFormat4
|
|||
template<typename Iterator,
|
||||
hb_requires (hb_is_iterator (Iterator))>
|
||||
HBINT16* serialize_idDelta_array (hb_serialize_context_t *c,
|
||||
Iterator it,
|
||||
HBUINT16 *endCode,
|
||||
HBUINT16 *startCode,
|
||||
unsigned segcount)
|
||||
Iterator it,
|
||||
HBUINT16 *endCode,
|
||||
HBUINT16 *startCode,
|
||||
unsigned segcount)
|
||||
{
|
||||
unsigned i = 0;
|
||||
hb_codepoint_t last_gid = 0, start_gid = 0, last_cp = 0xFFFF;
|
||||
|
@ -317,12 +317,12 @@ struct CmapSubtableFormat4
|
|||
HBUINT16 last;
|
||||
};
|
||||
|
||||
const HBUINT16 *found =hb_bsearch (codepoint,
|
||||
this->endCount,
|
||||
this->segCount,
|
||||
2,
|
||||
_hb_cmp_method<hb_codepoint_t, CustomRange, unsigned>,
|
||||
this->segCount + 1);
|
||||
const HBUINT16 *found = hb_bsearch (codepoint,
|
||||
this->endCount,
|
||||
this->segCount,
|
||||
2,
|
||||
_hb_cmp_method<hb_codepoint_t, CustomRange, unsigned>,
|
||||
this->segCount + 1);
|
||||
if (!found)
|
||||
return false;
|
||||
unsigned int i = found - endCount;
|
||||
|
@ -466,8 +466,8 @@ struct CmapSubtableFormat4
|
|||
* If that is the case, just change the value to truncate
|
||||
* the subtable at the end of the blob. */
|
||||
uint16_t new_length = (uint16_t) hb_min ((uintptr_t) 65535,
|
||||
(uintptr_t) (c->end -
|
||||
(char *) this));
|
||||
(uintptr_t) (c->end -
|
||||
(char *) this));
|
||||
if (!c->try_set (&length, new_length))
|
||||
return_trace (false);
|
||||
}
|
||||
|
@ -793,7 +793,7 @@ struct DefaultUVS : SortedArrayOf<UnicodeValueRange, HBUINT32>
|
|||
{
|
||||
hb_codepoint_t first = arrayZ[i].startUnicodeValue;
|
||||
hb_codepoint_t last = hb_min ((hb_codepoint_t) (first + arrayZ[i].additionalCount),
|
||||
(hb_codepoint_t) HB_UNICODE_MAX);
|
||||
(hb_codepoint_t) HB_UNICODE_MAX);
|
||||
out->add_range (first, last);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1297,9 +1297,9 @@ struct CoverageFormat2
|
|||
unsigned int get_coverage (hb_codepoint_t glyph_id) const
|
||||
{
|
||||
const RangeRecord &range = rangeRecord.bsearch (glyph_id);
|
||||
return likely (range.first <= range.last) ?
|
||||
(unsigned int) range.value + (glyph_id - range.first) :
|
||||
NOT_COVERED;
|
||||
return likely (range.first <= range.last)
|
||||
? (unsigned int) range.value + (glyph_id - range.first)
|
||||
: NOT_COVERED;
|
||||
}
|
||||
|
||||
template <typename Iterator,
|
||||
|
@ -2191,7 +2191,7 @@ struct VarRegionAxis
|
|||
struct VarRegionList
|
||||
{
|
||||
float evaluate (unsigned int region_index,
|
||||
const int *coords, unsigned int coord_len) const
|
||||
const int *coords, unsigned int coord_len) const
|
||||
{
|
||||
if (unlikely (region_index >= regionCount))
|
||||
return 0.;
|
||||
|
@ -2261,8 +2261,8 @@ struct VarData
|
|||
{ return itemCount * get_row_size (); }
|
||||
|
||||
float get_delta (unsigned int inner,
|
||||
const int *coords, unsigned int coord_count,
|
||||
const VarRegionList ®ions) const
|
||||
const int *coords, unsigned int coord_count,
|
||||
const VarRegionList ®ions) const
|
||||
{
|
||||
if (unlikely (inner >= itemCount))
|
||||
return 0.;
|
||||
|
@ -2836,7 +2836,7 @@ struct FeatureVariations
|
|||
static constexpr unsigned NOT_FOUND_INDEX = 0xFFFFFFFFu;
|
||||
|
||||
bool find_index (const int *coords, unsigned int coord_len,
|
||||
unsigned int *index) const
|
||||
unsigned int *index) const
|
||||
{
|
||||
unsigned int count = varRecords.len;
|
||||
for (unsigned int i = 0; i < count; i++)
|
||||
|
|
|
@ -231,9 +231,9 @@ struct CaretValueFormat3
|
|||
struct CaretValue
|
||||
{
|
||||
hb_position_t get_caret_value (hb_font_t *font,
|
||||
hb_direction_t direction,
|
||||
hb_codepoint_t glyph_id,
|
||||
const VariationStore &var_store) const
|
||||
hb_direction_t direction,
|
||||
hb_codepoint_t glyph_id,
|
||||
const VariationStore &var_store) const
|
||||
{
|
||||
switch (u.format) {
|
||||
case 1: return u.format1.get_caret_value (font, direction);
|
||||
|
|
|
@ -79,14 +79,14 @@ struct ValueFormat : HBUINT16
|
|||
|
||||
/* All fields are options. Only those available advance the value pointer. */
|
||||
#if 0
|
||||
HBINT16 xPlacement; /* Horizontal adjustment for
|
||||
HBINT16 xPlacement; /* Horizontal adjustment for
|
||||
* placement--in design units */
|
||||
HBINT16 yPlacement; /* Vertical adjustment for
|
||||
HBINT16 yPlacement; /* Vertical adjustment for
|
||||
* placement--in design units */
|
||||
HBINT16 xAdvance; /* Horizontal adjustment for
|
||||
HBINT16 xAdvance; /* Horizontal adjustment for
|
||||
* advance--in design units (only used
|
||||
* for horizontal writing) */
|
||||
HBINT16 yAdvance; /* Vertical adjustment for advance--in
|
||||
HBINT16 yAdvance; /* Vertical adjustment for advance--in
|
||||
* design units (only used for vertical
|
||||
* writing) */
|
||||
OffsetTo<Device> xPlaDevice; /* Offset to Device table for
|
||||
|
@ -1063,7 +1063,7 @@ struct PairSet
|
|||
}
|
||||
|
||||
void collect_glyphs (hb_collect_glyphs_context_t *c,
|
||||
const ValueFormat *valueFormats) const
|
||||
const ValueFormat *valueFormats) const
|
||||
{
|
||||
unsigned int len1 = valueFormats[0].get_len ();
|
||||
unsigned int len2 = valueFormats[1].get_len ();
|
||||
|
@ -1816,8 +1816,10 @@ static void Markclass_closure_and_remap_indexes (const Coverage &mark_coverage,
|
|||
struct MarkBasePosFormat1
|
||||
{
|
||||
bool intersects (const hb_set_t *glyphs) const
|
||||
{ return (this+markCoverage).intersects (glyphs) &&
|
||||
(this+baseCoverage).intersects (glyphs); }
|
||||
{
|
||||
return (this+markCoverage).intersects (glyphs) &&
|
||||
(this+baseCoverage).intersects (glyphs);
|
||||
}
|
||||
|
||||
void closure_lookups (hb_closure_lookups_context_t *c) const {}
|
||||
|
||||
|
@ -2031,8 +2033,10 @@ typedef OffsetListOf<LigatureAttach> LigatureArray;
|
|||
struct MarkLigPosFormat1
|
||||
{
|
||||
bool intersects (const hb_set_t *glyphs) const
|
||||
{ return (this+markCoverage).intersects (glyphs) &&
|
||||
(this+ligatureCoverage).intersects (glyphs); }
|
||||
{
|
||||
return (this+markCoverage).intersects (glyphs) &&
|
||||
(this+ligatureCoverage).intersects (glyphs);
|
||||
}
|
||||
|
||||
void closure_lookups (hb_closure_lookups_context_t *c) const {}
|
||||
|
||||
|
@ -2189,8 +2193,10 @@ typedef AnchorMatrix Mark2Array; /* mark2-major--
|
|||
struct MarkMarkPosFormat1
|
||||
{
|
||||
bool intersects (const hb_set_t *glyphs) const
|
||||
{ return (this+mark1Coverage).intersects (glyphs) &&
|
||||
(this+mark2Coverage).intersects (glyphs); }
|
||||
{
|
||||
return (this+mark1Coverage).intersects (glyphs) &&
|
||||
(this+mark2Coverage).intersects (glyphs);
|
||||
}
|
||||
|
||||
void closure_lookups (hb_closure_lookups_context_t *c) const {}
|
||||
|
||||
|
@ -2254,12 +2260,15 @@ struct MarkMarkPosFormat1
|
|||
unsigned int comp1 = _hb_glyph_info_get_lig_comp (&buffer->cur());
|
||||
unsigned int comp2 = _hb_glyph_info_get_lig_comp (&buffer->info[j]);
|
||||
|
||||
if (likely (id1 == id2)) {
|
||||
if (likely (id1 == id2))
|
||||
{
|
||||
if (id1 == 0) /* Marks belonging to the same base. */
|
||||
goto good;
|
||||
else if (comp1 == comp2) /* Marks belonging to the same ligature component. */
|
||||
goto good;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
/* If ligature ids don't match, it may be the case that one of the marks
|
||||
* itself is a ligature. In which case match. */
|
||||
if ((id1 > 0 && !comp1) || (id2 > 0 && !comp2))
|
||||
|
|
|
@ -852,8 +852,8 @@ struct Ligature
|
|||
|
||||
auto *out = c->serializer->start_embed (*this);
|
||||
return_trace (out->serialize (c->serializer,
|
||||
glyph_map[ligGlyph],
|
||||
it));
|
||||
glyph_map[ligGlyph],
|
||||
it));
|
||||
}
|
||||
|
||||
public:
|
||||
|
|
|
@ -335,7 +335,7 @@ struct hb_ot_apply_context_t :
|
|||
void set_mask (hb_mask_t mask_) { mask = mask_; }
|
||||
void set_syllable (uint8_t syllable_) { syllable = syllable_; }
|
||||
void set_match_func (match_func_t match_func_,
|
||||
const void *match_data_)
|
||||
const void *match_data_)
|
||||
{ match_func = match_func_; match_data = match_data_; }
|
||||
|
||||
enum may_match_t {
|
||||
|
@ -540,8 +540,8 @@ struct hb_ot_apply_context_t :
|
|||
|
||||
|
||||
hb_ot_apply_context_t (unsigned int table_index_,
|
||||
hb_font_t *font_,
|
||||
hb_buffer_t *buffer_) :
|
||||
hb_font_t *font_,
|
||||
hb_buffer_t *buffer_) :
|
||||
iter_input (), iter_context (),
|
||||
font (font_), face (font->face), buffer (buffer_),
|
||||
recurse_func (nullptr),
|
||||
|
|
|
@ -78,7 +78,7 @@ struct MathConstants
|
|||
}
|
||||
|
||||
hb_position_t get_value (hb_ot_math_constant_t constant,
|
||||
hb_font_t *font) const
|
||||
hb_font_t *font) const
|
||||
{
|
||||
switch (constant) {
|
||||
|
||||
|
@ -616,12 +616,12 @@ struct MathVariants
|
|||
.get_variants (direction, font, start_offset, variants_count, variants); }
|
||||
|
||||
unsigned int get_glyph_parts (hb_codepoint_t glyph,
|
||||
hb_direction_t direction,
|
||||
hb_font_t *font,
|
||||
unsigned int start_offset,
|
||||
unsigned int *parts_count, /* IN/OUT */
|
||||
hb_ot_math_glyph_part_t *parts /* OUT */,
|
||||
hb_position_t *italics_correction /* OUT */) const
|
||||
hb_direction_t direction,
|
||||
hb_font_t *font,
|
||||
unsigned int start_offset,
|
||||
unsigned int *parts_count, /* IN/OUT */
|
||||
hb_ot_math_glyph_part_t *parts /* OUT */,
|
||||
hb_position_t *italics_correction /* OUT */) const
|
||||
{ return get_glyph_construction (glyph, direction, font)
|
||||
.get_assembly ()
|
||||
.get_parts (direction, font,
|
||||
|
@ -701,7 +701,7 @@ struct MATH
|
|||
}
|
||||
|
||||
hb_position_t get_constant (hb_ot_math_constant_t constant,
|
||||
hb_font_t *font) const
|
||||
hb_font_t *font) const
|
||||
{ return (this+mathConstants).get_value (constant, font); }
|
||||
|
||||
const MathGlyphInfo &get_glyph_info () const { return this+mathGlyphInfo; }
|
||||
|
|
|
@ -1097,12 +1097,12 @@ hb_ot_shape_internal (hb_ot_shape_context_t *c)
|
|||
if (likely (!hb_unsigned_mul_overflows (c->buffer->len, HB_BUFFER_MAX_LEN_FACTOR)))
|
||||
{
|
||||
c->buffer->max_len = hb_max (c->buffer->len * HB_BUFFER_MAX_LEN_FACTOR,
|
||||
(unsigned) HB_BUFFER_MAX_LEN_MIN);
|
||||
(unsigned) HB_BUFFER_MAX_LEN_MIN);
|
||||
}
|
||||
if (likely (!hb_unsigned_mul_overflows (c->buffer->len, HB_BUFFER_MAX_OPS_FACTOR)))
|
||||
{
|
||||
c->buffer->max_ops = hb_max (c->buffer->len * HB_BUFFER_MAX_OPS_FACTOR,
|
||||
(unsigned) HB_BUFFER_MAX_OPS_MIN);
|
||||
(unsigned) HB_BUFFER_MAX_OPS_MIN);
|
||||
}
|
||||
|
||||
/* Save the original direction, we use it later. */
|
||||
|
|
|
@ -545,7 +545,7 @@ struct gvar
|
|||
hb_vector_t<unsigned int> shared_indices;
|
||||
GlyphVariationData::tuple_iterator_t iterator;
|
||||
if (!GlyphVariationData::get_tuple_iterator (var_data_bytes, table->axisCount,
|
||||
shared_indices, &iterator))
|
||||
shared_indices, &iterator))
|
||||
return true; /* so isn't applied at all */
|
||||
|
||||
/* Save original points for inferred delta calculation */
|
||||
|
|
|
@ -303,13 +303,13 @@ struct cff2_subset_plan {
|
|||
if (acc.fdSelect != &Null (CFF2FDSelect))
|
||||
{
|
||||
if (unlikely (!hb_plan_subset_cff_fdselect (plan,
|
||||
orig_fdcount,
|
||||
*(const FDSelect *)acc.fdSelect,
|
||||
subset_fdcount,
|
||||
subset_fdselect_size,
|
||||
subset_fdselect_format,
|
||||
subset_fdselect_ranges,
|
||||
fdmap)))
|
||||
orig_fdcount,
|
||||
*(const FDSelect *)acc.fdSelect,
|
||||
subset_fdcount,
|
||||
subset_fdselect_size,
|
||||
subset_fdselect_format,
|
||||
subset_fdselect_ranges,
|
||||
fdmap)))
|
||||
return false;
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue