Hagen - Pragma ADE

Hagen - Pragma ADE Hagen - Pragma ADE

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

82 Features } normalweight = "extralight", boldweight = "semilight" }), ["themix-light"] = table.merged(themix, { normalweight = "light", boldweight = "normal" }), ... ["themixmono-bold"] = table.merged(themixmono, { normalweight = "bold", boldweight = "black" }), }, It’s now time for some generic goodies. In the ConT E Xt distribution there is a goodie file that (at the time of this writing) looks as follows: local default = { analyze = "yes", mode = "node", language = "dflt", script = "dflt", } local smallcaps = { smcp = "yes", } local function statistics(tfmdata) commands.showfontparameters(tfmdata) end local function squeeze(tfmdata) for k, v in next, tfmdata.characters do v.height = 0.75 * (v.height or 0) v.depth = 0.75 * (v.depth or 0) end end return { name = "demo", version = "1.01", comment = "An example of goodies.", author = "Hans Hagen",

} featuresets = { default = { default, }, smallcaps = { default, smallcaps, }, }, colorschemes = { default = { [1] = { "one", "three", "five", "seven", "nine", }, [2] = { "two", "four", "six", "eight", "ten", }, }, all = { [1] = { "*", }, }, some = { [1] = { "0x0030:0x0035", }, }, }, postprocessors = { statistics = statistics, squeeze = squeeze, }, This demo file implements several goodies: featuresets, colors and postprocessors. Keep in mind that a goodie file can provide whatever information it wants but of course only known subtables will be dealt with. The coloring of glyphs can happen by name, which assumes that glyph names are used, or by number. Here we use generic glyph names, but for a specific font one might need to provide a special goodie file. For instance, the color section of the goodie file for the husayni font has entries like: [3] = { "Ttaa.waqf", "SsLY.waqf", "QLY.waqf", "Miim.waqf", "LA.waqf", "Jiim.waqf", "Threedotsabove.waqf", "Siin.waqf", "Ssaad.waqf", "Qaaf.waqf", "SsL.waqf", 83 Features

82<br />

Features<br />

}<br />

normalweight = "extralight",<br />

boldweight = "semilight"<br />

}),<br />

["themix-light"] = table.merged(themix, {<br />

normalweight = "light",<br />

boldweight = "normal"<br />

}),<br />

...<br />

["themixmono-bold"] = table.merged(themixmono, {<br />

normalweight = "bold",<br />

boldweight = "black"<br />

}),<br />

},<br />

It’s now time for some generic goodies. In the ConT E Xt distribution there is a goodie file<br />

that (at the time of this writing) looks as follows:<br />

local default = {<br />

analyze = "yes",<br />

mode = "node",<br />

language = "dflt",<br />

script = "dflt",<br />

}<br />

local smallcaps = {<br />

smcp = "yes",<br />

}<br />

local function statistics(tfmdata)<br />

commands.showfontparameters(tfmdata)<br />

end<br />

local function squeeze(tfmdata)<br />

for k, v in next, tfmdata.characters do<br />

v.height = 0.75 * (v.height or 0)<br />

v.depth = 0.75 * (v.depth or 0)<br />

end<br />

end<br />

return {<br />

name = "demo",<br />

version = "1.01",<br />

comment = "An example of goodies.",<br />

author = "Hans <strong>Hagen</strong>",

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

Saved successfully!

Ooh no, something went wrong!