diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2016-08-13 08:14:27 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2016-08-13 08:14:27 +0000 |
commit | 9a47106d115b425b8ca87c84948a85b10ca4789c (patch) | |
tree | 365e6ba764c7464af6eca8f718db4eb883136f64 /Build/source/texk/web2c/luatexdir | |
parent | cafe7e3f4c0ada7f125b1e2bc04bf67d838ea8b0 (diff) |
luatexdir: sync with the upstream
git-svn-id: svn://tug.org/texlive/trunk@41846 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/luatexdir')
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/luafont.w | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/lua/lfontlib.c | 4 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/lua/limglib.c | 8 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/lua/lnodelib.c | 308 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/lua/lpdflib.c | 12 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/lua/ltexlib.c | 46 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/lua/luanode.w | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/lua/luatex-api.h | 9 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/luatex.c | 6 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/tex/texnodes.w | 8 |
11 files changed, 248 insertions, 159 deletions
diff --git a/Build/source/texk/web2c/luatexdir/font/luafont.w b/Build/source/texk/web2c/luatexdir/font/luafont.w index f3a8e52792c..0b30b4df41a 100644 --- a/Build/source/texk/web2c/luatexdir/font/luafont.w +++ b/Build/source/texk/web2c/luatexdir/font/luafont.w @@ -964,7 +964,7 @@ static void read_lua_math_parameters(lua_State * L, int f) } else if (t == LUA_TSTRING) { i = ff_checkoption(L, -2, NULL, MATH_param_names); } - n = (int) lua_tointeger(L, -1); + n = (int) lua_roundnumber(L, -1); if (i > 0) { set_font_math_param(f, i, n); } diff --git a/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c b/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c index 5ceb7998d1d..6bdaca016fd 100644 --- a/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c +++ b/Build/source/texk/web2c/luatexdir/lua/lcallbacklib.c @@ -129,7 +129,7 @@ void get_lua_number(const char *table, const char *name, int *target) if (lua_istable(Luas, -1)) { lua_getfield(Luas, -1, name); if (lua_type(Luas, -1) == LUA_TNUMBER) { - *target = (int) lua_tointeger(Luas, -1); + *target = (int) lua_roundnumber(Luas, -1); /* was lua_tointeger */ } } lua_settop(Luas, stacktop); diff --git a/Build/source/texk/web2c/luatexdir/lua/lfontlib.c b/Build/source/texk/web2c/luatexdir/lua/lfontlib.c index 2e05f5f3327..7e35d2360b7 100644 --- a/Build/source/texk/web2c/luatexdir/lua/lfontlib.c +++ b/Build/source/texk/web2c/luatexdir/lua/lfontlib.c @@ -40,7 +40,7 @@ static int font_read_tfm(lua_State * L) if (lua_type(L, 1) == LUA_TSTRING) { const char *cnom = lua_tostring(L, 1); if (lua_type(L, 2) == LUA_TNUMBER) { - scaled s = (int) lua_tointeger(L, 2); + scaled s = (int) lua_roundnumber(L, 2); if (strlen(cnom)) { internal_font_number f = get_fontid(); if (read_tfm_info(f, cnom, s)) { @@ -70,7 +70,7 @@ static int font_read_vf(lua_State * L) const char *cnom = lua_tostring(L, 1); if (strlen(cnom)) { if (lua_type(L, 2) == LUA_TNUMBER) { - int i = lua_tointeger(L, 2); + int i = lua_roundnumber(L, 2); return make_vf_table(L, cnom, (scaled) i); } else { luaL_error(L, "expected an integer size as second argument"); diff --git a/Build/source/texk/web2c/luatexdir/lua/limglib.c b/Build/source/texk/web2c/luatexdir/lua/limglib.c index eb9e4145a37..5723174b905 100644 --- a/Build/source/texk/web2c/luatexdir/lua/limglib.c +++ b/Build/source/texk/web2c/luatexdir/lua/limglib.c @@ -482,7 +482,7 @@ static void lua_to_image(lua_State * L, image * a, image_dict * d) if (t == LUA_TNIL) { set_wd_running(a); } else if (t == LUA_TNUMBER) { - img_width(a) = (int) lua_tointeger(L, -1); + img_width(a) = (int) lua_roundnumber(L, -1); } else if (t == LUA_TSTRING) { img_width(a) = dimen_to_number(L, lua_tostring(L, -1)); } else { @@ -492,7 +492,7 @@ static void lua_to_image(lua_State * L, image * a, image_dict * d) if (t == LUA_TNIL) { set_ht_running(a); } else if (t == LUA_TNUMBER) { - img_height(a) = (int) lua_tointeger(L, -1); + img_height(a) = (int) lua_roundnumber(L, -1); } else if (t == LUA_TSTRING) { img_height(a) = dimen_to_number(L, lua_tostring(L, -1)); } else { @@ -502,7 +502,7 @@ static void lua_to_image(lua_State * L, image * a, image_dict * d) if (t == LUA_TNIL) { set_dp_running(a); } else if (t == LUA_TNUMBER) { - img_depth(a) = (int) lua_tointeger(L, -1); + img_depth(a) = (int) lua_roundnumber(L, -1); } else if (t == LUA_TSTRING) { img_depth(a) = dimen_to_number(L, lua_tostring(L, -1)); } else { @@ -618,7 +618,7 @@ static void lua_to_image(lua_State * L, image * a, image_dict * d) lua_gettable(L, -2); /* int v k t ... */ t = lua_type(L, -1); if (t == LUA_TNUMBER) { - img_bbox(d)[i - 1] = (int) lua_tointeger(L, -1); + img_bbox(d)[i - 1] = (int) lua_roundnumber(L, -1); } else if (t == LUA_TSTRING) { img_bbox(d)[i - 1] = dimen_to_number(L, lua_tostring(L, -1)); } else { diff --git a/Build/source/texk/web2c/luatexdir/lua/lnodelib.c b/Build/source/texk/web2c/luatexdir/lua/lnodelib.c index 91d85256230..1bfa5550949 100644 --- a/Build/source/texk/web2c/luatexdir/lua/lnodelib.c +++ b/Build/source/texk/web2c/luatexdir/lua/lnodelib.c @@ -1477,7 +1477,7 @@ static int lua_nodelib_hpack(lua_State * L) int d = -1; halfword n = *(check_isnode(L, 1)); if (lua_gettop(L) > 1) { - w = (int) lua_tointeger(L, 2); + w = lua_roundnumber(L, 2); if (lua_gettop(L) > 2) { if (lua_type(L, 3) == LUA_TSTRING) { s = lua_tostring(L, 3); @@ -1523,7 +1523,7 @@ static int lua_nodelib_direct_hpack(lua_State * L) halfword n = lua_tointeger(L,1); /* could be macro */ if (lua_gettop(L) > 1) { - w = (int) lua_tointeger(L, 2); + w = lua_roundnumber(L, 2); if (lua_gettop(L) > 2) { if (lua_type(L, 3) == LUA_TSTRING) { s = lua_tostring(L, 3); @@ -1570,7 +1570,7 @@ static int lua_nodelib_vpack(lua_State * L) int d = -1; halfword n = *(check_isnode(L, 1)); if (lua_gettop(L) > 1) { - w = (int) lua_tointeger(L, 2); + w = lua_roundnumber(L, 2); if (lua_gettop(L) > 2) { if (lua_type(L, 3) == LUA_TSTRING) { s = lua_tostring(L, 3); @@ -1615,7 +1615,7 @@ static int lua_nodelib_direct_vpack(lua_State * L) int d = -1; halfword n = (halfword) lua_tointeger(L,1); if (lua_gettop(L) > 1) { - w = (int) lua_tointeger(L, 2); + w = lua_roundnumber(L, 2); if (lua_gettop(L) > 2) { if (lua_type(L, 3) == LUA_TSTRING) { s = lua_tostring(L, 3); @@ -2403,9 +2403,9 @@ static int lua_nodelib_set_glue(lua_State * L) halfword n = *check_isnode(L, 1); int top = lua_gettop(L) ; if ((n != null) && (type(n) == glue_node || type(n) == glue_spec_node)) { - width(n) = ((top > 1 && lua_type(L, 2) == LUA_TNUMBER)) ? lua_tointeger(L,2) : 0; - stretch(n) = ((top > 2 && lua_type(L, 3) == LUA_TNUMBER)) ? lua_tointeger(L,3) : 0; - shrink(n) = ((top > 3 && lua_type(L, 4) == LUA_TNUMBER)) ? lua_tointeger(L,4) : 0; + width(n) = ((top > 1 && lua_type(L, 2) == LUA_TNUMBER)) ? lua_roundnumber(L,2) : 0; + stretch(n) = ((top > 2 && lua_type(L, 3) == LUA_TNUMBER)) ? lua_roundnumber(L,3) : 0; + shrink(n) = ((top > 3 && lua_type(L, 4) == LUA_TNUMBER)) ? lua_roundnumber(L,4) : 0; stretch_order(n) = ((top > 4 && lua_type(L, 5) == LUA_TNUMBER)) ? lua_tointeger(L,5) : 0; shrink_order(n) = ((top > 5 && lua_type(L, 6) == LUA_TNUMBER)) ? lua_tointeger(L,6) : 0; return 0; @@ -2419,9 +2419,9 @@ static int lua_nodelib_direct_set_glue(lua_State * L) halfword n = lua_tointeger(L, 1); int top = lua_gettop(L) ; if ((n != null) && (type(n) == glue_node || type(n) == glue_spec_node)) { - width(n) = ((top > 1 && lua_type(L, 2) == LUA_TNUMBER)) ? lua_tointeger(L,2) : 0; - stretch(n) = ((top > 2 && lua_type(L, 3) == LUA_TNUMBER)) ? lua_tointeger(L,3) : 0; - shrink(n) = ((top > 3 && lua_type(L, 4) == LUA_TNUMBER)) ? lua_tointeger(L,4) : 0; + width(n) = ((top > 1 && lua_type(L, 2) == LUA_TNUMBER)) ? lua_roundnumber(L,2) : 0; + stretch(n) = ((top > 2 && lua_type(L, 3) == LUA_TNUMBER)) ? lua_roundnumber(L,3) : 0; + shrink(n) = ((top > 3 && lua_type(L, 4) == LUA_TNUMBER)) ? lua_roundnumber(L,4) : 0; stretch_order(n) = ((top > 4 && lua_type(L, 5) == LUA_TNUMBER)) ? lua_tointeger(L,5) : 0; shrink_order(n) = ((top > 5 && lua_type(L, 6) == LUA_TNUMBER)) ? lua_tointeger(L,6) : 0; return 0; @@ -3409,6 +3409,10 @@ static int lua_nodelib_fast_getfield(lua_State * L) fast_metatable_or_nil(left_delimiter(n)); } else if (lua_key_eq(s, right)) { fast_metatable_or_nil(right_delimiter(n)); + } else if (lua_key_eq(s, middle)) { + fast_metatable_or_nil(middle_delimiter(n)); + } else if (lua_key_eq(s, options)) { + lua_pushinteger(L, fractionoptions(n)); } else { lua_pushnil(L); } @@ -3435,6 +3439,8 @@ static int lua_nodelib_fast_getfield(lua_State * L) fast_metatable_or_nil(bot_accent_chr(n)); } else if (lua_key_eq(s, overlay_accent)) { fast_metatable_or_nil(overlay_accent_chr(n)); + } else if (lua_key_eq(s, fraction)) { + lua_pushinteger(L, accentfraction(n)); } else { lua_pushnil(L); } @@ -3443,6 +3449,16 @@ static int lua_nodelib_fast_getfield(lua_State * L) lua_pushinteger(L, subtype(n)); } else if (lua_key_eq(s, delim)) { fast_metatable_or_nil(delimiter(n)); + } else if (lua_key_eq(s, italic)) { + lua_pushinteger(L, delimiteritalic(n)); + } else if (lua_key_eq(s, height)) { + lua_pushinteger(L, delimiterheight(n)); + } else if (lua_key_eq(s, depth)) { + lua_pushinteger(L, delimiterdepth(n)); + } else if (lua_key_eq(s, options)) { + lua_pushinteger(L, delimiteroptions(n)); + } else if (lua_key_eq(s, class)) { + lua_pushinteger(L, delimiterclass(n)); } else { lua_pushnil(L); } @@ -3481,6 +3497,10 @@ static int lua_nodelib_fast_getfield(lua_State * L) fast_metatable_or_nil(left_delimiter(n)); } else if (lua_key_eq(s, degree)) { fast_metatable_or_nil(degree(n)); + } else if (lua_key_eq(s, width)) { + lua_pushinteger(L, radicalwidth(n)); + } else if (lua_key_eq(s, options)) { + lua_pushinteger(L, radicaloptions(n)); } else { lua_pushnil(L); } @@ -4114,6 +4134,10 @@ static int lua_nodelib_direct_getfield(lua_State * L) nodelib_pushdirect_or_nil(left_delimiter(n)); } else if (lua_key_eq(s, right)) { nodelib_pushdirect_or_nil(right_delimiter(n)); + } else if (lua_key_eq(s, middle)) { + nodelib_pushdirect_or_nil(middle_delimiter(n)); + } else if (lua_key_eq(s, options)) { + lua_pushinteger(L, fractionoptions(n)); } else { lua_pushnil(L); } @@ -4136,12 +4160,24 @@ static int lua_nodelib_direct_getfield(lua_State * L) nodelib_pushdirect_or_nil(bot_accent_chr(n)); } else if (lua_key_eq(s, overlay_accent)) { nodelib_pushdirect_or_nil(overlay_accent_chr(n)); + } else if (lua_key_eq(s, fraction)) { + lua_pushinteger(L, accentfraction(n)); } else { lua_pushnil(L); } } else if (t == fence_noad) { if (lua_key_eq(s, delim)) { nodelib_pushdirect_or_nil(delimiter(n)); + } else if (lua_key_eq(s, italic)) { + lua_pushinteger(L, delimiteritalic(n)); + } else if (lua_key_eq(s, height)) { + lua_pushinteger(L, delimiterheight(n)); + } else if (lua_key_eq(s, depth)) { + lua_pushinteger(L, delimiterdepth(n)); + } else if (lua_key_eq(s, options)) { + lua_pushinteger(L, delimiteroptions(n)); + } else if (lua_key_eq(s, class)) { + lua_pushinteger(L, delimiterclass(n)); } else { lua_pushnil(L); } @@ -4174,6 +4210,10 @@ static int lua_nodelib_direct_getfield(lua_State * L) nodelib_pushdirect_or_nil(left_delimiter(n)); } else if (lua_key_eq(s, degree)) { nodelib_pushdirect_or_nil(degree(n)); + } else if (lua_key_eq(s, width)) { + lua_pushinteger(L, radicalwidth(n)); + } else if (lua_key_eq(s, options)) { + lua_pushinteger(L, radicaloptions(n)); } else { lua_pushnil(L); } @@ -4937,7 +4977,7 @@ static int lua_nodelib_setfield_whatsit(lua_State * L, int n, const char *s) user_node_value(n) = nodelib_getlist(L, 3); break; case 'd': - user_node_value(n) = (halfword) lua_tointeger(L, 3); + user_node_value(n) = (halfword) lua_roundnumber(L, 3); break; case 'l': lua_pushvalue(L, 3); @@ -4956,7 +4996,7 @@ static int lua_nodelib_setfield_whatsit(lua_State * L, int n, const char *s) user_node_value(n) = nodelib_gettoks(L, 3); break; default: - user_node_value(n) = (halfword) lua_tointeger(L, 3); + user_node_value(n) = (halfword) lua_roundnumber(L, 3); break; } } else { @@ -4964,11 +5004,11 @@ static int lua_nodelib_setfield_whatsit(lua_State * L, int n, const char *s) } } else if (t == pdf_annot_node) { if (lua_key_eq(s, width)) { - width(n) = (halfword) lua_tointeger(L, 3); + width(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, depth)) { - depth(n) = (halfword) lua_tointeger(L, 3); + depth(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, height)) { - height(n) = (halfword) lua_tointeger(L, 3); + height(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, objnum)) { pdf_annot_objnum(n) = (halfword) lua_tointeger(L, 3); } else if (lua_key_eq(s, data)) { @@ -4978,11 +5018,11 @@ static int lua_nodelib_setfield_whatsit(lua_State * L, int n, const char *s) } } else if (t == pdf_dest_node) { if (lua_key_eq(s, width)) { - width(n) = (halfword) lua_tointeger(L, 3); + width(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, depth)) { - depth(n) = (halfword) lua_tointeger(L, 3); + depth(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, height)) { - height(n) = (halfword) lua_tointeger(L, 3); + height(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, named_id)) { pdf_dest_named_id(n) = (quarterword) lua_tointeger(L, 3); } else if (lua_key_eq(s, dest_id)) { @@ -5014,11 +5054,11 @@ static int lua_nodelib_setfield_whatsit(lua_State * L, int n, const char *s) } } else if (t == pdf_start_link_node) { if (lua_key_eq(s, width)) { - width(n) = (halfword) lua_tointeger(L, 3); + width(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, depth)) { - depth(n) = (halfword) lua_tointeger(L, 3); + depth(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, height)) { - height(n) = (halfword) lua_tointeger(L, 3); + height(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, objnum)) { pdf_link_objnum(n) = (halfword) lua_tointeger(L, 3); } else if (lua_key_eq(s, link_attr)) { @@ -5068,11 +5108,11 @@ static int lua_nodelib_setfield_whatsit(lua_State * L, int n, const char *s) } } else if ((t == pdf_thread_node) || (t == pdf_start_thread_node)) { if (lua_key_eq(s, width)) { - width(n) = (halfword) lua_tointeger(L, 3); + width(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, depth)) { - depth(n) = (halfword) lua_tointeger(L, 3); + depth(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, height)) { - height(n) = (halfword) lua_tointeger(L, 3); + height(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, named_id)) { pdf_thread_named_id(n) = (quarterword) lua_tointeger(L, 3); } else if (lua_key_eq(s, thread_id)) { @@ -5169,11 +5209,11 @@ static int lua_nodelib_fast_setfield(lua_State * L) } else if (lua_key_eq(s, char)) { character(n) = (halfword) lua_tointeger(L, 3); } else if (lua_key_eq(s, xoffset)) { - x_displace(n) = (halfword) lua_tointeger(L, 3); + x_displace(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, yoffset)) { - y_displace(n) = (halfword) lua_tointeger(L, 3); + y_displace(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, xadvance)) { - x_advance(n) = (halfword) lua_tointeger(L, 3); + x_advance(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, width)) { /* not yet */ } else if (lua_key_eq(s, height)) { @@ -5181,7 +5221,7 @@ static int lua_nodelib_fast_setfield(lua_State * L) } else if (lua_key_eq(s, depth)) { /* not yet */ } else if (lua_key_eq(s, expansion_factor)) { - ex_glyph(n) = (halfword) lua_tointeger(L, 3); + ex_glyph(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, components)) { lig_ptr(n) = nodelib_getlist(L, 3); } else if (lua_key_eq(s, lang)) { @@ -5201,15 +5241,15 @@ static int lua_nodelib_fast_setfield(lua_State * L) } else if (lua_key_eq(s, list) || lua_key_eq(s, head)) { list_ptr(n) = nodelib_getlist(L, 3); } else if (lua_key_eq(s, width)) { - width(n) = (halfword) lua_tointeger(L, 3); + width(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, height)) { - height(n) = (halfword) lua_tointeger(L, 3); + height(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, depth)) { - depth(n) = (halfword) lua_tointeger(L, 3); + depth(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, dir)) { box_dir(n) = nodelib_getdir(L, 3, 1); } else if (lua_key_eq(s, shift)) { - shift_amount(n) = (halfword) lua_tointeger(L, 3); + shift_amount(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, glue_order)) { glue_order(n) = (quarterword) lua_tointeger(L, 3); } else if (lua_key_eq(s, glue_sign)) { @@ -5237,11 +5277,11 @@ static int lua_nodelib_fast_setfield(lua_State * L) if (lua_key_eq(s, subtype)) { subtype(n) = (quarterword) lua_tointeger(L, 3); } else if (lua_key_eq(s, width)) { - width(n) = (halfword) lua_tointeger(L, 3); + width(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, stretch)) { - stretch(n) = (halfword) lua_tointeger(L, 3); + stretch(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, shrink)) { - shrink(n) = (halfword) lua_tointeger(L, 3); + shrink(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, stretch_order)) { stretch_order(n) = (quarterword) lua_tointeger(L, 3); } else if (lua_key_eq(s, shrink_order)) { @@ -5255,9 +5295,9 @@ static int lua_nodelib_fast_setfield(lua_State * L) if (lua_key_eq(s, subtype)) { subtype(n) = (quarterword) lua_tointeger(L, 3); } else if (lua_key_eq(s, kern)) { - width(n) = (halfword) lua_tointeger(L, 3); + width(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, expansion_factor)) { - ex_kern(n) = (halfword) lua_tointeger(L, 3); + ex_kern(n) = (halfword) lua_roundnumber(L, 3); } else { return nodelib_cantset(L, n, s); } @@ -5273,17 +5313,17 @@ static int lua_nodelib_fast_setfield(lua_State * L) if (lua_key_eq(s, subtype)) { subtype(n) = (quarterword) lua_tointeger(L, 3); } else if (lua_key_eq(s, width)) { - width(n) = (halfword) lua_tointeger(L, 3); + width(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, height)) { - height(n) = (halfword) lua_tointeger(L, 3); + height(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, depth)) { - depth(n) = (halfword) lua_tointeger(L, 3); + depth(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, dir)) { rule_dir(n) = nodelib_getdir(L, 3, 1); } else if (lua_key_eq(s, index)) { rule_index(n) = (halfword) lua_tointeger(L, 3); } else if (lua_key_eq(s, transform)) { - rule_transform(n) = (halfword) lua_tointeger(L, 3); + rule_transform(n) = (halfword) lua_roundnumber(L, 3); /* can also be user value */ } else { return nodelib_cantset(L, n, s); } @@ -5307,11 +5347,11 @@ static int lua_nodelib_fast_setfield(lua_State * L) } else if (lua_key_eq(s, box_left)) { local_box_left(n) = nodelib_getlist(L, 3); } else if (lua_key_eq(s, box_left_width)) { - local_box_left_width(n) = (halfword) lua_tointeger(L, 3); + local_box_left_width(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, box_right)) { local_box_right(n) = nodelib_getlist(L, 3); } else if (lua_key_eq(s, box_right_width)) { - local_box_right_width(n) = (halfword) lua_tointeger(L, 3); + local_box_right_width(n) = (halfword) lua_roundnumber(L, 3); } else { return nodelib_cantset(L, n, s); } @@ -5359,18 +5399,18 @@ static int lua_nodelib_fast_setfield(lua_State * L) } else if (lua_key_eq(s, cost)) { float_cost(n) = (halfword) lua_tointeger(L, 3); } else if (lua_key_eq(s, depth)) { - depth(n) = (halfword) lua_tointeger(L, 3); + depth(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, height)) { - height(n) = (halfword) lua_tointeger(L, 3); + height(n) = (halfword) lua_roundnumber(L, 3); } else if ((lua_key_eq(s, list)) || (lua_key_eq(s, head))) { ins_ptr(n) = nodelib_getlist(L, 3); /* glue */ } else if (lua_key_eq(s, width)) { - width(n) = (halfword) lua_tointeger(L, 3); + width(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, stretch)) { - stretch(n) = (halfword) lua_tointeger(L, 3); + stretch(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, shrink)) { - shrink(n) = (halfword) lua_tointeger(L, 3); + shrink(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, stretch_order)) { stretch_order(n) = (quarterword) lua_tointeger(L, 3); } else if (lua_key_eq(s, shrink_order)) { @@ -5382,14 +5422,14 @@ static int lua_nodelib_fast_setfield(lua_State * L) if (lua_key_eq(s, subtype)) { subtype(n) = (quarterword) lua_tointeger(L, 3); } else if (lua_key_eq(s, surround)) { - surround(n) = (halfword) lua_tointeger(L, 3); + surround(n) = (halfword) lua_roundnumber(L, 3); /* glue */ } else if (lua_key_eq(s, width)) { - width(n) = (halfword) lua_tointeger(L, 3); + width(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, stretch)) { - stretch(n) = (halfword) lua_tointeger(L, 3); + stretch(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, shrink)) { - shrink(n) = (halfword) lua_tointeger(L, 3); + shrink(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, stretch_order)) { stretch_order(n) = (quarterword) lua_tointeger(L, 3); } else if (lua_key_eq(s, shrink_order)) { @@ -5401,7 +5441,7 @@ static int lua_nodelib_fast_setfield(lua_State * L) if (lua_key_eq(s, subtype)) { subtype(n) = (quarterword) lua_tointeger(L, 3); } else if (lua_key_eq(s, width)) { - thickness(n) = (halfword) lua_tointeger(L, 3); + thickness(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, num)) { numerator(n) = nodelib_getlist(L, 3); } else if (lua_key_eq(s, denom)) { @@ -5410,6 +5450,10 @@ static int lua_nodelib_fast_setfield(lua_State * L) left_delimiter(n) = nodelib_getlist(L, 3); } else if (lua_key_eq(s, right)) { right_delimiter(n) = nodelib_getlist(L, 3); + } else if (lua_key_eq(s, middle)) { + middle_delimiter(n) = nodelib_getlist(L, 3); + } else if (lua_key_eq(s, options)) { + fractionoptions(n) = (halfword) lua_tointeger(L, 3); } else { return nodelib_cantset(L, n, s); } @@ -5436,6 +5480,8 @@ static int lua_nodelib_fast_setfield(lua_State * L) bot_accent_chr(n) = nodelib_getlist(L, 3); } else if (lua_key_eq(s, overlay_accent)) { overlay_accent_chr(n) = nodelib_getlist(L, 3); + } else if (lua_key_eq(s, fraction)) { + accentfraction(n) = (halfword) lua_roundnumber(L,3); } else { return nodelib_cantset(L, n, s); } @@ -5444,6 +5490,16 @@ static int lua_nodelib_fast_setfield(lua_State * L) subtype(n) = (quarterword) lua_tointeger(L, 3); } else if (lua_key_eq(s, delim)) { delimiter(n) = nodelib_getlist(L, 3); + } else if (lua_key_eq(s, italic)) { + delimiteritalic(n) = (halfword) lua_roundnumber(L,3); + } else if (lua_key_eq(s, height)) { + delimiterheight(n) = (halfword) lua_roundnumber(L,3); + } else if (lua_key_eq(s, depth)) { + delimiterdepth(n) = (halfword) lua_roundnumber(L,3); + } else if (lua_key_eq(s, options)) { + delimiteroptions(n) = (halfword) lua_tointeger(L,3); + } else if (lua_key_eq(s, class)) { + delimiterclass(n) = (halfword) lua_tointeger(L,3); } else { return nodelib_cantset(L, n, s); } @@ -5482,6 +5538,10 @@ static int lua_nodelib_fast_setfield(lua_State * L) left_delimiter(n) = nodelib_getlist(L, 3); } else if (lua_key_eq(s, degree)) { degree(n) = nodelib_getlist(L, 3); + } else if (lua_key_eq(s, width)) { + radicalwidth(n) = lua_roundnumber(L, 3); + } else if (lua_key_eq(s, options)) { + radicaloptions(n) = (halfword) lua_tointeger(L,3); } else { return nodelib_cantset(L, n, s); } @@ -5489,7 +5549,7 @@ static int lua_nodelib_fast_setfield(lua_State * L) if (lua_key_eq(s, subtype)) { subtype(n) = (quarterword) lua_tointeger(L, 3); } else if (lua_key_eq(s, width)) { - width(n) = (halfword) lua_tointeger(L, 3); + width(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, glyph)) { margin_char(n) = nodelib_getlist(L, 3); } else { @@ -5555,21 +5615,21 @@ static int lua_nodelib_fast_setfield(lua_State * L) if (lua_key_eq(s, subtype)) { /* dummy subtype */ } else if (lua_key_eq(s, width)) { - width(n) = (halfword) lua_tointeger(L, 3); + width(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, height)) { - height(n) = (halfword) lua_tointeger(L, 3); + height(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, depth)) { - depth(n) = (halfword) lua_tointeger(L, 3); + depth(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, dir)) { box_dir(n) = nodelib_getdir(L, 3, 1); } else if (lua_key_eq(s, shrink)) { - glue_shrink(n) = (halfword) lua_tointeger(L, 3); + glue_shrink(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, glue_order)) { glue_order(n) = (quarterword) lua_tointeger(L, 3); } else if (lua_key_eq(s, glue_sign)) { glue_sign(n) = (quarterword) lua_tointeger(L, 3); } else if (lua_key_eq(s, stretch)) { - glue_stretch(n) = (halfword) lua_tointeger(L, 3); + glue_stretch(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, count)) { span_count(n) = (quarterword) lua_tointeger(L, 3); } else if ((lua_key_eq(s, list)) || (lua_key_eq(s, head))){ @@ -5593,11 +5653,11 @@ static int lua_nodelib_fast_setfield(lua_State * L) } } else if (t == glue_spec_node) { if (lua_key_eq(s, width)) { - width(n) = (halfword) lua_tointeger(L, 3); + width(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, stretch)) { - stretch(n) = (halfword) lua_tointeger(L, 3); + stretch(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, shrink)) { - shrink(n) = (halfword) lua_tointeger(L, 3); + shrink(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, stretch_order)) { stretch_order(n) = (quarterword) lua_tointeger(L, 3); } else if (lua_key_eq(s, shrink_order)) { @@ -5680,7 +5740,7 @@ static int lua_nodelib_direct_setfield_whatsit(lua_State * L, int n, const char user_node_value(n) = nodelib_getlist(L, 3); break; case 'd': - user_node_value(n) = (halfword) lua_tointeger(L, 3); + user_node_value(n) = (halfword) lua_roundnumber(L, 3); break; case 'l': lua_pushvalue(L, 3); @@ -5699,7 +5759,7 @@ static int lua_nodelib_direct_setfield_whatsit(lua_State * L, int n, const char user_node_value(n) = nodelib_gettoks(L, 3); break; default: - user_node_value(n) = (halfword) lua_tointeger(L, 3); + user_node_value(n) = (halfword) lua_roundnumber(L, 3); break; } } else { @@ -5707,11 +5767,11 @@ static int lua_nodelib_direct_setfield_whatsit(lua_State * L, int n, const char } } else if (t == pdf_annot_node) { if (lua_key_eq(s, width)) { - width(n) = (halfword) lua_tointeger(L, 3); + width(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, depth)) { - depth(n) = (halfword) lua_tointeger(L, 3); + depth(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, height)) { - height(n) = (halfword) lua_tointeger(L, 3); + height(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, objnum)) { pdf_annot_objnum(n) = (halfword) lua_tointeger(L, 3); } else if (lua_key_eq(s, data)) { @@ -5721,11 +5781,11 @@ static int lua_nodelib_direct_setfield_whatsit(lua_State * L, int n, const char } } else if (t == pdf_dest_node) { if (lua_key_eq(s, width)) { - width(n) = (halfword) lua_tointeger(L, 3); + width(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, depth)) { - depth(n) = (halfword) lua_tointeger(L, 3); + depth(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, height)) { - height(n) = (halfword) lua_tointeger(L, 3); + height(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, named_id)) { pdf_dest_named_id(n) = (quarterword) lua_tointeger(L, 3); } else if (lua_key_eq(s, dest_id)) { @@ -5757,11 +5817,11 @@ static int lua_nodelib_direct_setfield_whatsit(lua_State * L, int n, const char } } else if (t == pdf_start_link_node) { if (lua_key_eq(s, width)) { - width(n) = (halfword) lua_tointeger(L, 3); + width(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, depth)) { - depth(n) = (halfword) lua_tointeger(L, 3); + depth(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, height)) { - height(n) = (halfword) lua_tointeger(L, 3); + height(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, objnum)) { pdf_link_objnum(n) = (halfword) lua_tointeger(L, 3); } else if (lua_key_eq(s, link_attr)) { @@ -5811,11 +5871,11 @@ static int lua_nodelib_direct_setfield_whatsit(lua_State * L, int n, const char } } else if ((t == pdf_thread_node) || (t == pdf_start_thread_node)) { if (lua_key_eq(s, width)) { - width(n) = (halfword) lua_tointeger(L, 3); + width(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, depth)) { - depth(n) = (halfword) lua_tointeger(L, 3); + depth(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, height)) { - height(n) = (halfword) lua_tointeger(L, 3); + height(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, named_id)) { pdf_thread_named_id(n) = (quarterword) lua_tointeger(L, 3); } else if (lua_key_eq(s, thread_id)) { @@ -6057,13 +6117,13 @@ static int lua_nodelib_direct_setfield(lua_State * L) } else if (lua_key_eq(s, char)) { character(n) = (halfword) lua_tointeger(L, 3); } else if (lua_key_eq(s, xoffset)) { - x_displace(n) = (halfword) lua_tointeger(L, 3); + x_displace(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, yoffset)) { - y_displace(n) = (halfword) lua_tointeger(L, 3); + y_displace(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, xadvance)) { - x_advance(n) = (halfword) lua_tointeger(L, 3); + x_advance(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, expansion_factor)) { - ex_glyph(n) = (halfword) lua_tointeger(L, 3); + ex_glyph(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, components)) { lig_ptr(n) = nodelib_popdirect(3); } else if (lua_key_eq(s, lang)) { @@ -6089,15 +6149,15 @@ static int lua_nodelib_direct_setfield(lua_State * L) } else if (lua_key_eq(s, list) || lua_key_eq(s, head)) { list_ptr(n) = nodelib_popdirect(3); } else if (lua_key_eq(s, width)) { - width(n) = (halfword) lua_tointeger(L, 3); + width(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, height)) { - height(n) = (halfword) lua_tointeger(L, 3); + height(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, depth)) { - depth(n) = (halfword) lua_tointeger(L, 3); + depth(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, dir)) { box_dir(n) = nodelib_getdir(L, 3, 1); } else if (lua_key_eq(s, shift)) { - shift_amount(n) = (halfword) lua_tointeger(L, 3); + shift_amount(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, glue_order)) { glue_order(n) = (quarterword) lua_tointeger(L, 3); } else if (lua_key_eq(s, glue_sign)) { @@ -6125,11 +6185,11 @@ static int lua_nodelib_direct_setfield(lua_State * L) if (lua_key_eq(s, subtype)) { subtype(n) = (quarterword) lua_tointeger(L, 3); } else if (lua_key_eq(s, width)) { - width(n) = (halfword) lua_tointeger(L, 3); + width(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, stretch)) { - stretch(n) = (halfword) lua_tointeger(L, 3); + stretch(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, shrink)) { - shrink(n) = (halfword) lua_tointeger(L, 3); + shrink(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, stretch_order)) { stretch_order(n) = (quarterword) lua_tointeger(L, 3); } else if (lua_key_eq(s, shrink_order)) { @@ -6143,9 +6203,9 @@ static int lua_nodelib_direct_setfield(lua_State * L) if (lua_key_eq(s, subtype)) { subtype(n) = (quarterword) lua_tointeger(L, 3); } else if (lua_key_eq(s, kern)) { - width(n) = (halfword) lua_tointeger(L, 3); + width(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, expansion_factor)) { - ex_kern(n) = (halfword) lua_tointeger(L, 3); + ex_kern(n) = (halfword) lua_roundnumber(L, 3); } else { return nodelib_cantset(L, n, s); } @@ -6161,17 +6221,17 @@ static int lua_nodelib_direct_setfield(lua_State * L) if (lua_key_eq(s, subtype)) { subtype(n) = (quarterword) lua_tointeger(L, 3); } else if (lua_key_eq(s, width)) { - width(n) = (halfword) lua_tointeger(L, 3); + width(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, height)) { - height(n) = (halfword) lua_tointeger(L, 3); + height(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, depth)) { - depth(n) = (halfword) lua_tointeger(L, 3); + depth(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, dir)) { rule_dir(n) = nodelib_getdir(L, 3, 1); } else if (lua_key_eq(s, index)) { rule_index(n) = (halfword) lua_tointeger(L, 3); } else if (lua_key_eq(s, transform)) { - rule_transform(n) = (halfword) lua_tointeger(L, 3); + rule_transform(n) = (halfword) lua_roundnumber(L, 3); /* can also be user value */ } else { return nodelib_cantset(L, n, s); } @@ -6201,11 +6261,11 @@ static int lua_nodelib_direct_setfield(lua_State * L) } else if (lua_key_eq(s, box_left)) { local_box_left(n) = nodelib_getlist(L, 3); } else if (lua_key_eq(s, box_left_width)) { - local_box_left_width(n) = (halfword) lua_tointeger(L, 3); + local_box_left_width(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, box_right)) { local_box_right(n) = nodelib_getlist(L, 3); } else if (lua_key_eq(s, box_right_width)) { - local_box_right_width(n) = (halfword) lua_tointeger(L, 3); + local_box_right_width(n) = (halfword) lua_roundnumber(L, 3); } else { return nodelib_cantset(L, n, s); } @@ -6247,18 +6307,18 @@ static int lua_nodelib_direct_setfield(lua_State * L) } else if (lua_key_eq(s, cost)) { float_cost(n) = (halfword) lua_tointeger(L, 3); } else if (lua_key_eq(s, depth)) { - depth(n) = (halfword) lua_tointeger(L, 3); + depth(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, height)) { - height(n) = (halfword) lua_tointeger(L, 3); + height(n) = (halfword) lua_roundnumber(L, 3); } else if ((lua_key_eq(s, list)) || (lua_key_eq(s, head))) { ins_ptr(n) = nodelib_popdirect(3); /* glue */ } else if (lua_key_eq(s, width)) { - width(n) = (halfword) lua_tointeger(L, 3); + width(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, stretch)) { - stretch(n) = (halfword) lua_tointeger(L, 3); + stretch(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, shrink)) { - shrink(n) = (halfword) lua_tointeger(L, 3); + shrink(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, stretch_order)) { stretch_order(n) = (quarterword) lua_tointeger(L, 3); } else if (lua_key_eq(s, shrink_order)) { @@ -6270,14 +6330,14 @@ static int lua_nodelib_direct_setfield(lua_State * L) if (lua_key_eq(s, subtype)) { subtype(n) = (quarterword) lua_tointeger(L, 3); } else if (lua_key_eq(s, surround)) { - surround(n) = (halfword) lua_tointeger(L, 3); + surround(n) = (halfword) lua_roundnumber(L, 3); /* glue */ } else if (lua_key_eq(s, width)) { - width(n) = (halfword) lua_tointeger(L, 3); + width(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, stretch)) { - stretch(n) = (halfword) lua_tointeger(L, 3); + stretch(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, shrink)) { - shrink(n) = (halfword) lua_tointeger(L, 3); + shrink(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, stretch_order)) { stretch_order(n) = (quarterword) lua_tointeger(L, 3); } else if (lua_key_eq(s, shrink_order)) { @@ -6289,7 +6349,7 @@ static int lua_nodelib_direct_setfield(lua_State * L) if (lua_key_eq(s, subtype)) { subtype(n) = (quarterword) lua_tointeger(L, 3); } else if (lua_key_eq(s, width)) { - thickness(n) = (halfword) lua_tointeger(L, 3); + thickness(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, num)) { numerator(n) = nodelib_popdirect(3); } else if (lua_key_eq(s, denom)) { @@ -6298,6 +6358,10 @@ static int lua_nodelib_direct_setfield(lua_State * L) left_delimiter(n) = nodelib_popdirect(3); } else if (lua_key_eq(s, right)) { right_delimiter(n) = nodelib_popdirect(3); + } else if (lua_key_eq(s, middle)) { + middle_delimiter(n) = nodelib_popdirect(3); + } else if (lua_key_eq(s, options)) { + fractionoptions(n) = (halfword) lua_tointeger(L, 3); } else { return nodelib_cantset(L, n, s); } @@ -6324,6 +6388,8 @@ static int lua_nodelib_direct_setfield(lua_State * L) bot_accent_chr(n) = nodelib_popdirect(3); } else if (lua_key_eq(s, overlay_accent)) { overlay_accent_chr(n) = nodelib_popdirect(3); + } else if (lua_key_eq(s, fraction)) { + accentfraction(n) = (halfword) lua_roundnumber(L, 3); } else { return nodelib_cantset(L, n, s); } @@ -6332,6 +6398,16 @@ static int lua_nodelib_direct_setfield(lua_State * L) subtype(n) = (quarterword) lua_tointeger(L, 3); } else if (lua_key_eq(s, delim)) { delimiter(n) = nodelib_popdirect(3); + } else if (lua_key_eq(s, italic)) { + delimiteritalic(n) = (halfword) lua_roundnumber(L,3); + } else if (lua_key_eq(s, height)) { + delimiterheight(n) = (halfword) lua_roundnumber(L,3); + } else if (lua_key_eq(s, depth)) { + delimiterdepth(n) = (halfword) lua_roundnumber(L,3); + } else if (lua_key_eq(s, options)) { + delimiteroptions(n) = (halfword) lua_tointeger(L,3); + } else if (lua_key_eq(s, class)) { + delimiterclass(n) = (halfword) lua_tointeger(L,3); } else { return nodelib_cantset(L, n, s); } @@ -6370,6 +6446,10 @@ static int lua_nodelib_direct_setfield(lua_State * L) left_delimiter(n) = nodelib_popdirect(3); } else if (lua_key_eq(s, degree)) { degree(n) = nodelib_popdirect(3); + } else if (lua_key_eq(s, width)) { + radicalwidth(n) = lua_roundnumber(L, 3); + } else if (lua_key_eq(s, options)) { + radicaloptions(n) = (halfword) lua_tointeger(L,3); } else { return nodelib_cantset(L, n, s); } @@ -6377,7 +6457,7 @@ static int lua_nodelib_direct_setfield(lua_State * L) if (lua_key_eq(s, subtype)) { subtype(n) = (quarterword) lua_tointeger(L, 3); } else if (lua_key_eq(s, width)) { - width(n) = (halfword) lua_tointeger(L, 3); + width(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, glyph)) { margin_char(n) = nodelib_popdirect(3); } else { @@ -6443,21 +6523,21 @@ static int lua_nodelib_direct_setfield(lua_State * L) if (lua_key_eq(s, subtype)) { /* dummy subtype */ } else if (lua_key_eq(s, width)) { - width(n) = (halfword) lua_tointeger(L, 3); + width(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, height)) { - height(n) = (halfword) lua_tointeger(L, 3); + height(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, depth)) { - depth(n) = (halfword) lua_tointeger(L, 3); + depth(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, dir)) { box_dir(n) = nodelib_getdir(L, 3, 1); } else if (lua_key_eq(s, shrink)) { - glue_shrink(n) = (halfword) lua_tointeger(L, 3); + glue_shrink(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, glue_order)) { glue_order(n) = (quarterword) lua_tointeger(L, 3); } else if (lua_key_eq(s, glue_sign)) { glue_sign(n) = (quarterword) lua_tointeger(L, 3); } else if (lua_key_eq(s, stretch)) { - glue_stretch(n) = (halfword) lua_tointeger(L, 3); + glue_stretch(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, count)) { span_count(n) = (quarterword) lua_tointeger(L, 3); } else if ((lua_key_eq(s, list)) || (lua_key_eq(s, head))){ @@ -6481,11 +6561,11 @@ static int lua_nodelib_direct_setfield(lua_State * L) } } else if (t == glue_spec_node) { if (lua_key_eq(s, width)) { - width(n) = (halfword) lua_tointeger(L, 3); + width(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, stretch)) { - stretch(n) = (halfword) lua_tointeger(L, 3); + stretch(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, shrink)) { - shrink(n) = (halfword) lua_tointeger(L, 3); + shrink(n) = (halfword) lua_roundnumber(L, 3); } else if (lua_key_eq(s, stretch_order)) { stretch_order(n) = (quarterword) lua_tointeger(L, 3); } else if (lua_key_eq(s, shrink_order)) { diff --git a/Build/source/texk/web2c/luatexdir/lua/lpdflib.c b/Build/source/texk/web2c/luatexdir/lua/lpdflib.c index 4037bacd81b..3b9846c0ed2 100644 --- a/Build/source/texk/web2c/luatexdir/lua/lpdflib.c +++ b/Build/source/texk/web2c/luatexdir/lua/lpdflib.c @@ -938,9 +938,9 @@ static int setpdforigin(lua_State * L) int h = 0 ; int v = 0 ; if (lua_type(L, 1) == LUA_TNUMBER) { - h = (int) lua_tointeger(L, 1); + h = (int) lua_roundnumber(L, 1); if (lua_type(L, 2) == LUA_TNUMBER) { - v = (int) lua_tointeger(L, 1); + v = (int) lua_roundnumber(L, 1); } else { v = h; } @@ -973,28 +973,28 @@ static int getpdfimageresolution(lua_State * L) static int setpdfthreadmargin(lua_State * L) { if (lua_type(L, 1) == LUA_TNUMBER) { - set_tex_extension_dimen_register(d_pdf_thread_margin,lua_tointeger(L, 1)); + set_tex_extension_dimen_register(d_pdf_thread_margin,lua_roundnumber(L, 1)); } return 0; } static int setpdfdestmargin(lua_State * L) { if (lua_type(L, 1) == LUA_TNUMBER) { - set_tex_extension_dimen_register(d_pdf_dest_margin,lua_tointeger(L, 1)); + set_tex_extension_dimen_register(d_pdf_dest_margin,lua_roundnumber(L, 1)); } return 0; } static int setpdflinkmargin(lua_State * L) { if (lua_type(L, 1) == LUA_TNUMBER) { - set_tex_extension_dimen_register(d_pdf_link_margin,lua_tointeger(L, 1)); + set_tex_extension_dimen_register(d_pdf_link_margin,lua_roundnumber(L, 1)); } return 0; } static int setpdfxformmargin(lua_State * L) { if (lua_type(L, 1) == LUA_TNUMBER) { - set_tex_extension_dimen_register(d_pdf_xform_margin,lua_tointeger(L, 1)); + set_tex_extension_dimen_register(d_pdf_xform_margin,lua_roundnumber(L, 1)); } return 0; } diff --git a/Build/source/texk/web2c/luatexdir/lua/ltexlib.c b/Build/source/texk/web2c/luatexdir/lua/ltexlib.c index 885981ae9ad..6fdb2ac4ec8 100644 --- a/Build/source/texk/web2c/luatexdir/lua/ltexlib.c +++ b/Build/source/texk/web2c/luatexdir/lua/ltexlib.c @@ -653,7 +653,7 @@ static int tex_scaledimen(lua_State * L) int sp; int t = lua_type(L, 1); if (t == LUA_TNUMBER) { - sp = lua_tointeger(L, 1); + sp = lua_roundnumber(L, 1); } else if (t == LUA_TSTRING) { sp = dimen_to_number(L, lua_tostring(L, 1)); } else { @@ -836,7 +836,7 @@ static int setdimen(lua_State * L) int t = lua_type(L, top); check_item_global(L,top,isglobal); if (t == LUA_TNUMBER) { - value = lua_tointeger(L, top); + value = lua_roundnumber(L, top); } else if (t == LUA_TSTRING) { value = dimen_to_number(L, lua_tostring(L, top)); } else { @@ -895,13 +895,13 @@ static int setglue(lua_State * L) } /* [global] slot [width] [stretch] [shrink] [stretch_order] [shrink_order] */ if (top > 1) { - width(value) = lua_tointeger(L,index+1); + width(value) = lua_roundnumber(L,index+1); } if (top > 2) { - stretch(value) = lua_tointeger(L,index+2); + stretch(value) = lua_roundnumber(L,index+2); } if (top > 3) { - shrink(value) = lua_tointeger(L,index+3); + shrink(value) = lua_roundnumber(L,index+3); } if (top > 4) { stretch_order(value) = lua_tointeger(L,index+4); @@ -967,13 +967,13 @@ static int setmuglue(lua_State * L) } /* [global] slot [width] [stretch] [shrink] [stretch_order] [shrink_order] */ if (top > 1) { - width(value) = lua_tointeger(L,index+1); + width(value) = lua_roundnumber(L,index+1); } if (top > 2) { - stretch(value) = lua_tointeger(L,index+2); + stretch(value) = lua_roundnumber(L,index+2); } if (top > 3) { - shrink(value) = lua_tointeger(L,index+3); + shrink(value) = lua_roundnumber(L,index+3); } if (top > 4) { stretch_order(value) = lua_tointeger(L,index+4); @@ -1217,7 +1217,7 @@ static int splitbox(lua_State * L) if ((m<0) || (m>1)) { luaL_error(L, "wrong mode in splitbox"); } - nodelist_to_lua(L, vsplit(k,lua_tointeger(L,2),m)); + nodelist_to_lua(L, vsplit(k,lua_roundnumber(L,2),m)); } else { /* maybe a warning */ lua_pushnil(L); @@ -1637,7 +1637,7 @@ static int settex(lua_State * L) st = lua_tolstring(L, (i - 1), &k); if (lua_key_eq(st,prevdepth)) { if (lua_type(L, i) == LUA_TNUMBER) { - cur_list.prev_depth_field = lua_tointeger(L, i); + cur_list.prev_depth_field = lua_roundnumber(L, i); } else if (lua_type(L, i) == LUA_TSTRING) { cur_list.prev_depth_field = dimen_to_number(L, lua_tostring(L, i)); } else { @@ -1653,7 +1653,7 @@ static int settex(lua_State * L) return 0; } else if (lua_key_eq(st,spacefactor)) { if (lua_type(L, i) == LUA_TNUMBER) { - cur_list.space_factor_field = lua_tointeger(L, i); + cur_list.space_factor_field = lua_roundnumber(L, i); } else { luaL_error(L, "unsupported value type"); } @@ -1678,7 +1678,7 @@ static int settex(lua_State * L) } } else if (is_dim_assign(cur_cmd1)) { if (lua_type(L, i) == LUA_TNUMBER) { - j = lua_tointeger(L, i); + j = lua_roundnumber(L, i); } else if (lua_type(L, i) == LUA_TSTRING) { j = dimen_to_number(L, lua_tostring(L, i)); } else { @@ -1895,7 +1895,7 @@ static int tex_setmathparm(lua_State * L) k = *((halfword *)p); def_math_param(i, j, (scaled) k, l); } else if (lua_type(L, n) == LUA_TNUMBER) { - k = lua_tointeger(L, n); + k = lua_roundnumber(L, n); def_math_param(i, j, (scaled) k, l); } else { luaL_error(L, "argument must be a number"); @@ -2217,10 +2217,10 @@ static int lua_nest_setfield(lua_State * L) i = lua_tointeger(L, -1); r->ml_field = i; } else if (lua_key_eq(field,prevdepth)) { - i = lua_tointeger(L, -1); + i = lua_roundnumber(L, -1); r->prev_depth_field = i; } else if (lua_key_eq(field,spacefactor)) { - i = lua_tointeger(L, -1); + i = lua_roundnumber(L, -1); r->space_factor_field = i; } else if (lua_key_eq(field,noad)) { n = check_isnode(L, -1); @@ -2582,11 +2582,11 @@ static halfword nodelib_toparshape(lua_State * L, int i) if (lua_type(L, i) == LUA_TTABLE) { lua_rawgeti(L, -1, 1); /* indent */ if (lua_type(L, -1) == LUA_TNUMBER) { - indent = lua_tointeger(L, -1); + indent = lua_roundnumber(L, -1); lua_pop(L, 1); lua_rawgeti(L, -1, 2); /* width */ if (lua_type(L, -1) == LUA_TNUMBER) { - width = lua_tointeger(L, -1); + width = lua_roundnumber(L, -1); lua_pop(L, 1); varmem[p + 2 * j].cint = indent; varmem[p + 2 * j + 1].cint = width; @@ -2834,7 +2834,7 @@ static int tex_init_rand(lua_State * L) luaL_error(L, "argument must be a number"); return 0; } - sp = lua_tointeger(L, 1); + sp = lua_roundnumber(L, 1); init_randoms(sp); return 0; } @@ -2846,7 +2846,7 @@ static int tex_unif_rand(lua_State * L) luaL_error(L, "argument must be a number"); return 0; } - sp = lua_tointeger(L, 1); + sp = lua_roundnumber(L, 1); lua_pushinteger(L, unif_rand(sp)); return 1; } @@ -2859,7 +2859,7 @@ static int tex_norm_rand(lua_State * L) /* Same as lua but with tex rng */ - static int lua_math_random (lua_State *L) +static int lua_math_random (lua_State *L) { lua_Number rand_max = 0x7fffffff ; lua_Number r = unif_rand(rand_max) ; @@ -2978,13 +2978,13 @@ static int tex_use_box_resource(lua_State * L) alt.ht = null_flag; alt.dp = null_flag; if (lua_type(L,2) == LUA_TNUMBER) { - alt.wd = (scaled) lua_tointeger(L,2); + alt.wd = (scaled) lua_roundnumber(L,2); } if (lua_type(L,3) == LUA_TNUMBER) { - alt.ht = (scaled) lua_tointeger(L,3); + alt.ht = (scaled) lua_roundnumber(L,3); } if (lua_type(L,4) == LUA_TNUMBER) { - alt.dp = (scaled) lua_tointeger(L,4); + alt.dp = (scaled) lua_roundnumber(L,4); } /* sort of the same as backend */ check_obj_type(static_pdf, obj_type_xform, index); diff --git a/Build/source/texk/web2c/luatexdir/lua/luanode.w b/Build/source/texk/web2c/luatexdir/lua/luanode.w index 39b68a68614..f901eddbfa9 100644 --- a/Build/source/texk/web2c/luatexdir/lua/luanode.w +++ b/Build/source/texk/web2c/luatexdir/lua/luanode.w @@ -180,7 +180,7 @@ int lua_appendtovlist_callback(halfword box, int location, halfword prev_depth, return 0; } if (lua_type(Luas,-1) == LUA_TNUMBER) { - *next_depth = lua_tointeger(Luas,-1); + *next_depth = lua_roundnumber(Luas,-1); *prev_set = true; if (lua_type(Luas, -2) != LUA_TNIL) { p = check_isnode(Luas, -2); diff --git a/Build/source/texk/web2c/luatexdir/lua/luatex-api.h b/Build/source/texk/web2c/luatexdir/lua/luatex-api.h index cf3740101da..b3d70a4e58d 100644 --- a/Build/source/texk/web2c/luatexdir/lua/luatex-api.h +++ b/Build/source/texk/web2c/luatexdir/lua/luatex-api.h @@ -586,6 +586,7 @@ make_lua_key(finalhyphendemerits);\ make_lua_key(font);\ make_lua_key(fonts);\ make_lua_key(format);\ +make_lua_key(fraction);\ make_lua_key(fullname);\ make_lua_key(global);\ make_lua_key(glue);\ @@ -657,6 +658,7 @@ make_lua_key(mathkern);\ make_lua_key(mathstyle);\ make_lua_key(media);\ make_lua_key(mid);\ +make_lua_key(middle);\ make_lua_key(mode);\ make_lua_key(modeline);\ make_lua_key(name);\ @@ -681,6 +683,7 @@ make_lua_key(objcompression);\ make_lua_key(objnum);\ make_lua_key(oldmath);\ make_lua_key(ordering);\ +make_lua_key(options);\ make_lua_key(origin);\ make_lua_key(output);\ make_lua_key(overlay_accent);\ @@ -950,6 +953,7 @@ init_lua_key(finalhyphendemerits);\ init_lua_key(font);\ init_lua_key(fonts);\ init_lua_key(format);\ +init_lua_key(fraction);\ init_lua_key(fullname);\ init_lua_key(global);\ init_lua_key(glue);\ @@ -1019,6 +1023,7 @@ init_lua_key(mathkern);\ init_lua_key(mathstyle);\ init_lua_key(media);\ init_lua_key(mid);\ +init_lua_key(middle);\ init_lua_key(mode);\ init_lua_key(modeline);\ init_lua_key(name);\ @@ -1040,6 +1045,7 @@ init_lua_key(number);\ init_lua_key(objcompression);\ init_lua_key(objnum);\ init_lua_key(oldmath);\ +init_lua_key(options);\ init_lua_key(origin);\ init_lua_key(ordering);\ init_lua_key(output);\ @@ -1363,6 +1369,7 @@ use_lua_key(finalhyphendemerits); use_lua_key(font); use_lua_key(fonts); use_lua_key(format); +use_lua_key(fraction); use_lua_key(fullname); use_lua_key(global); use_lua_key(glue); @@ -1434,6 +1441,7 @@ use_lua_key(mathkern); use_lua_key(mathstyle); use_lua_key(media); use_lua_key(mid); +use_lua_key(middle); use_lua_key(mode); use_lua_key(modeline); use_lua_key(name); @@ -1457,6 +1465,7 @@ use_lua_key(number); use_lua_key(objcompression); use_lua_key(objnum); use_lua_key(oldmath); +use_lua_key(options); use_lua_key(origin); use_lua_key(ordering); use_lua_key(output); diff --git a/Build/source/texk/web2c/luatexdir/luatex.c b/Build/source/texk/web2c/luatexdir/luatex.c index 3a720290577..102671f529c 100644 --- a/Build/source/texk/web2c/luatexdir/luatex.c +++ b/Build/source/texk/web2c/luatexdir/luatex.c @@ -29,9 +29,9 @@ #define TeX int luatex_version = 98; /* \.{\\luatexversion} */ -int luatex_revision = '1'; /* \.{\\luatexrevision} */ -int luatex_date_info = 2016081014; /* the compile date is now hardwired */ -const char *luatex_version_string = "0.98.1"; +int luatex_revision = '2'; /* \.{\\luatexrevision} */ +int luatex_date_info = 2016081300; /* the compile date is now hardwired */ +const char *luatex_version_string = "0.98.2"; const char *engine_name = my_name; /* the name of this engine */ #include <kpathsea/c-ctype.h> diff --git a/Build/source/texk/web2c/luatexdir/tex/texnodes.w b/Build/source/texk/web2c/luatexdir/tex/texnodes.w index 6bfa14f2356..50fbe95190f 100644 --- a/Build/source/texk/web2c/luatexdir/tex/texnodes.w +++ b/Build/source/texk/web2c/luatexdir/tex/texnodes.w @@ -143,17 +143,17 @@ const char *node_fields_choice[] = { "attr", "display", "text", "script", "scriptscript", NULL }; const char *node_fields_radical[] = { - "attr", "nucleus", "sub", "sup", "left", "degree", NULL + "attr", "nucleus", "sub", "sup", "left", "degree", "width", "options", NULL }; const char *node_fields_fraction[] = { - "attr", "width", "num", "denom", "left", "right", NULL + "attr", "width", "num", "denom", "left", "right", "middle", "options", NULL }; const char *node_fields_accent[] = { "attr", "nucleus", "sub", "sup", "accent", "bot_accent", "top_accent", - "overlay_accent", NULL + "overlay_accent", "fraction", NULL }; const char *node_fields_fence[] = { - "attr", "delim", NULL + "attr", "delim", "italic", "height", "depth", "options", "class", NULL }; const char *node_fields_math_char[] = { "attr", "fam", "char", NULL |