texlive[42142] Build/source/texk/web2c/xetexdir: xetexdir: sync with

commits+kakuto at tug.org commits+kakuto at tug.org
Sun Sep 25 07:06:05 CEST 2016


Revision: 42142
          http://tug.org/svn/texlive?view=revision&revision=42142
Author:   kakuto
Date:     2016-09-25 07:06:05 +0200 (Sun, 25 Sep 2016)
Log Message:
-----------
xetexdir: sync with the upstream

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/xetexdir/ChangeLog
    trunk/Build/source/texk/web2c/xetexdir/MathTable.h
    trunk/Build/source/texk/web2c/xetexdir/XeTeXOTMath.cpp

Modified: trunk/Build/source/texk/web2c/xetexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/xetexdir/ChangeLog	2016-09-25 01:16:20 UTC (rev 42141)
+++ trunk/Build/source/texk/web2c/xetexdir/ChangeLog	2016-09-25 05:06:05 UTC (rev 42142)
@@ -1,3 +1,11 @@
+2016-09-25  Akira Kakuto  <kakuto at fuk.kinidai.ac.jp>
+
+	* MathTable.h, XeTeXOTMath.cpp: Sync with the upstream..
+
+2016-09-24  Akira Kakuto  <kakuto at fuk.kinidai.ac.jp>
+
+	* xetex.web: Sync with the upstream..
+
 2016-02-09  Akira Kakuto  <kakuto at fuk.kinidai.ac.jp>
 
 	* XeTeX_ext.c: Revert the change on 2015-11-06.

Modified: trunk/Build/source/texk/web2c/xetexdir/MathTable.h
===================================================================
--- trunk/Build/source/texk/web2c/xetexdir/MathTable.h	2016-09-25 01:16:20 UTC (rev 42141)
+++ trunk/Build/source/texk/web2c/xetexdir/MathTable.h	2016-09-25 05:06:05 UTC (rev 42142)
@@ -251,7 +251,12 @@
 typedef struct {
 	uint16_t		heightCount;
 	MathValueRecord	height[ANY_NUMBER];
+/*
+ * The offset of this will vary depending on the size of the height[] array,
+ * so we have to compute it at runtime, not refer to a fixed field offset.
+ *
 	MathValueRecord	kern[ANY_NUMBER];
+ */
 } MathKernTable;
 
 typedef struct {

Modified: trunk/Build/source/texk/web2c/xetexdir/XeTeXOTMath.cpp
===================================================================
--- trunk/Build/source/texk/web2c/xetexdir/XeTeXOTMath.cpp	2016-09-25 01:16:20 UTC (rev 42141)
+++ trunk/Build/source/texk/web2c/xetexdir/XeTeXOTMath.cpp	2016-09-25 05:06:05 UTC (rev 42142)
@@ -435,24 +435,20 @@
 
             uint16_t count = SWAP(kernTable->heightCount);
 
-            // XXX: the following makes no sense WRT my understanding of the
-            // spec! it is just how things worked for me.
-            if (count == 0)
-                rval = SWAP(kernTable->kern[-1].value);
-            else if (height < SWAP(kernTable->height[0].value))
-                rval = SWAP(kernTable->kern[1].value);
-            else if (height > SWAP(kernTable->height[count].value))
-                rval = SWAP(kernTable->kern[count+1].value);
+            // kern[] array immediately follows the height[] array with |count| elements
+            const MathValueRecord* kern = &kernTable->height[0] + count;
+
+            if (count == 0 || height < SWAP(kernTable->height[0].value))
+                rval = SWAP(kern[0].value);
             else {
+                rval = SWAP(kern[count].value);
                 for (int i = 0; i < count; i++) {
-                    if (height > SWAP(kernTable->height[i].value)) {
-                        rval = SWAP(kernTable->kern[i+1].value);
+                    if (height <= SWAP(kernTable->height[i].value)) {
+                        rval = SWAP(kern[i].value);
                         break;
                     }
                 }
             }
-
-            //fprintf(stderr, "   kern: %f %f\n", font->unitsToPoints(height), font->unitsToPoints(rval));
         }
     }
 
@@ -499,11 +495,9 @@
         int kern = 0, skern = 0;
         float corr_height_top = 0.0, corr_height_bot = 0.0;
 
-        shift = Fix2D(shift);
-
         if (cmd == sup_cmd) { // superscript
             corr_height_top =  font->pointsToUnits(glyph_height(f, g));
-            corr_height_bot = -font->pointsToUnits(glyph_depth(sf, sg) + shift);
+            corr_height_bot = -font->pointsToUnits(glyph_depth(sf, sg) + Fix2D(shift));
 
             kern = getMathKernAt(f, g, topRight, corr_height_top);
             skern = getMathKernAt(sf, sg, bottomLeft, corr_height_top);
@@ -515,7 +509,7 @@
                 rval = kern + skern;
 
         } else if (cmd == sub_cmd) { // subscript
-            corr_height_top =  font->pointsToUnits(glyph_height(sf, sg) - shift);
+            corr_height_top =  font->pointsToUnits(glyph_height(sf, sg) - Fix2D(shift));
             corr_height_bot = -font->pointsToUnits(glyph_depth(f, g));
 
             kern = getMathKernAt(f, g, bottomRight, corr_height_top);
@@ -531,10 +525,10 @@
             assert(0); // we should not reach here
         }
 
-        rval = D2Fix(font->unitsToPoints(rval));
+        return D2Fix(font->unitsToPoints(rval));
     }
 
-    return rval;
+    return 0;
 }
 
 int



More information about the tex-live-commits mailing list