View Issue Details

IDProjectCategoryView StatusLast Update
0000548luatexluatex bugpublic2011-04-12 11:06
ReporterphiAssigned ToTaco 
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
PlatformOSMac OS XOS Version10.6.5
Product Version0.65.0 
Target VersionFixed in Version0.66.0 
Summary0000548: Possible fencepost error in math parameter counting
DescriptionI conjecture that there is a off-by-one error in the C-to-Lua translation of the math parameter table which prevents the last parameter (FractionDelimiterDisplayStyleSize) from being transferred to the Lua table. The attached patch seems to fix this, but I haven't checked whether it could introduce other errors.
Steps To ReproduceIf you compile the following example with LuaTeX, you see that the FractionDelimiterDisplayStyleSize parameter is correctly transferred to C/TeX, but is invisible to Lua:

\input luaotfload.sty
\font\cambria={name:XITS Math:script=MATH}\relax
\textfont0=\cambria
\immediate\write16{\number\Umathfractiondelsize\textstyle\space\number\Umathfractiondelsize\displaystyle}
\directlua{%
  local i = font.id("cambria")
  local f = font.getfont(i)
  local m = f.MathConstants
  print(m.FractionDelimiterSize, m.FractionDelimiterDisplayStyleSize)
}
\bye

Result with current TLcontrib binary:

This is LuaTeX, Version beta-0.65.0-2010121316
661913 1566310
661913 nil

Result with patch applied:

This is LuaTeX, Version beta-0.65.0-2010123100 (rev 4047)
661913 1566310
661913 1566310
TagsNo tags attached.

Activities

phi

2010-12-31 01:05

reporter  

param-count.patch (541 bytes)
Index: source/texk/web2c/luatexdir/font/luafont.w
===================================================================
--- source/texk/web2c/luatexdir/font/luafont.w	(revision 4047)
+++ source/texk/web2c/luatexdir/font/luafont.w	(working copy)
@@ -368,7 +368,7 @@
 {
     int k;
     lua_newtable(L);
-    for (k = 1; k < font_math_params(f); k++) {
+    for (k = 1; k <= font_math_params(f); k++) {
         lua_pushnumber(L, font_math_param(f, k));
         if (k <= MATH_param_max) {
             lua_setfield(L, -2, MATH_param_names[k]);
param-count.patch (541 bytes)

phi

2010-12-31 01:33

reporter   ~0000714

BTW, this parameter is erroneously called FractionDelimiterDisplaySize (without "Style") in the manual

Taco

2011-02-10 10:34

administrator   ~0000746

patch + manual correction applied in revision 4086

Taco

2011-04-12 11:06

administrator   ~0000811

all fixed in 0.66.0

Issue History

Date Modified Username Field Change
2010-12-31 01:05 phi New Issue
2010-12-31 01:05 phi File Added: param-count.patch
2010-12-31 01:33 phi Note Added: 0000714
2011-02-10 10:31 Taco Status new => assigned
2011-02-10 10:31 Taco Assigned To => Taco
2011-02-10 10:34 Taco Note Added: 0000746
2011-02-10 10:34 Taco Status assigned => resolved
2011-02-10 10:34 Taco Resolution open => fixed
2011-04-12 11:02 Taco Fixed in Version => 0.66.0
2011-04-12 11:06 Taco Note Added: 0000811
2011-04-12 11:06 Taco Status resolved => closed