diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/microtype/microtype.lua')
-rw-r--r-- | Master/texmf-dist/tex/latex/microtype/microtype.lua | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/Master/texmf-dist/tex/latex/microtype/microtype.lua b/Master/texmf-dist/tex/latex/microtype/microtype.lua index 173f30da8bb..c407ca58b93 100644 --- a/Master/texmf-dist/tex/latex/microtype/microtype.lua +++ b/Master/texmf-dist/tex/latex/microtype/microtype.lua @@ -35,13 +35,14 @@ microtype = microtype or {} local microtype = microtype microtype.module = { name = "microtype", - version = "3.0", - date = "2021/10/31", + version = "3.0a", + date = "2021/12/02", description = "microtype module.", author = "E. Roux, R. Schlicht and P. Gesang", copyright = "E. Roux, R. Schlicht and P. Gesang", license = "LPPL", } +luatexbase.provides_module(microtype.module) function microtype.info(...) luatexbase.module_info("microtype",...) @@ -61,6 +62,16 @@ function microtype.sprint (...) tex.sprint(catpackage, ...) end +if not math.tointeger or not pcall(math.tointeger,0) then + math.mininteger=-0x4FFFFFFFFFFF + math.maxinteger=0x4FFFFFFFFFFF + local floor=math.floor + function math.tointeger(n) + local f=floor(n) + return f==n and f or nil + end +end + local function if_int(s) if find(s,"^-*[0-9]+ *$") then tex_write("@firstoftwo") @@ -172,9 +183,10 @@ end if luaotfload and luaotfload.aux and luaotfload.aux.slot_of_name then local slot_of_name = luaotfload.aux.slot_of_name microtype.name_to_slot = function(name, unsafe) - local n = math.tointeger(slot_of_name(font.current(), name, unsafe)) - if n and n > 1114111 then n = -1 end - return n + local n = slot_of_name(font.current(), name, unsafe) + if not n then return -1 end + if n > 1114111 then return -1 end + return math.tointeger(n) end else -- we dig into internal structure (should be avoided) |