diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/font-imp-math.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mkiv/font-imp-math.lua | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/font-imp-math.lua b/Master/texmf-dist/tex/context/base/mkiv/font-imp-math.lua index d93ece4059b..d2294e93c6f 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/font-imp-math.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/font-imp-math.lua @@ -79,3 +79,53 @@ registerotffeature { node = initialize, } } + +function fonts.helpers.mathscriptslots(tfmdata,textcode) + local rawdata = tfmdata.shared.rawdata + local rawresources = rawdata and rawdata.resources + local rawfeatures = rawresources and rawresources.features + local basesubstitutions = rawfeatures and rawfeatures.gsub + local sequences = basesubstitutions and tfmdata.resources.sequences + if sequences then + local characters = tfmdata.characters + if characters[textcode] then + for s=1,#sequences do + local sequence = sequences[s] + local sfeatures = sequence.features + if sfeatures and sfeatures.ssty then + local steps = sequence.steps + for i=1,#steps do + local coverage = steps[i].coverage + if coverage then + local okay = coverage[textcode] + if okay then + return okay + end + end + end + end + end + end + end +end +local function initialize(tfmdata,key,value) + if value then + local rawdata = tfmdata.shared.rawdata + local rawresources = rawdata and rawdata.resources + local mathconstants = rawresources.mathconstants + if mathconstants then + tfmdata.properties.oldmath = true + end + end +end + +local specification = { + name = "oldmath", + description = "deal with fake opentype fonts", + initializers = { + base = initialize, + node = initialize, + } +} + +registerotffeature(specification) |