From c768d04a83193229af281526797c8fc4e64d589f Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Thu, 16 Jun 2011 12:50:00 +0200 Subject: beta 2011.06.16 12:50 --- tex/generic/context/luatex-fonts-merged.lua | 51 +++++++++++++++++------------ 1 file changed, 30 insertions(+), 21 deletions(-) (limited to 'tex/generic') diff --git a/tex/generic/context/luatex-fonts-merged.lua b/tex/generic/context/luatex-fonts-merged.lua index 831a39164..d2e14b55d 100644 --- a/tex/generic/context/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 06/16/11 00:34:14 +-- merge date : 06/16/11 12:50:49 do -- begin closure to overcome local limits and interference @@ -4915,7 +4915,7 @@ local otf = fonts.handlers.otf otf.glists = { "gsub", "gpos" } -otf.version = 2.730 -- beware: also sync font-mis.lua +otf.version = 2.731 -- beware: also sync font-mis.lua otf.cache = containers.define("fonts", "otf", otf.version, true) local fontdata = fonts.hashes.identifiers @@ -5827,6 +5827,15 @@ actions["prepare tounicode"] = function(data,filename,raw) fonts.mappings.addtounicode(data,filename) end +local g_directions = { + gsub_contextchain = 1, + gpos_contextchain = 1, + -- gsub_context = 1, + -- gpos_context = 1, + gsub_reversecontextchain = -1, + gpos_reversecontextchain = -1, +} + actions["reorganize subtables"] = function(data,filename,raw) local resources = data.resources local sequences = { } @@ -5840,10 +5849,7 @@ actions["reorganize subtables"] = function(data,filename,raw) for k=1,#dw do local gk = dw[k] local typ = gk.type - local chain = - (typ == "gsub_contextchain" or typ == "gpos_contextchain") and 1 or - (typ == "gsub_reversecontextchain" or typ == "gpos_reversecontextchain") and -1 or 0 - -- + local chain = g_directions[typ] or 0 local subtables = gk.subtables if subtables then local t = { } @@ -5945,19 +5951,20 @@ end local function t_hashed(t,cache) if t then - local h = { } + local ht = { } for i=1,#t do local ti = t[i] - local h = cache[ti] - if not h then - h = { } + local tih = cache[ti] + if not tih then + tih = { } for i=1,#ti do - h[ti] = true + tih[ti[i]] = true end + cache[ti] = tih end - cache[ti] = h + ht[i] = tih end - return h + return ht else return nil end @@ -6041,7 +6048,7 @@ actions["reorganize lookups"] = function(data,filename,raw) for i=1,#current do current[i] = current_class[current[i]] or { } if lookups and not lookups[i] then - lookups[i] = false + lookups[i] = false -- e.g. we can have two lookups and one replacement end end rule.current = t_hashed(current,h_cache) @@ -9696,8 +9703,8 @@ local function normal_handle_contextchain(start,kind,chainname,contexts,sequence end end local chainlookupname = chainlookups[i] - local chainlookup = lookuptable[chainlookupname] - local cp = chainmores[chainlookup.type] + local chainlookup = lookuptable[chainlookupname] -- can be false (n matches,