src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-var-avar-table.hh
changeset 50826 f5b95be8b6e2
parent 50352 25db2c8f3cf8
child 54232 7c11a7cc7c1d
--- a/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-var-avar-table.hh	Thu Jun 21 09:53:50 2018 -0700
+++ b/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-var-avar-table.hh	Thu Jun 21 12:54:30 2018 -0700
@@ -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 @@
       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 @@
                     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 @@
   {
     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 @@
   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);