Sync-to-go: contrib/hdtbl..
[s-roff.git] / contrib / hdtbl / examples / fonts_n.in
blobcb31cc45994b8315193ba21c273a2097ed8bc03e
1 .ig
2 @ font_n.in
4 Copyright (c) 2014 - 2015 Steffen (Daode) Nurpmeso <sdaoden@users.sf.net>.
6 Copyright (C) 2005, 2006 Free Software Foundation, Inc.
7 written by Joachim Walsdorff <Joachim.Walsdorff@urz.uni-heidelberg.de>.
9 This is free software; you can redistribute it and/or modify it under
10 the terms of the GNU General Public License as published by the Free
11 Software Foundation; either version 2, or (at your option) any later
12 version.
14 This is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
17 for more details.
19 You should have received a copy of the GNU General Public License
20 along with groff; see the file COPYING.  If not, write to the Free
21 Software Foundation, 51 Franklin St - Fifth Floor, Boston, MA
22 02110-1301, USA.
26 .\"   **    roff glyphs vs. character codes:
27 .\"   ** .fontdump [font1 font2 ...]
28 .\"   **    Print glyphs of font1, font2, ..., versus
29 .\"   **    character code.
30 .\"   **    `all' as fontname prints all fonts in the
31 .\"   **    specified string `fontpath'.
32 .\"   **    without arg: glyphs and codes of active font.
34 .time start
36 .if !d fontpath \
37 .  ds fontpath @FONTDIR@
39 .de fontdump
40 .  ie \\n[.$] \
41 .    ds *args \\$*
42 .  el \
43 .    ds *args \\n[.fn]
45 .  pso sh -c \
46        "echo -n .ds *f\ ; \
47         ls \\*[fontpath]/dev\*[.T] \
48         | tr '[:cntrl:]' ' '"
49 .  \" This dummy line is necessary; the preceding line eats it.
51 .  while !"\\*[*args]"" \{\
52 .    pops *$1 *args
54 .    if "\\*[*$1]"all" \{\
55 .      ds *args \\*[*f] \\*[*args]
56 .      pops *$1 *args
57 .      nr *all 1
58 .    \}
60 .    if \\n[*all] \{\
61 .      if "\\*[*$1]"." \
62 .        nr *all 0
63 .      if !F \\*[*$1] \
64 .        continue
65 .    \}
67 .    t*index "\\*[*f]" \\*[*$1]
69 .    ie (\\n[.y] > 18) \
70 .      if !F \\*[*$1] \{\
71 .        tm \\n[.F]:\\n[.c]: Font \\*[*$1] not found.
72 .        continue
73 .      \}
74 .    el \{\
75 .      if !\\n[t*index] \{\
76 .        tm \\n[.F]:\\n[.c]: Font \\*[*$1] not found.
77 .        continue
78 .      \}
80 .      nr * \\n[.f]
81 .      ft \\*[*$1]
82 .      nr ** \\n[.f]
83 .      ft
85 .      if (\\n[**] == \\n[*]) \
86 .        continue
87 .    \}
89 .    if \\n[t*cptn] \
90 .      bp
92 .    tm listing font `\\*[*$1]'...
94 .    TBL border=.1n bc=red cpd=0 csp=.1n bgc=
95 .      CPTN @L_ROFF@ font \\*[*$1] \
96             .br \
97             val=b ".pso grep internalname \\*[fontpath]/dev\*[.T]/\\*[*$1]"
98 .      TR
99 .        TD
100 .          TBL cols=12 border=.1n bc=red csp=.1n cpd=.2n fgc=red4 bgc=beige \
101                hal=c fsz='1.2 1.2' fst=\\*[*$1]
102 .            nr c# 0-1 1
103 .            nr y# 0-1 1
104 .            TR fst=HB fgc=blue
105 .              TD
106 .                nr x# 0-1 1
107 .                \" following 4 `PN's instead of 4 while-loops as in
108 .                \" font_x.roff; short and easy to write, but a little
109 .                \" bit slower.
110 .              PN 10 .TD \
111                  \&..\\\\n+[x#]
112 .              TD
114 .            PN 27 .TR \
115                ".TD fgc=blue fst=HB" \
116                  \\\\n+[y#]. \
117                ".PN 10 .TD \
118                  "".if c \N'\En+[c#]' \
119                    \N'\En[c#]'""" \
120                ".TD fgc=blue fst=HB" \
121                  \\\\n[y#].
123 .            TR fst=HB fgc=blue
124 .              TD
125 .                nr x# 0-1 1
126 .              PN 10 .TD \
127                  \&..\\\\n+[x#]
128 .              TD
129 .          ETB
130 .    ETB
131 .  \}
134 .fontdump all
136 .time
137 .date
139 .\"   466MHz Celeron CPU, 384MB RAM
140 .\"   WindowsXP/cygwin groff18.1:   115s
141 .\"   WindowsXP/cygwin groff19.2:   450s
142 .\"   Suse Linux 9.3 groff19.2:   76s
143 .\" s-tr-mode