summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/font-osd.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkiv/font-osd.lua')
-rw-r--r--tex/context/base/mkiv/font-osd.lua23
1 files changed, 13 insertions, 10 deletions
diff --git a/tex/context/base/mkiv/font-osd.lua b/tex/context/base/mkiv/font-osd.lua
index 91cf1522c..3c30910ab 100644
--- a/tex/context/base/mkiv/font-osd.lua
+++ b/tex/context/base/mkiv/font-osd.lua
@@ -81,7 +81,7 @@ if not modules then modules = { } end modules ['font-osd'] = { -- script devanag
-- malayalam, oriya, tamil and tolugu but not all are checked. Also, some of the
-- code below might need to be adapted to the extra scripts.
-local insert, imerge, copy = table.insert, table.imerge, table.copy
+local insert, imerge, copy, tohash = table.insert, table.imerge, table.copy, table.tohash
local next, type = next, type
local report = logs.reporter("otf","devanagari")
@@ -332,8 +332,8 @@ local two_defaults = {
}
local one_defaults = {
- dev2 = dflt_true,
- deva = dflt_true,
+ dev2 = dflt_true, -- set later
+ deva = dflt_true, -- set later
}
local false_flags = { false, false, false, false }
@@ -455,6 +455,8 @@ local scripts = { }
local scripts_one = { "deva", "mlym", "beng", "gujr", "guru", "knda", "orya", "taml", "telu" }
local scripts_two = { "dev2", "mlm2", "bng2", "gjr2", "gur2", "knd2", "ory2", "tml2", "tel2" }
+local scripts_old = { } for i=1,#scripts_one do local v = scripts_one[i] scripts_old[v] = v end -- self
+
local nofscripts = #scripts_one
for i=1,nofscripts do
@@ -532,6 +534,8 @@ local function initializedevanagi(tfmdata)
--
resources.devanagari = devanagari
--
+ local old = scripts_old[script] or false
+ --
for s=1,#sequences do
local sequence = sequences[s]
local steps = sequence.steps
@@ -539,9 +543,9 @@ local function initializedevanagi(tfmdata)
local features = sequence.features
local has_rphf = features.rphf
local has_blwf = features.blwf
- if has_rphf and has_rphf.deva then
+ if has_rphf and has_rphf[old] then
devanagari.reph = true
- elseif has_blwf and has_blwf.deva then
+ elseif has_blwf and has_blwf[old] then
devanagari.vattu = true
for i=1,nofsteps do
local step = steps[i]
@@ -617,13 +621,15 @@ local function initializedevanagi(tfmdata)
--
-- needs checking: this might be needed per instance ?
--
- if script == "deva" then
+ if script == "deva" or script == "knda" then
sharedfeatures["dv04"] = true -- dv04_remove_joiners
- elseif script == "dev2" then
+ elseif script == "dev2" or script == "knd2" then
sharedfeatures["dv01"] = true -- dv01_reorder_matras
sharedfeatures["dv02"] = true -- dv02_reorder_reph
sharedfeatures["dv03"] = true -- dv03_reorder_pre_base_reordering_consonants
sharedfeatures["dv04"] = true -- dv04_remove_joiners
+ -- elseif script == "knda" then -- see deva, needs checking by Kai
+ -- elseif script == "knd2" then -- see dev2, needs checking by Kai
elseif script == "mlym" then
sharedfeatures["pstf"] = true
elseif script == "mlm2" then
@@ -638,8 +644,6 @@ local function initializedevanagi(tfmdata)
-- elseif script == "gjr2" then
-- elseif script == "guru" then
-- elseif script == "gur2" then
- -- elseif script == "knda" then
- -- elseif script == "knd2" then
elseif script == "taml" then
sharedfeatures["dv04"] = true -- dv04_remove_joiners
sharedfeatures["pstf"] = true
@@ -699,7 +703,6 @@ local function initialize_one(font,attr) -- we need a proper hook into the datas
datasets.devanagari = devanagaridata
local resources = tfmdata.resources
local devanagari = resources.devanagari
-
for s=1,#datasets do
local dataset = datasets[s]
if dataset and dataset[1] then -- value