summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/char-ini.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2018-10-03 16:44:19 +0200
committerContext Git Mirror Bot <phg@phi-gamma.net>2018-10-03 16:44:19 +0200
commit753dd0cbafc567d4960c5fc4888ccb4e2302c64d (patch)
tree6fe5c8e25d597f535b4c7d6b6d254445f79a1e6d /tex/context/base/mkiv/char-ini.lua
parent551c89289d267c2d8901f3375e57ed1fe2508de5 (diff)
downloadcontext-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.lua21
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