From de38f10275c160589d0cbbcac4d9141dd6a3ab72 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Mon, 12 May 2014 19:27:14 +0200 Subject: [features] adapt tlig feature to extended ligature spec --- src/luaotfload-features.lua | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/luaotfload-features.lua b/src/luaotfload-features.lua index 90487c0..1200d9e 100644 --- a/src/luaotfload-features.lua +++ b/src/luaotfload-features.lua @@ -6,7 +6,8 @@ if not modules then modules = { } end modules ["features"] = { license = "see context related readme files" } -local type, next = type, next +local type = type +local next = next local tonumber = tonumber local tostring = tostring @@ -16,6 +17,11 @@ local P = lpeg.P local R = lpeg.R local C = lpeg.C +local table = table +local tabletohash = table.tohash +local setmetatableindex = table.setmetatableindex +local insert = table.insert + ---[[ begin included font-ltx.lua ]] --- this appears to be based in part on luatex-fonts-def.lua @@ -755,7 +761,7 @@ local verbosebaselines = swapped(baselines) --doc]]-- -local support_incomplete = table.tohash({ +local support_incomplete = tabletohash({ "deva", "beng", "guru", "gujr", "orya", "taml", "telu", "knda", "mlym", "sinh", @@ -983,7 +989,6 @@ local report_otf = logs.reporter("fonts","otf loading") local otf = fonts.handlers.otf local registerotffeature = otf.features.register -local setmetatableindex = table.setmetatableindex --[[HH-- @@ -1100,10 +1105,10 @@ local function addfeature(data,feature,specifications) -- script = { lang1, lang2, lang3 } or script = { lang1 = true, ... } for k, v in next, askedfeatures do if v[1] then - askedfeatures[k] = table.tohash(v) + askedfeatures[k] = tabletohash(v) end end - sequences[#sequences+1] = { + local sequence = { chain = 0, features = { [feature] = askedfeatures }, flags = featureflags, @@ -1112,6 +1117,11 @@ local function addfeature(data,feature,specifications) subtables = st, type = featuretype, } + if specification.prepend then + insert(sequences,1,sequence) + else + insert(sequences,sequence) + end -- register in metadata (merge as there can be a few) if not gsubfeatures then gsubfeatures = { } @@ -1171,6 +1181,7 @@ local tlig = { }, flags = { }, order = { "tlig" }, + prepend = true, }, { type = "ligature", @@ -1190,6 +1201,7 @@ local tlig = { }, flags = { }, order = { "tlig" }, + prepend = true, }, { type = "ligature", @@ -1202,6 +1214,7 @@ local tlig = { }, flags = { }, order = { "tlig" }, + prepend = true, }, } -- cgit v1.2.3