summaryrefslogtreecommitdiff
path: root/tex/context/base/font-gds.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2011-04-11 18:00:19 +0300
committerMarius <mariausol@gmail.com>2011-04-11 18:00:19 +0300
commitdbbbbfac3d158709a07af8c26e68284d1b0ea202 (patch)
treeb9cb25022fc2858c0dcbc190ad466ba89c69861d /tex/context/base/font-gds.lua
parent7c7fe9c9e18355f42d0dba1b248235252728060b (diff)
downloadcontext-dbbbbfac3d158709a07af8c26e68284d1b0ea202.tar.gz
beta 2011.04.11 16:45
Diffstat (limited to 'tex/context/base/font-gds.lua')
-rw-r--r--tex/context/base/font-gds.lua73
1 files changed, 55 insertions, 18 deletions
diff --git a/tex/context/base/font-gds.lua b/tex/context/base/font-gds.lua
index 556f093d4..a5c60d252 100644
--- a/tex/context/base/font-gds.lua
+++ b/tex/context/base/font-gds.lua
@@ -9,7 +9,7 @@ if not modules then modules = { } end modules ['font-gds'] = {
-- depends on ctx
local type, next = type, next
-local gmatch = string.gmatch
+local gmatch, format = string.gmatch, string.format
local fonts, nodes, attributes, node = fonts, nodes, attributes, node
@@ -18,6 +18,9 @@ local report_fonts = logs.reporter("fonts","goodies")
local allocate = utilities.storage.allocate
+local otf = fonts.handlers.otf
+local addotffeature = otf.enhancers.addfeature
+
local otffeatures = fonts.constructors.newfeatures("otf")
local registerotffeature = otffeatures.register
@@ -305,6 +308,25 @@ function colorschemes.enable()
function colorschemes.enable() end
end
+local function setextrafeatures(tfmdata)
+ local goodies = tfmdata.goodies
+ if goodies then
+ for i=1,#goodies do
+ local g = goodies[i]
+ local f = g.features
+ if f then
+ for feature, specification in next, f do
+ addotffeature(tfmdata.shared.rawdata,feature,specification)
+ registerotffeature {
+ name = feature,
+ description = format("extra: %s",feature)
+ }
+ end
+ end
+ end
+ end
+end
+
-- installation (collected to keep the overview) -- also for type 1
registerotffeature {
@@ -317,23 +339,14 @@ registerotffeature {
}
}
-registerafmfeature {
- name = "goodies",
- description = "goodies on top of built in features",
- initializers = {
- position = 1,
- base = setgoodies,
- node = setgoodies,
- }
-}
-
-registertfmfeature {
- name = "goodies",
- description = "goodies on top of built in features",
+registerotffeature {
+ name = "extrafeatures",
+ description = "extra features",
+ default = true,
initializers = {
- position = 1,
- base = setgoodies,
- node = setgoodies,
+ position = 2,
+ base = setextrafeatures,
+ node = setextrafeatures,
}
}
@@ -341,7 +354,7 @@ registerotffeature {
name = "featureset",
description = "goodie feature set",
initializers = {
- position = 2,
+ position = 3,
base = setfeatureset,
node = setfeatureset,
}
@@ -365,6 +378,30 @@ registerotffeature {
}
}
+-- afm
+
+registerafmfeature {
+ name = "goodies",
+ description = "goodies on top of built in features",
+ initializers = {
+ position = 1,
+ base = setgoodies,
+ node = setgoodies,
+ }
+}
+
+-- tfm
+
+registertfmfeature {
+ name = "goodies",
+ description = "goodies on top of built in features",
+ initializers = {
+ position = 1,
+ base = setgoodies,
+ node = setgoodies,
+ }
+}
+
-- experiment, we have to load the definitions immediately as they precede
-- the definition so they need to be initialized in the typescript