summaryrefslogtreecommitdiff
path: root/otfl-font-dum.lua
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2010-10-28 20:59:32 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2010-11-03 03:52:07 +0200
commitf089d7c2866791b5b48c07fe6a6c001727ca50c1 (patch)
tree12f96bc60d89f21d627c8a0c4c109853d073acc1 /otfl-font-dum.lua
parent808e70bd7ccff7c25c4e1979bf9eec204ed8cb3c (diff)
downloadluaotfload-f089d7c2866791b5b48c07fe6a6c001727ca50c1.tar.gz
Now `make check-all` runs successfully again
Diffstat (limited to 'otfl-font-dum.lua')
-rw-r--r--otfl-font-dum.lua26
1 files changed, 21 insertions, 5 deletions
diff --git a/otfl-font-dum.lua b/otfl-font-dum.lua
index e8237cc..1577b71 100644
--- a/otfl-font-dum.lua
+++ b/otfl-font-dum.lua
@@ -188,7 +188,23 @@ local setups = fonts.protrusions.setups
--
-- \definefontfeature[whocares][default][mode=node,protrusion=2,opbd=yes,script=latn,featurefile=texgyrepagella-regularxx.fea]
-classes['double'] = { -- for testing opbd
+local function get_class_and_vector(tfmdata,value,where) -- "expansions"
+ local g_where = tfmdata.goodies and tfmdata.goodies[where]
+ local f_where = fonts[where]
+ local g_classes = g_where and g_where.classes
+ local f_classes = f_where and f_where.classes
+ local class = (g_classes and g_classes[value]) or (f_classes and f_classes[value])
+--~ print(value,class,f_where,f_classes)
+ if class then
+ local class_vector = class.vector
+ local g_vectors = g_where and g_where.vectors
+ local f_vectors = f_where and f_where.vectors
+ local vector = (g_vectors and g_vectors[class_vector]) or (f_vectors and f_vectors[class_vector])
+ return class, vector
+ end
+end
+
+setups['double'] = { -- for testing opbd
factor = 2, left = 1, right = 1,
}
@@ -198,7 +214,7 @@ local function map_opbd_onto_protrusion(tfmdata,value,opbd)
local singles = otfdata.shared.featuredata.gpos_single
local script, language = tfmdata.script, tfmdata.language
local done, factor, left, right = false, 1, 1, 1
- local class = classes[value]
+ local class = setups[value]
if class then
factor = class.factor or 1
left = class.left or 1
@@ -207,7 +223,7 @@ local function map_opbd_onto_protrusion(tfmdata,value,opbd)
factor = tonumber(value) or 1
end
if opbd ~= "right" then
- local validlookups, lookuplist = otf.collectlookups(otfdata,"lfbd",script,language)
+ local validlookups, lookuplist = fonts.otf.collectlookups(otfdata,"lfbd",script,language)
if validlookups then
for i=1,#lookuplist do
local lookup = lookuplist[i]
@@ -230,7 +246,7 @@ local function map_opbd_onto_protrusion(tfmdata,value,opbd)
end
end
if opbd ~= "left" then
- local validlookups, lookuplist = otf.collectlookups(otfdata,"rtbd",script,language)
+ local validlookups, lookuplist = fonts.otf.collectlookups(otfdata,"rtbd",script,language)
if validlookups then
for i=1,#lookuplist do
local lookup = lookuplist[i]
@@ -260,7 +276,7 @@ end
-- only has some kerns for digits. So, consider this feature not
-- supported till we have a proper test font.
-function initializers.common.protrusion(tfmdata,value)
+function fonts.initializers.common.protrusion(tfmdata,value)
if value then
local opbd = tfmdata.shared.features.opbd
if opbd then