Hagen - Pragma ADE

Hagen - Pragma ADE Hagen - Pragma ADE

context.aanhet.net
from context.aanhet.net More from this publisher
13.07.2013 Views

92 Features } } ["LMRoman-Bold"] = { ... }, ["LMRoman-Demi"] = { default = "file:lmromandemi10-regular", }, ["LMRoman-Italic"] = { ... }, ... ["LMRoman-Unslanted"] = { default = "file:lmromanunsl10-regular", }, ["LMSans-Regular"] = { ... }, ["LMTypewriter-Regular"] = { ... }, ... ["LMTypewriterVarWd-DarkOblique"] = { default = "file:lmmonoproplt10-boldoblique", }, ... ["LMTypewriter-CapsOblique"] = { default = "file:lmmonocaps10-oblique", }, The auto option will choose a best fit compatible to the MkII implementation. When default is used instead, the default filename will be taken. Of course one might wonder if there will ever be similar goodie files because design sizes are not that popular nowadays. Not all fonts are perfect and of course the LuaT E X engine can have flaws as well. For this reason we can implement patches. Here is another example of a goodie file that has some more code than just a table: local patches = fonts.handlers.otf.enhancers.patches local function patch(data,filename,threshold) local m = data.metadata.math if m then local d = m.DisplayOperatorMinHeight or 0 if d < threshold then

patches.report("DisplayOperatorMinHeight(%s -> %s)",d,threshold) m.DisplayOperatorMinHeight = threshold end end end patches.register("after","analyze math","asana", function(data,filename) patch(data,filename,1350) end) local function less(value,target,original) return 0.25 * value end local function more(value,target,original) local o = original.mathparameters.DisplayOperatorMinHeight if o < 2800 then return 2800 * target.parameters.factor else return value -- already scaled end end return { name = "asana-math", version = "1.00", comment = "Goodies that complement asana.", author = "Hans Hagen", copyright = "ConTeXt development team", mathematics = { parameters = { DisplayOperatorMinHeight = more, StackBottomDisplayStyleShiftDown = less, StackBottomShiftDown = less, StackDisplayStyleGapMin = less, StackGapMin = less, StackTopDisplayStyleShiftUp = less, StackTopShiftUp = less, StretchStackBottomShiftDown = less, StretchStackGapAboveMin = less, StretchStackGapBelowMin = less, StretchStackTopShiftUp = less, } } } 93 Features

92<br />

Features<br />

}<br />

}<br />

["LMRoman-Bold"] = {<br />

...<br />

},<br />

["LMRoman-Demi"] = {<br />

default = "file:lmromandemi10-regular",<br />

},<br />

["LMRoman-Italic"] = {<br />

...<br />

},<br />

...<br />

["LMRoman-Unslanted"] = {<br />

default = "file:lmromanunsl10-regular",<br />

},<br />

["LMSans-Regular"] = {<br />

...<br />

},<br />

["LMTypewriter-Regular"] = {<br />

...<br />

},<br />

...<br />

["LMTypewriterVarWd-DarkOblique"] = {<br />

default = "file:lmmonoproplt10-boldoblique",<br />

},<br />

...<br />

["LMTypewriter-CapsOblique"] = {<br />

default = "file:lmmonocaps10-oblique",<br />

},<br />

The auto option will choose a best fit compatible to the MkII implementation. When<br />

default is used instead, the default filename will be taken. Of course one might wonder<br />

if there will ever be similar goodie files because design sizes are not that popular<br />

nowadays.<br />

Not all fonts are perfect and of course the LuaT E X engine can have flaws as well. For<br />

this reason we can implement patches. Here is another example of a goodie file that has<br />

some more code than just a table:<br />

local patches = fonts.handlers.otf.enhancers.patches<br />

local function patch(data,filename,threshold)<br />

local m = data.metadata.math<br />

if m then<br />

local d = m.DisplayOperatorMinHeight or 0<br />

if d < threshold then

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!