summaryrefslogtreecommitdiff
path: root/tex/context/base/mkxl/font-imp-math.lmt
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkxl/font-imp-math.lmt')
-rw-r--r--tex/context/base/mkxl/font-imp-math.lmt42
1 files changed, 41 insertions, 1 deletions
diff --git a/tex/context/base/mkxl/font-imp-math.lmt b/tex/context/base/mkxl/font-imp-math.lmt
index 68dddf33d..2f9c94d16 100644
--- a/tex/context/base/mkxl/font-imp-math.lmt
+++ b/tex/context/base/mkxl/font-imp-math.lmt
@@ -26,7 +26,7 @@ local function initialize(tfmdata,value)
if mathparameters then
local sup, sub
if type(value) == "string" then
- sup, sub = lpegmatch(splitter,value)
+ sup, sub = lpegmatch(splitter,value) -- settings_to_array
if not sup then
sub, sup = 0, 0
elseif not sub then
@@ -267,3 +267,43 @@ registerotffeature {
node = initialize,
}
}
+
+local function initialize(tfmdata,value)
+ if value then
+ local validlookups, lookuplist = fonts.handlers.otf.collectlookups(tfmdata.shared.rawdata,"flac","math","dflt")
+ if validlookups then
+ -- it's quite likely just one step
+ local characters = tfmdata.characters
+ local changed = tfmdata.changed
+ for i=1,#lookuplist do
+ local lookup = lookuplist[i]
+ local steps = lookup.steps
+ local nofsteps = lookup.nofsteps
+ for i=1,nofsteps do
+ local coverage = steps[i].coverage
+ if coverage then
+ for k, v in next, coverage do
+ local c = characters[k]
+ local f = characters[v]
+ if c and f then
+ c.flataccent = v
+ if not f.unicode then
+ f.unicode = c.unicode
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+ end
+end
+
+registerotffeature {
+ name = "flattenaccents",
+ description = "mapping accents to flat ones",
+ initializers = {
+ base = initialize,
+ node = initialize,
+ }
+}