diff options
author | Marius <mariausol@gmail.com> | 2012-02-08 23:00:23 +0200 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2012-02-08 23:00:23 +0200 |
commit | 7b47df8cbaae8690f14d306c633b2b2db053f66a (patch) | |
tree | a4cb6a0ebb8ac21a14558c258949d3c7da33dd25 /tex/context/base/font-gds.lua | |
parent | 5fce2a5267a603c8caf76880cdfb839d77ec64f0 (diff) | |
download | context-7b47df8cbaae8690f14d306c633b2b2db053f66a.tar.gz |
beta 2012.02.08 21:04
Diffstat (limited to 'tex/context/base/font-gds.lua')
-rw-r--r-- | tex/context/base/font-gds.lua | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/tex/context/base/font-gds.lua b/tex/context/base/font-gds.lua index 03eb20705..97e97a640 100644 --- a/tex/context/base/font-gds.lua +++ b/tex/context/base/font-gds.lua @@ -104,6 +104,9 @@ local function setgoodies(tfmdata,value) -- we need to check for duplicates local ok = loadgoodies(filename) if ok then + if trace_goodies then + report_goodies("assigning goodie '%s'",filename) + end goodies[#goodies+1] = ok end end @@ -472,6 +475,7 @@ local function initialize(tfmdata) -- As we want to set italic_correction (the context one) we need a -- postprocessor instead of messing with the (unscaled) descriptions. fontgoodies.registerpostprocessor(tfmdata, function(tfmdata) -- this is another tfmdata (a copy) + -- better make a helper so that we have less code being defined local properties = tfmdata.properties local parameters = tfmdata.parameters local characters = tfmdata.characters @@ -581,7 +585,7 @@ fontgoodies.designsizes = designsizes local designdata = allocate() designsizes.data = designdata -local function initialize(goodies) +local function initialize(goodies) -- design sizes are registered global local gd = goodies.designsizes if gd then for name, data in next, gd do @@ -622,21 +626,26 @@ function fontgoodies.designsizes.register(name,size,specification) end end -function fontgoodies.designsizes.filename(name,size) - local data = designdata[lower(name)] - if data then - local ranges = data.ranges - if ranges and size ~= "default" then - for i=1,#ranges do - local r = ranges[i] - if r[1] >= size then -- todo: rounding so maybe size - 100 - return r[2] +function fontgoodies.designsizes.filename(name,spec,size) -- returns nil of no match + if spec and spec ~= "" then + local data = designdata[lower(name)] + if data then + if spec == "default" then + return data.default + elseif spec == "auto" then + local ranges = data.ranges + if ranges then + for i=1,#ranges do + local r = ranges[i] + if r[1] >= size then -- todo: rounding so maybe size - 100 + return r[2] + end + end end + return data.default or (ranges and ranges[#ranges][2]) end end - return data.default or (ranges and ranges[#ranges][2]) or name end - return name end -- The following file (husayni.lfg) is the experimental setup that we used |