From 430e36b5a723b307678070fd5b8597ab7c57a935 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Wed, 3 Nov 2010 03:45:20 +0200 Subject: Sync with context 2010.11.01 Not tested, yet. --- otfl-font-ott.lua | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'otfl-font-ott.lua') diff --git a/otfl-font-ott.lua b/otfl-font-ott.lua index a5a0df3..ec915b8 100644 --- a/otfl-font-ott.lua +++ b/otfl-font-ott.lua @@ -638,9 +638,18 @@ local baselines = allocate { ['romn'] = 'Roman baseline' } -local verbosescripts = allocate(table.swaphash(scripts )) -local verboselanguages = allocate(table.swaphash(languages)) -local verbosefeatures = allocate(table.swaphash(features )) + +local function swap(h) -- can be a tables.swap when we get a better name + local r = { } + for k, v in next, h do + r[v] = lower(gsub(k," ","")) + end + return r +end + +local verbosescripts = allocate(swap(scripts )) +local verboselanguages = allocate(swap(languages)) +local verbosefeatures = allocate(swap(features )) tables.scripts = scripts tables.languages = languages @@ -661,12 +670,6 @@ for k, v in next, verbosefeatures do verbosefeatures[lower(k)] = v end --- can be sped up by local tables - -function tables.totag(id) -- not used - return format("%4s",lower(id)) -end - local function resolve(tab,id) if tab and id then id = lower(id) -- cgit v1.2.3