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-def.lua | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'otfl-font-def.lua') diff --git a/otfl-font-def.lua b/otfl-font-def.lua index aac69ed..e87fee4 100644 --- a/otfl-font-def.lua +++ b/otfl-font-def.lua @@ -170,14 +170,15 @@ local sortedhashkeys = table.sortedhashkeys function tfm.hashfeatures(specification) local features = specification.features if features then - local t = { } + local t, tn = { }, 0 local normal = features.normal if normal and next(normal) then local f = sortedhashkeys(normal) for i=1,#f do local v = f[i] if v ~= "number" and v ~= "features" then -- i need to figure this out, features - t[#t+1] = v .. '=' .. tostring(normal[v]) + tn = tn + 1 + t[tn] = v .. '=' .. tostring(normal[v]) end end end @@ -186,13 +187,15 @@ function tfm.hashfeatures(specification) local f = sortedhashkeys(vtf) for i=1,#f do local v = f[i] - t[#t+1] = v .. '=' .. tostring(vtf[v]) + tn = tn + 1 + t[tn] = v .. '=' .. tostring(vtf[v]) end end ---~ if specification.mathsize then ---~ t[#t+1] = "mathsize=" .. specification.mathsize ---~ end - if #t > 0 then + --~ if specification.mathsize then + --~ tn = tn + 1 + --~ t[tn] = "mathsize=" .. specification.mathsize + --~ end + if tn > 0 then return concat(t,"+") end end -- cgit v1.2.3