s/HBFixed/F16DOT16/g

This commit is contained in:
Behdad Esfahbod 2022-10-13 12:04:32 -06:00
parent 294b1c9f6e
commit 8c29dcaee4
7 changed files with 41 additions and 41 deletions

View File

@ -70,9 +70,9 @@ struct DecompositionAction
ActionSubrecordHeader ActionSubrecordHeader
header; 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. */ * 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. */ * 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
@ -118,7 +118,7 @@ struct ConditionalAddGlyphAction
protected: protected:
ActionSubrecordHeader ActionSubrecordHeader
header; 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 * this glyph is replaced and the growth factor
* recalculated. */ * recalculated. */
HBGlyphID16 addGlyph; /* Glyph to be added as kashida. If this value is 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. 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 that F16DOT16 minimumLimit; /* The lowest value for the ductility axis that
* 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 F16DOT16 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 F16DOT16 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);
@ -271,14 +271,14 @@ struct JustWidthDeltaEntry
}; };
protected: 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. */ * glyph is permitted to grow on the left or top side. */
HBFixed beforeShrinkLimit; F16DOT16 beforeShrinkLimit;
/* The ratio by which the advance width of the /* The ratio by which the advance width of the
* glyph is permitted to shrink on the left or top side. */ * 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. */ * is permitted to shrink on the left or top side. */
HBFixed afterShrinkLimit; F16DOT16 afterShrinkLimit;
/* The ratio by which the advance width of the glyph /* The ratio by which the advance width of the glyph
* is at most permitted to shrink on the right or * is at most permitted to shrink on the right or
* bottom side. */ * bottom side. */

View File

@ -62,7 +62,7 @@ struct TrackTableEntry
} }
protected: protected:
HBFixed track; /* Track value for this record. */ F16DOT16 track; /* Track value for this record. */
NameID trackNameID; /* The 'name' table index for this track. NameID trackNameID; /* The 'name' table index for this track.
* (a short word or phrase like "loose" * (a short word or phrase like "loose"
* or "very tight") */ * or "very tight") */
@ -82,7 +82,7 @@ struct TrackData
const void *base) const const void *base) const
{ {
unsigned int sizes = nSizes; unsigned int sizes = nSizes;
hb_array_t<const HBFixed> size_table ((base+sizeTable).arrayZ, sizes); hb_array_t<const F16DOT16> size_table ((base+sizeTable).arrayZ, sizes);
float s0 = size_table[idx].to_float (); float s0 = size_table[idx].to_float ();
float s1 = size_table[idx + 1].to_float (); float s1 = size_table[idx + 1].to_float ();
@ -120,7 +120,7 @@ struct TrackData
if (!sizes) return 0.; if (!sizes) return 0.;
if (sizes == 1) return trackTableEntry->get_value (base, 0, sizes); if (sizes == 1) return trackTableEntry->get_value (base, 0, sizes);
hb_array_t<const HBFixed> size_table ((base+sizeTable).arrayZ, sizes); hb_array_t<const F16DOT16> size_table ((base+sizeTable).arrayZ, sizes);
unsigned int size_index; unsigned int size_index;
for (size_index = 0; size_index < sizes - 1; size_index++) for (size_index = 0; size_index < sizes - 1; size_index++)
if (size_table[size_index].to_float () >= ptem) if (size_table[size_index].to_float () >= ptem)
@ -141,7 +141,7 @@ struct TrackData
protected: protected:
HBUINT16 nTracks; /* Number of separate tracks included in this table. */ HBUINT16 nTracks; /* Number of separate tracks included in this table. */
HBUINT16 nSizes; /* Number of point sizes included in this table. */ HBUINT16 nSizes; /* Number of point sizes included in this table. */
NNOffset32To<UnsizedArrayOf<HBFixed>> NNOffset32To<UnsizedArrayOf<F16DOT16>>
sizeTable; /* Offset from start of the tracking table to sizeTable; /* Offset from start of the tracking table to
* Array[nSizes] of size values.. */ * Array[nSizes] of size values.. */
UnsizedArrayOf<TrackTableEntry> UnsizedArrayOf<TrackTableEntry>

View File

@ -153,9 +153,9 @@ struct F2DOT14 : HBINT16
}; };
/* 32-bit signed fixed-point number (16.16). */ /* 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 // 65536 means 1<<16
float to_float () const { return ((int32_t) v) / 65536.f; } float to_float () const { return ((int32_t) v) / 65536.f; }
void set_float (float f) { v = roundf (f * 65536.f); } void set_float (float f) { v = roundf (f * 65536.f); }

View File

@ -358,14 +358,14 @@ struct Affine2x3
return_trace (c->check_struct (this)); return_trace (c->check_struct (this));
} }
HBFixed xx; F16DOT16 xx;
HBFixed yx; F16DOT16 yx;
HBFixed xy; F16DOT16 xy;
HBFixed yy; F16DOT16 yy;
HBFixed dx; F16DOT16 dx;
HBFixed dy; F16DOT16 dy;
public: public:
DEFINE_SIZE_STATIC (6 * HBFixed::static_size); DEFINE_SIZE_STATIC (6 * F16DOT16::static_size);
}; };
struct PaintColrLayers struct PaintColrLayers

View File

@ -282,7 +282,7 @@ struct post
* 0x00020000 for version 2.0 * 0x00020000 for version 2.0
* 0x00025000 for version 2.5 (deprecated) * 0x00025000 for version 2.5 (deprecated)
* 0x00030000 for version 3.0 */ * 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, * from the vertical. Zero for upright text,
* negative for text that leans to the right * negative for text that leans to the right
* (forward). */ * (forward). */

