diff options
Diffstat (limited to 'Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var-avar-table.hh')
-rw-r--r-- | Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var-avar-table.hh | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var-avar-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var-avar-table.hh index e305a67c261..ad063d32de8 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var-avar-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-var-avar-table.hh @@ -29,6 +29,14 @@ #include "hb-open-type-private.hh" +/* + * avar -- Axis Variations + * https://docs.microsoft.com/en-us/typography/opentype/spec/avar + */ + +#define HB_OT_TAG_avar HB_TAG('a','v','a','r') + + namespace OT { @@ -62,38 +70,32 @@ struct SegmentMaps : ArrayOf<AxisValueMap> if (!len) return value; else /* len == 1*/ - return value - array[0].fromCoord + array[0].toCoord; + return value - arrayZ[0].fromCoord + arrayZ[0].toCoord; } - if (value <= array[0].fromCoord) - return value - array[0].fromCoord + array[0].toCoord; + if (value <= arrayZ[0].fromCoord) + return value - arrayZ[0].fromCoord + arrayZ[0].toCoord; unsigned int i; unsigned int count = len; - for (i = 1; i < count && value > array[i].fromCoord; i++) + for (i = 1; i < count && value > arrayZ[i].fromCoord; i++) ; - if (value >= array[i].fromCoord) - return value - array[i].fromCoord + array[i].toCoord; + if (value >= arrayZ[i].fromCoord) + return value - arrayZ[i].fromCoord + arrayZ[i].toCoord; - if (unlikely (array[i-1].fromCoord == array[i].fromCoord)) - return array[i-1].toCoord; + if (unlikely (arrayZ[i-1].fromCoord == arrayZ[i].fromCoord)) + return arrayZ[i-1].toCoord; - int denom = array[i].fromCoord - array[i-1].fromCoord; - return array[i-1].toCoord + - ((array[i].toCoord - array[i-1].toCoord) * - (value - array[i-1].fromCoord) + denom/2) / denom; + int denom = arrayZ[i].fromCoord - arrayZ[i-1].fromCoord; + return arrayZ[i-1].toCoord + + ((arrayZ[i].toCoord - arrayZ[i-1].toCoord) * + (value - arrayZ[i-1].fromCoord) + denom/2) / denom; } - DEFINE_SIZE_ARRAY (2, array); + DEFINE_SIZE_ARRAY (2, arrayZ); }; -/* - * avar — Axis Variations Table - */ - -#define HB_OT_TAG_avar HB_TAG('a','v','a','r') - struct avar { static const hb_tag_t tableTag = HB_OT_TAG_avar; @@ -106,7 +108,7 @@ struct avar c->check_struct (this)))) return_trace (false); - const SegmentMaps *map = &axisSegmentMapsZ; + const SegmentMaps *map = axisSegmentMapsZ; unsigned int count = axisCount; for (unsigned int i = 0; i < count; i++) { @@ -122,7 +124,7 @@ struct avar { unsigned int count = MIN<unsigned int> (coords_length, axisCount); - const SegmentMaps *map = &axisSegmentMapsZ; + const SegmentMaps *map = axisSegmentMapsZ; for (unsigned int i = 0; i < count; i++) { coords[i] = map->map (coords[i]); @@ -137,7 +139,7 @@ struct avar HBUINT16 axisCount; /* The number of variation axes in the font. This * must be the same number as axisCount in the * 'fvar' table. */ - SegmentMaps axisSegmentMapsZ; + SegmentMaps axisSegmentMapsZ[VAR]; public: DEFINE_SIZE_MIN (8); |