diff options
author | Hans Hagen <pragma@wxs.nl> | 2010-10-21 23:27:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2010-10-21 23:27:00 +0200 |
commit | 67de987aa9e60bf263e0d1bc8a34a203e88a7447 (patch) | |
tree | 364615f963dc83246f6afd3209910300c2ccdfe3 /tex/context/base/font-otn.lua | |
parent | 90d120bb6575d66730755fceaa113a14d16b8712 (diff) | |
download | context-67de987aa9e60bf263e0d1bc8a34a203e88a7447.tar.gz |
beta 2010.10.21 23:27
Diffstat (limited to 'tex/context/base/font-otn.lua')
-rw-r--r-- | tex/context/base/font-otn.lua | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/tex/context/base/font-otn.lua b/tex/context/base/font-otn.lua index 608e42fb3..2bccc3c1b 100644 --- a/tex/context/base/font-otn.lua +++ b/tex/context/base/font-otn.lua @@ -124,6 +124,7 @@ local concat, insert, remove = table.concat, table.insert, table.remove local format, gmatch, gsub, find, match, lower, strip = string.format, string.gmatch, string.gsub, string.find, string.match, string.lower, string.strip local type, next, tonumber, tostring = type, next, tonumber, tostring local lpegmatch = lpeg.match +local random = math.random local logs, trackers, fonts, nodes, attributes = logs, trackers, fonts, nodes, attributes @@ -419,7 +420,7 @@ end local function alternative_glyph(start,alternatives,kind,chainname,chainlookupname,lookupname) -- chainname and chainlookupname optional local value, choice, n = featurevalue or tfmdata.shared.features[kind], nil, #alternatives -- global value, brrr if value == "random" then - local r = math.random(1,n) + local r = random(1,n) value, choice = format("random, choice %s",r), alternatives[r] elseif value == "first" then value, choice = format("first, choice %s",1), alternatives[1] @@ -1784,22 +1785,22 @@ local function normal_handle_contextchain(start,kind,chainname,contexts,sequence local i = 1 repeat -if skipped then - while true do - local char = start.char - local ccd = descriptions[char] - if ccd then - local class = ccd.class - if class == skipmark or class == skipligature or class == skipbase or (markclass and class == "mark" and not markclass[char]) then - start = start.next - else - break - end - else - break - end - end -end + if skipped then + while true do + local char = start.char + local ccd = descriptions[char] + if ccd then + local class = ccd.class + if class == skipmark or class == skipligature or class == skipbase or (markclass and class == "mark" and not markclass[char]) then + start = start.next + else + break + end + else + break + end + end + end local chainlookupname = chainlookups[i] local chainlookup = lookuptable[chainlookupname] local cp = chainmores[chainlookup.type] |