summaryrefslogtreecommitdiff
path: root/otfl-font-oti.lua
diff options
context:
space:
mode:
authorElie Roux <elie.roux@telecom-bretagne.eu>2009-06-10 20:21:00 +0300
committerElie Roux <elie.roux@telecom-bretagne.eu>2009-06-10 20:21:00 +0300
commit1ef10e57241a65e8ce2aeefdd83874e8999b7b44 (patch)
tree713769db5cdf9115e2824aa09e8f65cd795667f7 /otfl-font-oti.lua
parent5821436af1c522206c3faf90e0813415445ea6c7 (diff)
downloadluaotfload-1ef10e57241a65e8ce2aeefdd83874e8999b7b44.tar.gz
syncing with latest ConTeXt version (more feautures, less bugs), thanks to Khaled Hosny
Diffstat (limited to 'otfl-font-oti.lua')
-rw-r--r--otfl-font-oti.lua57
1 files changed, 57 insertions, 0 deletions
diff --git a/otfl-font-oti.lua b/otfl-font-oti.lua
new file mode 100644
index 0000000..cbac6d3
--- /dev/null
+++ b/otfl-font-oti.lua
@@ -0,0 +1,57 @@
+if not modules then modules = { } end modules ['font-oti'] = {
+ version = 1.001,
+ comment = "companion to font-ini.tex",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- i need to check features=yes|no also in relation to hashing
+
+local lower = string.lower
+
+local otf = fonts.otf
+
+otf.default_language = 'latn'
+otf.default_script = 'dflt'
+
+local languages = otf.tables.languages
+local scripts = otf.tables.scripts
+
+function otf.features.language(tfmdata,value)
+ if value then
+ value = lower(value)
+ if languages[value] then
+ tfmdata.language = value
+ end
+ end
+end
+
+function otf.features.script(tfmdata,value)
+ if value then
+ value = lower(value)
+ if scripts[value] then
+ tfmdata.script = value
+ end
+ end
+end
+
+function otf.features.mode(tfmdata,value)
+ if value then
+ tfmdata.mode = lower(value)
+ end
+end
+
+fonts.initializers.base.otf.language = otf.features.language
+fonts.initializers.base.otf.script = otf.features.script
+fonts.initializers.base.otf.mode = otf.features.mode
+fonts.initializers.base.otf.method = otf.features.mode
+
+fonts.initializers.node.otf.language = otf.features.language
+fonts.initializers.node.otf.script = otf.features.script
+fonts.initializers.node.otf.mode = otf.features.mode
+fonts.initializers.node.otf.method = otf.features.mode
+
+otf.features.register("features",true) -- we always do features
+table.insert(fonts.processors,"features") -- we need a proper function for doing this
+