summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/s-fnt-29.mkiv
blob: 0378550e86a5185ff55e6c5bb1eda8392af115d1 (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
66
67
68
69
70
71
%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 \& \CONTEXT\ Development Team}]
%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

    local fontdata = fonts.hashes.identifiers

    function fonts.tracers.shapes() -- todo: ranges
        local NC, NR = context.NC, context.NR
        local char = context.char
        local chrs = fontdata[font.current()].characters
     -- local desc = fontdata[font.current()].descriptions
        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("name")
                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(desc[k].name)
                    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