diff options
author | Hans Hagen <pragma@wxs.nl> | 2018-10-03 16:44:19 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2018-10-03 16:44:19 +0200 |
commit | 753dd0cbafc567d4960c5fc4888ccb4e2302c64d (patch) | |
tree | 6fe5c8e25d597f535b4c7d6b6d254445f79a1e6d /tex/context/base/mkiv/char-ini.lua | |
parent | 551c89289d267c2d8901f3375e57ed1fe2508de5 (diff) | |
download | context-753dd0cbafc567d4960c5fc4888ccb4e2302c64d.tar.gz |
2018-10-03 16:11:00
Diffstat (limited to 'tex/context/base/mkiv/char-ini.lua')
-rw-r--r-- | tex/context/base/mkiv/char-ini.lua | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/tex/context/base/mkiv/char-ini.lua b/tex/context/base/mkiv/char-ini.lua index ea9aa330f..1c53d924f 100644 --- a/tex/context/base/mkiv/char-ini.lua +++ b/tex/context/base/mkiv/char-ini.lua @@ -642,14 +642,19 @@ function characters.getrange(name,expression) -- used in font fallback definitio name = gsub(name,'"',"0x") -- goodie: tex hex notation local start, stop if expression then - local first, rest = lpegmatch(splitter2,name) - local range = rawget(blocks,lower(gsub(first,"[^a-zA-Z0-9]",""))) - if range then - local s = loadstring("return 0 " .. rest) - if type(s) == "function" then - local d = s() - if type(d) == "number" then - return range.first + d, range.last + d, nil + local n = tonumber(name) + if n then + return n, n, nil + else + local first, rest = lpegmatch(splitter2,name) + local range = rawget(blocks,lower(gsub(first,"[^a-zA-Z0-9]",""))) + if range then + local s = loadstring("return 0 " .. rest) + if type(s) == "function" then + local d = s() + if type(d) == "number" then + return range.first + d, range.last + d, nil + end end end end |