summaryrefslogtreecommitdiff
path: root/tex/context/base/s-fnt-29.tex
blob: c09a8f85edd9a201b46bb0b3a048a9ad7aecd80c (plain)
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
%D \module
%D   [      file=s-fnt-29,
%D        version=2010.09.27,
%D          title=\CONTEXT\ Style File,
%D       subtitle=Tracing Shapes,
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright=PRAGMA-ADE]
%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 fonts.tracers.shapes() -- todo: ranges
        local NC, NR = context.NC, context.NR
        local chrs = fonts.identifiers[font.current()].characters
        context.starttabulate { "|l|c|c|c|c|l|" }
            context.FL()
                NC() context("unicode")
                NC() context("glyph")
                NC() context("shape")
                NC() context("lower")
                NC() context("upper")
                NC() context("description")
                NC() NR()
            context.TL()
            for k, v in next, characters.data do
                if chrs[k] then
                    NC() context("0x%05X",k)
                    NC() char(k)
                    NC() char(v.shcode)
                    NC() char(v.lccode or k)
                    NC() char(v.uccode or k)
                    NC() context(v.description)
                    NC() NR()
                end
            end
        context.stoptabulate()
    end

\stopluacode

\doifnotmode{demo}{\endinput}

\setupbodyfont[dejavu,tt,9pt]

\setuplayout
  [backspace=1cm,
   topspace=1cm,
   footer=1cm,
   header=0cm,
   height=middle,
   width=middle]

\setupfootertexts
  []
  [\fontname\font\quad\pagenumber]

\starttext

    \ctxlua{fonts.tracers.shapes()}

\stoptext