summaryrefslogtreecommitdiff
path: root/tex/context/base/font-ext.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/font-ext.lua')
-rw-r--r--tex/context/base/font-ext.lua38
1 files changed, 21 insertions, 17 deletions
diff --git a/tex/context/base/font-ext.lua b/tex/context/base/font-ext.lua
index 331ffbdfa..560cf23ee 100644
--- a/tex/context/base/font-ext.lua
+++ b/tex/context/base/font-ext.lua
@@ -10,7 +10,9 @@ local utf = unicode.utf8
local next, type, byte = next, type, string.byte
local gmatch, concat, format = string.gmatch, table.concat, string.format
local utfchar = utf.char
-local getparameters = utilities.parsers.getparameters
+
+local commands, context = commands, context
+local fonts, utilities = fonts, utilities
local trace_protrusion = false trackers.register("fonts.protrusion", function(v) trace_protrusion = v end)
local trace_expansion = false trackers.register("fonts.expansion", function(v) trace_expansion = v end)
@@ -26,17 +28,18 @@ will depend of the font format. Here we define the few that are kind
of neutral.</p>
--ldx]]--
-local fonts = fonts
-local fontdata = fonts.hashes.identifiers
+local handlers = fonts.handlers
+local hashes = fonts.hashes
-local otffeatures = fonts.constructors.newfeatures("otf")
-local registerotffeature = otffeatures.register
+local registerotffeature = handlers.otf.features.register
+local registerafmfeature = handlers.afm.features.register
-local afmfeatures = fonts.constructors.newfeatures("afm")
-local registerafmfeature = afmfeatures.register
+local fontdata = hashes.identifiers
local allocate = utilities.storage.allocate
local settings_to_array = utilities.parsers.settings_to_array
+local getparameters = utilities.parsers.getparameters
+
local setmetatableindex = table.setmetatableindex
-- -- -- -- -- --
@@ -62,14 +65,15 @@ end
-- expansion (hz)
-- -- -- -- -- --
-fonts.expansions = allocate()
-local expansions = fonts.expansions
+local expansions = fonts.expansions or allocate()
-expansions.classes = allocate()
-local classes = expansions.classes
+fonts.expansions = expansions
-expansions.vectors = allocate()
-local vectors = expansions.vectors
+local classes = expansions.classes or allocate()
+local vectors = expansions.vectors or allocate()
+
+expansions.classes = classes
+expansions.vectors = vectors
-- beware, pdftex itself uses percentages * 10
@@ -880,8 +884,8 @@ local new_glyph = nodes.pool.glyph
local hpack_node = node.hpack
function fonts.helpers.addprivate(tfmdata,name,characterdata)
- local properties = tfmdata.properties
- local privates = properties.privates
+ local properties = tfmdata.properties
+ local privates = properties.privates
local lastprivate = properties.lastprivate
if lastprivate then
lastprivate = lastprivate + 1
@@ -903,7 +907,7 @@ end
function fonts.helpers.getprivatenode(tfmdata,name)
local properties = tfmdata.properties
- local privates = properties and properties.privates
+ local privates = properties and properties.privates
if privates then
local p = privates[name]
if p then
@@ -925,7 +929,7 @@ end
function fonts.helpers.hasprivate(tfmdata,name)
local properties = tfmdata.properties
- local privates = properties and properties.privates
+ local privates = properties and properties.privates
return privates and privates[name] or false
end