summaryrefslogtreecommitdiff
path: root/src/luaotfload-features.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2014-05-12 19:27:14 +0200
committerPhilipp Gesang <phg42.2a@gmail.com>2014-05-12 19:27:14 +0200
commitde38f10275c160589d0cbbcac4d9141dd6a3ab72 (patch)
tree16bc2cb7c168ac7a8c52f87d9ce0f75dec6c61d6 /src/luaotfload-features.lua
parentf6a700f3e8149558b8fbadf5a7ebfc9e78ba1b7d (diff)
downloadluaotfload-de38f10275c160589d0cbbcac4d9141dd6a3ab72.tar.gz
[features] adapt tlig feature to extended ligature spec
Diffstat (limited to 'src/luaotfload-features.lua')
-rw-r--r--src/luaotfload-features.lua23
1 files changed, 18 insertions, 5 deletions
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,
},
}