From 8c29dcaee4393e6e52dbe7081bc01ca83512bb7e Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 13 Oct 2022 12:04:32 -0600 Subject: [PATCH] s/HBFixed/F16DOT16/g --- src/hb-aat-layout-just-table.hh | 20 ++++++++++---------- src/hb-aat-layout-trak-table.hh | 8 ++++---- src/hb-open-type.hh | 4 ++-- src/hb-ot-color-colr-table.hh | 14 +++++++------- src/hb-ot-post-table.hh | 2 +- src/hb-ot-stat-table.hh | 14 +++++++------- src/hb-ot-var-fvar-table.hh | 20 ++++++++++---------- 7 files changed, 41 insertions(+), 41 deletions(-) diff --git a/src/hb-aat-layout-just-table.hh b/src/hb-aat-layout-just-table.hh index 57c105967..8fd3990f8 100644 --- a/src/hb-aat-layout-just-table.hh +++ b/src/hb-aat-layout-just-table.hh @@ -70,9 +70,9 @@ struct DecompositionAction ActionSubrecordHeader header; - HBFixed lowerLimit; /* If the distance factor is less than this value, + F16DOT16 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, + F16DOT16 upperLimit; /* If the distance factor is greater than this value, * then the ligature is decomposed. */ HBUINT16 order; /* Numerical order in which this ligature will * be decomposed; you may want infrequent ligatures @@ -118,7 +118,7 @@ struct ConditionalAddGlyphAction protected: ActionSubrecordHeader header; - HBFixed substThreshold; /* Distance growth factor (in ems) at which + F16DOT16 substThreshold; /* Distance growth factor (in ems) at which * this glyph is replaced and the growth factor * recalculated. */ HBGlyphID16 addGlyph; /* Glyph to be added as kashida. If this value is @@ -146,13 +146,13 @@ struct DuctileGlyphAction 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 that + F16DOT16 minimumLimit; /* The lowest value for the ductility axis that * still yields an acceptable appearance. Normally * this will be 1.0. */ - HBFixed noStretchValue; /* This is the default value that corresponds to + F16DOT16 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 + F16DOT16 maximumLimit; /* The highest value for the ductility axis that * still yields an acceptable appearance. */ public: DEFINE_SIZE_STATIC (22); @@ -271,14 +271,14 @@ struct JustWidthDeltaEntry }; protected: - HBFixed beforeGrowLimit;/* The ratio by which the advance width of the + F16DOT16 beforeGrowLimit;/* The ratio by which the advance width of the * glyph is permitted to grow on the left or top side. */ - HBFixed beforeShrinkLimit; + F16DOT16 beforeShrinkLimit; /* The ratio by which the advance width of the * glyph is permitted to shrink on the left or top side. */ - HBFixed afterGrowLimit; /* The ratio by which the advance width of the glyph + F16DOT16 afterGrowLimit; /* The ratio by which the advance width of the glyph * is permitted to shrink on the left or top side. */ - HBFixed afterShrinkLimit; + F16DOT16 afterShrinkLimit; /* The ratio by which the advance width of the glyph * is at most permitted to shrink on the right or * bottom side. */ diff --git a/src/hb-aat-layout-trak-table.hh b/src/hb-aat-layout-trak-table.hh index 68bcb2396..2ba9355b0 100644 --- a/src/hb-aat-layout-trak-table.hh +++ b/src/hb-aat-layout-trak-table.hh @@ -62,7 +62,7 @@ struct TrackTableEntry } protected: - HBFixed track; /* Track value for this record. */ + F16DOT16 track; /* Track value for this record. */ NameID trackNameID; /* The 'name' table index for this track. * (a short word or phrase like "loose" * or "very tight") */ @@ -82,7 +82,7 @@ struct TrackData const void *base) const { unsigned int sizes = nSizes; - hb_array_t size_table ((base+sizeTable).arrayZ, sizes); + hb_array_t size_table ((base+sizeTable).arrayZ, sizes); float s0 = size_table[idx].to_float (); float s1 = size_table[idx + 1].to_float (); @@ -120,7 +120,7 @@ struct TrackData if (!sizes) return 0.; if (sizes == 1) return trackTableEntry->get_value (base, 0, sizes); - hb_array_t size_table ((base+sizeTable).arrayZ, sizes); + hb_array_t size_table ((base+sizeTable).arrayZ, sizes); unsigned int size_index; for (size_index = 0; size_index < sizes - 1; size_index++) if (size_table[size_index].to_float () >= ptem) @@ -141,7 +141,7 @@ struct TrackData protected: HBUINT16 nTracks; /* Number of separate tracks included in this table. */ HBUINT16 nSizes; /* Number of point sizes included in this table. */ - NNOffset32To> + NNOffset32To> sizeTable; /* Offset from start of the tracking table to * Array[nSizes] of size values.. */ UnsizedArrayOf diff --git a/src/hb-open-type.hh b/src/hb-open-type.hh index d0d01a68c..523dba5a9 100644 --- a/src/hb-open-type.hh +++ b/src/hb-open-type.hh @@ -153,9 +153,9 @@ struct F2DOT14 : HBINT16 }; /* 32-bit signed fixed-point number (16.16). */ -struct HBFixed : HBINT32 +struct F16DOT16 : HBINT32 { - HBFixed& operator = (uint32_t i) { HBINT32::operator= (i); return *this; } + F16DOT16& operator = (uint32_t i) { HBINT32::operator= (i); return *this; } // 65536 means 1<<16 float to_float () const { return ((int32_t) v) / 65536.f; } void set_float (float f) { v = roundf (f * 65536.f); } diff --git a/src/hb-ot-color-colr-table.hh b/src/hb-ot-color-colr-table.hh index f01d383bd..908bf550f 100644 --- a/src/hb-ot-color-colr-table.hh +++ b/src/hb-ot-color-colr-table.hh @@ -358,14 +358,14 @@ struct Affine2x3 return_trace (c->check_struct (this)); } - HBFixed xx; - HBFixed yx; - HBFixed xy; - HBFixed yy; - HBFixed dx; - HBFixed dy; + F16DOT16 xx; + F16DOT16 yx; + F16DOT16 xy; + F16DOT16 yy; + F16DOT16 dx; + F16DOT16 dy; public: - DEFINE_SIZE_STATIC (6 * HBFixed::static_size); + DEFINE_SIZE_STATIC (6 * F16DOT16::static_size); }; struct PaintColrLayers diff --git a/src/hb-ot-post-table.hh b/src/hb-ot-post-table.hh index 80d02ffba..59c1de378 100644 --- a/src/hb-ot-post-table.hh +++ b/src/hb-ot-post-table.hh @@ -282,7 +282,7 @@ struct post * 0x00020000 for version 2.0 * 0x00025000 for version 2.5 (deprecated) * 0x00030000 for version 3.0 */ - HBFixed italicAngle; /* Italic angle in counter-clockwise degrees + F16DOT16 italicAngle; /* Italic angle in counter-clockwise degrees * from the vertical. Zero for upright text, * negative for text that leans to the right * (forward). */ diff --git a/src/hb-ot-stat-table.hh b/src/hb-ot-stat-table.hh index d83bf1421..af6d550c0 100644 --- a/src/hb-ot-stat-table.hh +++ b/src/hb-ot-stat-table.hh @@ -136,7 +136,7 @@ struct AxisValueFormat1 NameID valueNameID; /* The name ID for entries in the 'name' table * that provide a display string for this * attribute value. */ - HBFixed value; /* A numeric value for this attribute value. */ + F16DOT16 value; /* A numeric value for this attribute value. */ public: DEFINE_SIZE_STATIC (12); }; @@ -195,10 +195,10 @@ struct AxisValueFormat2 NameID valueNameID; /* The name ID for entries in the 'name' table * that provide a display string for this * attribute value. */ - HBFixed nominalValue; /* A numeric value for this attribute value. */ - HBFixed rangeMinValue; /* The minimum value for a range associated + F16DOT16 nominalValue; /* A numeric value for this attribute value. */ + F16DOT16 rangeMinValue; /* The minimum value for a range associated * with the specified name ID. */ - HBFixed rangeMaxValue; /* The maximum value for a range associated + F16DOT16 rangeMaxValue; /* The maximum value for a range associated * with the specified name ID. */ public: DEFINE_SIZE_STATIC (20); @@ -258,8 +258,8 @@ struct AxisValueFormat3 NameID valueNameID; /* The name ID for entries in the 'name' table * that provide a display string for this * attribute value. */ - HBFixed value; /* A numeric value for this attribute value. */ - HBFixed linkedValue; /* The numeric value for a style-linked mapping + F16DOT16 value; /* A numeric value for this attribute value. */ + F16DOT16 linkedValue; /* The numeric value for a style-linked mapping * from this value. */ public: DEFINE_SIZE_STATIC (16); @@ -280,7 +280,7 @@ struct AxisValueRecord HBUINT16 axisIndex; /* Zero-base index into the axis record array * identifying the axis to which this value * applies. Must be less than designAxisCount. */ - HBFixed value; /* A numeric value for this attribute value. */ + F16DOT16 value; /* A numeric value for this attribute value. */ public: DEFINE_SIZE_STATIC (6); }; diff --git a/src/hb-ot-var-fvar-table.hh b/src/hb-ot-var-fvar-table.hh index c65db02c9..af2386287 100644 --- a/src/hb-ot-var-fvar-table.hh +++ b/src/hb-ot-var-fvar-table.hh @@ -44,7 +44,7 @@ struct InstanceRecord { friend struct fvar; - hb_array_t get_coordinates (unsigned int axis_count) const + hb_array_t get_coordinates (unsigned int axis_count) const { return coordinatesZ.as_array (axis_count); } bool subset (hb_subset_context_t *c, @@ -55,7 +55,7 @@ struct InstanceRecord if (unlikely (!c->serializer->embed (subfamilyNameID))) return_trace (false); if (unlikely (!c->serializer->embed (flags))) return_trace (false); - const hb_array_t coords = get_coordinates (axis_count); + const hb_array_t coords = get_coordinates (axis_count); const hb_hashmap_t *axes_location = c->plan->user_axes_location; for (unsigned i = 0 ; i < axis_count; i++) { @@ -96,7 +96,7 @@ struct InstanceRecord NameID subfamilyNameID;/* The name ID for entries in the 'name' table * that provide subfamily names for this instance. */ HBUINT16 flags; /* Reserved for future use — set to 0. */ - UnsizedArrayOf + UnsizedArrayOf coordinatesZ; /* The coordinates array for this instance. */ //NameID postScriptNameIDX;/*Optional. The name ID for entries in the 'name' // * table that provide PostScript names for this @@ -189,9 +189,9 @@ struct AxisRecord public: Tag axisTag; /* Tag identifying the design variation for the axis. */ protected: - HBFixed minValue; /* The minimum coordinate value for the axis. */ - HBFixed defaultValue; /* The default coordinate value for the axis. */ - HBFixed maxValue; /* The maximum coordinate value for the axis. */ + F16DOT16 minValue; /* The minimum coordinate value for the axis. */ + F16DOT16 defaultValue; /* The default coordinate value for the axis. */ + F16DOT16 maxValue; /* The maximum coordinate value for the axis. */ public: HBUINT16 flags; /* Axis flags. */ NameID axisNameID; /* The name ID for entries in the 'name' table that @@ -306,7 +306,7 @@ struct fvar if (coords_length && *coords_length) { - hb_array_t instanceCoords = instance->get_coordinates (axisCount) + hb_array_t instanceCoords = instance->get_coordinates (axisCount) .sub_array (0, coords_length); for (unsigned int i = 0; i < instanceCoords.length; i++) coords[i] = instanceCoords.arrayZ[i].to_float (); @@ -339,7 +339,7 @@ struct fvar if (hb_any (+ hb_zip (instance->get_coordinates (axisCount), hb_range ((unsigned)axisCount)) | hb_filter (pinned_axes, hb_second) - | hb_map ([&] (const hb_pair_t& _) + | hb_map ([&] (const hb_pair_t& _) { hb_tag_t axis_tag = pinned_axes.get (_.second); float location = user_axes_location->get (axis_tag); @@ -426,8 +426,8 @@ struct fvar HBUINT16 instanceCount; /* The number of named instances defined in the font * (the number of records in the instances array). */ HBUINT16 instanceSize; /* The size in bytes of each InstanceRecord — set - * to either axisCount * sizeof(HBFixed) + 4, or to - * axisCount * sizeof(HBFixed) + 6. */ + * to either axisCount * sizeof(F16DOT16) + 4, or to + * axisCount * sizeof(F16DOT16) + 6. */ public: DEFINE_SIZE_STATIC (16);