1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
%D \module
%D [ file=s-fnt-26,
%D version=2009.10.26,
%D title=\CONTEXT\ Style File,
%D subtitle=Goodies Tables,
%D author=Hans Hagen,
%D date=\currentdate,
%D copyright=PRAGMA]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
\startluacode
function document.show_goodies_stylistics(name)
local goodies = fonts.goodies.get(name)
local stylistics = goodies and goodies.stylistics
if stylistics then
local col, row, type = context.NC, context.NR, context.type
context.starttabulate { "|l|pl|" }
col() context("feature") col() context("meaning") col() row()
for feature, meaning in table.sortedpairs(stylistics) do
col() type(feature) col() type(meaning) col() row()
end
context.stoptabulate()
end
end
function document.show_goodies_featuresets(name)
local goodies = fonts.goodies.get(name)
local featuresets = goodies and goodies.featuresets
if featuresets then
local col, row, type = context.NC, context.NR, context.type
context.starttabulate { "|l|pl|" }
col() context("featureset") col() context("definitions") col() row()
for featureset, definitions in table.sortedpairs(featuresets) do
col() type(featureset) col()
for k, v in table.sortedpairs(definitions) do
type(string.format("%s=%s",k,tostring(v)))
context.quad()
end
col() row()
end
context.stoptabulate()
end
end
function document.show_goodies_colorschemes(name)
local goodies = fonts.goodies.get(name)
local colorschemes = goodies and goodies.colorschemes
if colorschemes then
local col, row, type = context.NC, context.NR, context.type
context.starttabulate { "|l|pl|" }
col() context("colorscheme") col() context("numbers") col() row()
for colorscheme, numbers in table.sortedpairs(colorschemes) do
col() type(colorscheme) col()
for i=1,#numbers do
type(i)
context.quad()
end
col() row()
end
context.stoptabulate()
end
\stopluacode
\def\showgoodiesstylistics #1{\ctxlua{document.show_goodies_stylistics ("#1")}}
\def\showgoodiesfeaturesets #1{\ctxlua{document.show_goodies_featuresets ("#1")}}
\def\showgoodiescolorschemes#1{\ctxlua{document.show_goodies_colorschemes("#1")}}
\endinput
|