summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2016-03-25 22:30:04 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2016-03-25 22:30:04 +0000
commitdadde6e57798c965280eae14f148ab080ea9b744 (patch)
tree81dc66428e6f49cd7e3b3ec65e4a356eb45ddc8c /Build
parentc571d460b484324d6730a18610a18617b10bad3c (diff)
web2c/luatexdir: sync with the upstream
git-svn-id: svn://tug.org/texlive/trunk@40141 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/web2c/luatexdir/lua/lnodelib.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/Build/source/texk/web2c/luatexdir/lua/lnodelib.c b/Build/source/texk/web2c/luatexdir/lua/lnodelib.c
index a5112385195..3a8982604c6 100644
--- a/Build/source/texk/web2c/luatexdir/lua/lnodelib.c
+++ b/Build/source/texk/web2c/luatexdir/lua/lnodelib.c
@@ -550,15 +550,17 @@ static int lua_nodelib_direct_setsubtype(lua_State * L)
static int lua_nodelib_getfont(lua_State * L)
{
- halfword *p = lua_touserdata(L, 1);
- if ( (p == NULL) || (! lua_getmetatable(L,1)) ) {
+ halfword *n = lua_touserdata(L, 1);
+ if ( (n == NULL) || (! lua_getmetatable(L,1)) ) {
lua_pushnil(L);
} else {
- lua_get_metatablelua(luatex_node);
- if ( (!lua_rawequal(L, -1, -2)) || (type(*p) != glyph_node) ) {
- lua_pushnil(L);
+ halfword t = type(*n);
+ if (t == glyph_node) {
+ lua_pushinteger(L, font(*n));
+ } else if ((t == math_char_node) || (t == math_text_char_node)) {
+ lua_pushinteger(L, fam_fnt(math_fam(*n), 0));
} else {
- lua_pushinteger(L, font(*p));
+ lua_pushnil(L);
}
}
return 1;
@@ -3296,6 +3298,8 @@ static int lua_nodelib_fast_getfield(lua_State * L)
lua_pushinteger(L, math_fam(n));
} else if (lua_key_eq(s, char)) {
lua_pushinteger(L, math_character(n));
+ } else if (lua_key_eq(s, font)) {
+ lua_pushinteger(L, fam_fnt(math_fam(n), 0));
} else {
lua_pushnil(L);
}
@@ -4014,6 +4018,8 @@ static int lua_nodelib_direct_getfield(lua_State * L)
lua_pushinteger(L, math_fam(n));
} else if (lua_key_eq(s, char)) {
lua_pushinteger(L, math_character(n));
+ } else if (lua_key_eq(s, font)) {
+ lua_pushinteger(L, fam_fnt(math_fam(n), 0));
} else {
lua_pushnil(L);
}