View File

@ -136,7 +136,7 @@ struct AxisValueFormat1
NameID valueNameID; /* The name ID for entries in the 'name' table NameID valueNameID; /* The name ID for entries in the 'name' table
* that provide a display string for this * that provide a display string for this
* attribute value. */ * attribute value. */
HBFixed value; /* A numeric value for this attribute value. */ F16DOT16 value; /* A numeric value for this attribute value. */
public: public:
DEFINE_SIZE_STATIC (12); DEFINE_SIZE_STATIC (12);
}; };
@ -195,10 +195,10 @@ struct AxisValueFormat2
NameID valueNameID; /* The name ID for entries in the 'name' table NameID valueNameID; /* The name ID for entries in the 'name' table
* that provide a display string for this * that provide a display string for this
* attribute value. */ * attribute value. */
HBFixed nominalValue; /* A numeric value for this attribute value. */ F16DOT16 nominalValue; /* A numeric value for this attribute value. */
HBFixed rangeMinValue; /* The minimum value for a range associated F16DOT16 rangeMinValue; /* The minimum value for a range associated
* with the specified name ID. */ * 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. */ * with the specified name ID. */
public: public:
DEFINE_SIZE_STATIC (20); DEFINE_SIZE_STATIC (20);
@ -258,8 +258,8 @@ struct AxisValueFormat3
NameID valueNameID; /* The name ID for entries in the 'name' table NameID valueNameID; /* The name ID for entries in the 'name' table
* that provide a display string for this * that provide a display string for this
* attribute value. */ * attribute value. */
HBFixed value; /* A numeric value for this attribute value. */ F16DOT16 value; /* A numeric value for this attribute value. */
HBFixed linkedValue; /* The numeric value for a style-linked mapping F16DOT16 linkedValue; /* The numeric value for a style-linked mapping
* from this value. */ * from this value. */
public: public:
DEFINE_SIZE_STATIC (16); DEFINE_SIZE_STATIC (16);
@ -280,7 +280,7 @@ struct AxisValueRecord
HBUINT16 axisIndex; /* Zero-base index into the axis record array HBUINT16 axisIndex; /* Zero-base index into the axis record array
* identifying the axis to which this value * identifying the axis to which this value
* applies. Must be less than designAxisCount. */ * 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: public:
DEFINE_SIZE_STATIC (6); DEFINE_SIZE_STATIC (6);
}; };

View File

