summaryrefslogtreecommitdiff
path: root/tex/context/base/font-ini.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/font-ini.lua')
-rw-r--r--tex/context/base/font-ini.lua57
1 files changed, 57 insertions, 0 deletions
diff --git a/tex/context/base/font-ini.lua b/tex/context/base/font-ini.lua
new file mode 100644
index 000000000..68cb49439
--- /dev/null
+++ b/tex/context/base/font-ini.lua
@@ -0,0 +1,57 @@
+if not modules then modules = { } end modules ['font-ini'] = {
+ 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"
+}
+
+--[[ldx--
+<p>Not much is happening here.</p>
+--ldx]]--
+
+-- vtf comes first
+-- fix comes last
+
+fonts = fonts or { }
+
+fonts.mode = 'base'
+
+fonts.methods = {
+ base = { tfm = { }, afm = { }, otf = { }, vtf = { }, fix = { } },
+ node = { tfm = { }, afm = { }, otf = { }, vtf = { }, fix = { } },
+}
+
+fonts.initializers = {
+ base = { tfm = { }, afm = { }, otf = { }, vtf = { }, fix = { } },
+ node = { tfm = { }, afm = { }, otf = { }, vtf = { }, fix = { } }
+}
+
+fonts.triggers = {
+ 'mode',
+ 'language',
+ 'script'
+}
+
+-- tracing
+
+do
+
+ fonts.color = fonts.color or { }
+
+ fonts.color.trace = false
+
+ local attribute = attributes.numbers['color'] or 4 -- we happen to know this -)
+ local mapping = attributes.list[attribute]
+
+ local set_attribute = node.set_attribute
+ local unset_attribute = node.unset_attribute
+
+ function fonts.color.set(n,c)
+ set_attribute(n,attribute,mapping[c] or -1)
+ end
+ function fonts.color.reset(n)
+ unset_attribute(n,attribute)
+ end
+
+end