Rename Fixed to HBFixed
Fixes(!!) https://github.com/harfbuzz/harfbuzz/issues/1966
This commit is contained in:
parent
170b5dd856
commit
229ef1d29d
|
@ -65,7 +65,7 @@ struct FontDescriptor
|
||||||
protected:
|
protected:
|
||||||
Tag tag; /* The 4-byte table tag name. */
|
Tag tag; /* The 4-byte table tag name. */
|
||||||
union {
|
union {
|
||||||
Fixed value; /* The value for the descriptor tag. */
|
HBFixed value; /* The value for the descriptor tag. */
|
||||||
HBUINT32 nalfType; /* If the tag is `nalf`, see non_alphabetic_value_t */
|
HBUINT32 nalfType; /* If the tag is `nalf`, see non_alphabetic_value_t */
|
||||||
} u;
|
} u;
|
||||||
public:
|
public:
|
||||||
|
@ -108,7 +108,7 @@ struct fdsc
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Fixed version; /* Version number of the font descriptors
|
HBFixed version; /* Version number of the font descriptors
|
||||||
* table (0x00010000 for the current version). */
|
* table (0x00010000 for the current version). */
|
||||||
LArrayOf<FontDescriptor>
|
LArrayOf<FontDescriptor>
|
||||||
descriptors; /* List of tagged-coordinate pairs style descriptors
|
descriptors; /* List of tagged-coordinate pairs style descriptors
|
||||||
|
|
|
@ -70,9 +70,9 @@ struct DecompositionAction
|
||||||
|
|
||||||
ActionSubrecordHeader
|
ActionSubrecordHeader
|
||||||
header;
|
header;
|
||||||
Fixed 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. */
|
* then the ligature is decomposed. */
|
||||||
Fixed 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. */
|
* 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;
|
||||||
Fixed 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
|
* this glyph is replaced and the growth factor
|
||||||
* recalculated. */
|
* recalculated. */
|
||||||
GlyphID addGlyph; /* Glyph to be added as kashida. If this value is
|
GlyphID 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. */
|
||||||
Fixed 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
|
* still yields an acceptable appearance. Normally
|
||||||
* this will be 1.0. */
|
* this will be 1.0. */
|
||||||
Fixed 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
|
* no change in appearance. Normally, this will
|
||||||
* be 1.0. */
|
* be 1.0. */
|
||||||
Fixed maximumLimit; /* The highest value for the ductility axis that
|
HBFixed 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:
|
||||||
Fixed beforeGrowLimit;/* The ratio by which the advance width of the
|
HBFixed 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. */
|
||||||
Fixed beforeShrinkLimit;
|
HBFixed 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. */
|
||||||
Fixed afterGrowLimit; /* The ratio by which the advance width of the glyph
|
HBFixed 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. */
|
||||||
Fixed afterShrinkLimit;
|
HBFixed 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. */
|
||||||
|
|
|
@ -62,7 +62,7 @@ struct TrackTableEntry
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Fixed track; /* Track value for this record. */
|
HBFixed 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 Fixed> size_table ((base+sizeTable).arrayZ, sizes);
|
hb_array_t<const HBFixed> 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 Fixed> size_table ((base+sizeTable).arrayZ, sizes);
|
hb_array_t<const HBFixed> 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. */
|
||||||
LOffsetTo<UnsizedArrayOf<Fixed>, false>
|
LOffsetTo<UnsizedArrayOf<HBFixed>, false>
|
||||||
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>
|
||||||
|
|
|
@ -124,9 +124,9 @@ struct F2DOT14 : HBINT16
|
||||||
};
|
};
|
||||||
|
|
||||||
/* 32-bit signed fixed-point number (16.16). */
|
/* 32-bit signed fixed-point number (16.16). */
|
||||||
struct Fixed : HBINT32
|
struct HBFixed : HBINT32
|
||||||
{
|
{
|
||||||
Fixed& operator = (uint32_t i) { HBINT32::operator= (i); return *this; }
|
HBFixed& 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); }
|
||||||
|
|
|
@ -262,7 +262,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 */
|
||||||
Fixed italicAngle; /* Italic angle in counter-clockwise degrees
|
HBFixed 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). */
|
||||||
|
|
|
@ -77,7 +77,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. */
|
||||||
Fixed value; /* A numeric value for this attribute value. */
|
HBFixed value; /* A numeric value for this attribute value. */
|
||||||
public:
|
public:
|
||||||
DEFINE_SIZE_STATIC (12);
|
DEFINE_SIZE_STATIC (12);
|
||||||
};
|
};
|
||||||
|
@ -102,10 +102,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. */
|
||||||
Fixed nominalValue; /* A numeric value for this attribute value. */
|
HBFixed nominalValue; /* A numeric value for this attribute value. */
|
||||||
Fixed rangeMinValue; /* The minimum value for a range associated
|
HBFixed rangeMinValue; /* The minimum value for a range associated
|
||||||
* with the specified name ID. */
|
* with the specified name ID. */
|
||||||
Fixed rangeMaxValue; /* The maximum value for a range associated
|
HBFixed 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);
|
||||||
|
@ -131,8 +131,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. */
|
||||||
Fixed value; /* A numeric value for this attribute value. */
|
HBFixed value; /* A numeric value for this attribute value. */
|
||||||
Fixed linkedValue; /* The numeric value for a style-linked mapping
|
HBFixed 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);
|
||||||
|
@ -150,7 +150,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. */
|
||||||
Fixed value; /* A numeric value for this attribute value. */
|
HBFixed value; /* A numeric value for this attribute value. */
|
||||||
public:
|
public:
|
||||||
DEFINE_SIZE_STATIC (6);
|
DEFINE_SIZE_STATIC (6);
|
||||||
};
|
};
|
||||||
|
|
|
@ -44,7 +44,7 @@ struct InstanceRecord
|
||||||
{
|
{
|
||||||
friend struct fvar;
|
friend struct fvar;
|
||||||
|
|
||||||
hb_array_t<const Fixed> get_coordinates (unsigned int axis_count) const
|
hb_array_t<const HBFixed> get_coordinates (unsigned int axis_count) const
|
||||||
{ return coordinatesZ.as_array (axis_count); }
|
{ return coordinatesZ.as_array (axis_count); }
|
||||||
|
|
||||||
bool sanitize (hb_sanitize_context_t *c, unsigned int axis_count) const
|
bool sanitize (hb_sanitize_context_t *c, unsigned int axis_count) const
|
||||||
|
@ -58,7 +58,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<Fixed>
|
UnsizedArrayOf<HBFixed>
|
||||||
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
|
||||||
|
@ -83,9 +83,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. */
|
||||||
Fixed minValue; /* The minimum coordinate value for the axis. */
|
HBFixed minValue; /* The minimum coordinate value for the axis. */
|
||||||
Fixed defaultValue; /* The default coordinate value for the axis. */
|
HBFixed defaultValue; /* The default coordinate value for the axis. */
|
||||||
Fixed maxValue; /* The maximum coordinate value for the axis. */
|
HBFixed maxValue; /* The maximum coordinate value for the axis. */
|
||||||
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
|
||||||
* provide a display name for this axis. */
|
* provide a display name for this axis. */
|
||||||
|
@ -286,7 +286,7 @@ struct fvar
|
||||||
|
|
||||||
if (coords_length && *coords_length)
|
if (coords_length && *coords_length)
|
||||||
{
|
{
|
||||||
hb_array_t<const Fixed> instanceCoords = instance->get_coordinates (axisCount)
|
hb_array_t<const HBFixed> 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 ();
|
||||||
|
@ -340,8 +340,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(Fixed) + 4, or to
|
* to either axisCount * sizeof(HBFixed) + 4, or to
|
||||||
* axisCount * sizeof(Fixed) + 6. */
|
* axisCount * sizeof(HBFixed) + 6. */
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DEFINE_SIZE_STATIC (16);
|
DEFINE_SIZE_STATIC (16);
|
||||||
|
|
Loading…
Reference in New Issue