@ -44,7 +44,7 @@ struct InstanceRecord
{ {
friend struct fvar; friend struct fvar;
hb_array_t<const HBFixed> get_coordinates (unsigned int axis_count) const hb_array_t<const F16DOT16> get_coordinates (unsigned int axis_count) const
{ return coordinatesZ.as_array (axis_count); } { return coordinatesZ.as_array (axis_count); }
bool subset (hb_subset_context_t *c, 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 (subfamilyNameID))) return_trace (false);
if (unlikely (!c->serializer->embed (flags))) return_trace (false); if (unlikely (!c->serializer->embed (flags))) return_trace (false);
const hb_array_t<const HBFixed> coords = get_coordinates (axis_count); const hb_array_t<const F16DOT16> coords = get_coordinates (axis_count);
const hb_hashmap_t<hb_tag_t, float> *axes_location = c->plan->user_axes_location; const hb_hashmap_t<hb_tag_t, float> *axes_location = c->plan->user_axes_location;
for (unsigned i = 0 ; i < axis_count; i++) 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 NameID subfamilyNameID;/* The name ID for entries in the 'name' table
* that provide subfamily names for this instance. */ * that provide subfamily names for this instance. */
HBUINT16 flags; /* Reserved for future use — set to 0. */ HBUINT16 flags; /* Reserved for future use — set to 0. */
UnsizedArrayOf<HBFixed> UnsizedArrayOf<F16DOT16>
coordinatesZ; /* The coordinates array for this instance. */ coordinatesZ; /* The coordinates array for this instance. */
//NameID postScriptNameIDX;/*Optional. The name ID for entries in the 'name' //NameID postScriptNameIDX;/*Optional. The name ID for entries in the 'name'
// * table that provide PostScript names for this // * table that provide PostScript names for this
@ -189,9 +189,9 @@ struct AxisRecord
public: public:
Tag axisTag; /* Tag identifying the design variation for the axis. */ Tag axisTag; /* Tag identifying the design variation for the axis. */
protected: protected:
HBFixed minValue; /* The minimum coordinate value for the axis. */ F16DOT16 minValue; /* The minimum coordinate value for the axis. */
HBFixed defaultValue; /* The default coordinate value for the axis. */ F16DOT16 defaultValue; /* The default coordinate value for the axis. */
HBFixed maxValue; /* The maximum coordinate value for the axis. */ F16DOT16 maxValue; /* The maximum coordinate value for the axis. */
public: public:
HBUINT16 flags; /* Axis flags. */ HBUINT16 flags; /* Axis flags. */
NameID axisNameID; /* The name ID for entries in the 'name' table that NameID axisNameID; /* The name ID for entries in the 'name' table that
@ -306,7 +306,7 @@ struct fvar
if (coords_length && *coords_length) if (coords_length && *coords_length)
{ {
hb_array_t<const HBFixed> instanceCoords = instance->get_coordinates (axisCount) hb_array_t<const F16DOT16> instanceCoords = instance->get_coordinates (axisCount)
.sub_array (0, coords_length); .sub_array (0, coords_length);
for (unsigned int i = 0; i < instanceCoords.length; i++) for (unsigned int i = 0; i < instanceCoords.length; i++)
coords[i] = instanceCoords.arrayZ[i].to_float (); 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)) if (hb_any (+ hb_zip (instance->get_coordinates (axisCount), hb_range ((unsigned)axisCount))
| hb_filter (pinned_axes, hb_second) | hb_filter (pinned_axes, hb_second)
| hb_map ([&] (const hb_pair_t<const HBFixed&, unsigned>& _) | hb_map ([&] (const hb_pair_t<const F16DOT16&, unsigned>& _)
{ {
hb_tag_t axis_tag = pinned_axes.get (_.second); hb_tag_t axis_tag = pinned_axes.get (_.second);
float location = user_axes_location->get (axis_tag); 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 HBUINT16 instanceCount; /* The number of named instances defined in the font
* (the number of records in the instances array). */ * (the number of records in the instances array). */
HBUINT16 instanceSize; /* The size in bytes of each InstanceRecord — set HBUINT16 instanceSize; /* The size in bytes of each InstanceRecord — set
* to either axisCount * sizeof(HBFixed) + 4, or to * to either axisCount * sizeof(F16DOT16) + 4, or to
* axisCount * sizeof(HBFixed) + 6. */ * axisCount * sizeof(F16DOT16) + 6. */
public: public:
DEFINE_SIZE_STATIC (16); DEFINE_SIZE_STATIC (16);