Debian Codegraph @

contrib/hdtbl/examples/fonts_x.in

raw
1 .ig
2 Copyright 2006 Free Software Foundation, Inc.
3
4 Written by Joachim Walsdorff <[email protected]>
5
6 This file is part of hdtbl.
7
8 hdtbl is distributed with groff, the GNU roff typesetting system.
9
10 groff is free software; you can redistribute it and/or modify it under
11 the terms of the GNU General Public License as published by the Free
12 Software Foundation, either version 3 of the License, or
13 (at your option) any later version.
14
15 groff is distributed in the hope that it will be useful, but WITHOUT
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program. If not, see <http://www.gnu.org/licenses/>.
22 ..
23 .
24 .
25 .\" ******************************************************************
26 .\" ** groff 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. **
33 .\" ******************************************************************
34 .
35 .ds fonts_x fonts_x.roff\" name for diagnostic messages
36 .
37 .if !d sopath \
38 . ds sopath
39 .
40 .ds lib examples/common.roff
41 .soquiet \*[sopath]\*[lib]
42 .if !d common \{\
43 . tmc \n[.F]: cannot find "\*[lib]"; specify its location
44 . tm1 " with groff '-I' or '-d sopath=' option
45 . ab
46 .\}
47 .
48 .
49 .if !d fontpath \
50 . ds fontpath @fontdir@
51 .
52 .if !\n[.U] \{\
53 . tmc \*[fonts_n]: document requires unsafe mode;
54 . tm1 " use groff's '-U' option
55 . ab
56 .\}
57 .
58 .de fontdump
59 . ie \\n[.$] \
60 . ds *args \\$*
61 . el \
62 . ds *args \\n[.fn]
63 .
64 .\" Solaris 10 `tr` barfs if POSIX character classes are used in a
65 .\" locale other than "C".
66 . pso sh -c \
67 "printf '%s' '.ds *f ' ; \
68 ls \\*[fontpath]/dev\*[.T] \
69 | env LC_ALL=C tr '[:cntrl:]' '[ *]'; \
70 echo"
71 .
72 . while !"\\*[*args]"" \{\
73 . pops *$1 *args
74 .
75 . if "\\*[*$1]"all" \{\
76 . ds *args \\*[*f] \\*[*args]
77 . pops *$1 *args
78 . nr *all 1
79 . \}
80 .
81 . if \\n[*all] \{\
82 . if "\\*[*$1]"." \
83 . nr *all 0
84 . if !F \\*[*$1] \
85 . continue
86 . \}
87 .
88 . t*index "\\*[*f]" \\*[*$1]
89 .
90 . ie (\\n[.y] > 18) \
91 . if !F \\*[*$1] \{\
92 . tm \\*[fonts_x]: \\n[.F]:\\n[.c]: Font \\*[*$1] not found.
93 . continue
94 . \}
95 . el \{\
96 . if !\\n[t*index] \{\
97 . tm \\*[fonts_x]: \\n[.F]:\\n[.c]: Font \\*[*$1] not found.
98 . continue
99 . \}
100 .
101 . nr * \\n[.f]
102 . ft \\*[*$1]
103 . nr ** \\n[.f]
104 . ft
105 .
106 . if (\\n[**] == \\n[*]) \
107 . continue
108 . \}
109 .
110 . if \\n[t*cptn] \
111 . bp
112 .
113 . tm \\*[fonts_x]: listing font '\\*[*$1]'...
114 .
115 . TBL border=.1n bc=red cpd=0 csp=.1n bgc=
116 . CPTN groff font name \\*[*$1]; \
117 .br \
118 val=b ".pso @EGREP@ internalname \\*[fontpath]/dev\*[.T]/\\*[*$1]" \
119 .br \
120 Grid is blank if font is not installed.
121 . TR
122 . TD
123 . TBL cols=18 border=.1n bc=red csp=.1n cpd=.2n fgc=red4 bgc=beige \
124 hal=c fsz='1.2 1.7' fst=\\*[*$1]
125 . nr c# 0-1 1
126 . nr y# 0 1
127 . TR fst=HB fgc=blue
128 . TD
129 . nr x# 0-1 1
130 . while (\\n+[x#] < 16) \{\
131 . d2x \\n[x#]
132 . TD
133 . nop \&.\\*[hex#]
134 . \}
135 . TD
136 .
137 . nr y# -1
138 . while (\\n+[y#] < 17) \{\
139 . TR
140 . TD fgc=blue fst=HB
141 . d2x \\n[y#]
142 . nop \\*[hex#].
143 . nr x# 0-1 1
144 . while (\\n+[x#] < 16) \{\
145 . TD
146 . if c \N'\\n+[c#]' \
147 . nop \N'\\n[c#]'
148 . \}
149 . TD fgc=blue fst=HB
150 . d2x \\n[y#]
151 . nop \\*[hex#].
152 . \}
153 .
154 . TR fst=HB fgc=blue
155 . TD
156 . nr x# 0-1 1
157 . while (\\n+[x#] < 16) \{\
158 . d2x \\n[x#]
159 . TD
160 . nop \&..\\*[hex#]
161 . \}
162 . TD
163 . ETB
164 . ETB
165 . \}
166 ..
167 .
168 .tm \*[fonts_x]: listing fonts in \*[fontpath]/dev\*[.T]
169 .fontdump all
170 .
171 .\" Local Variables:
172 .\" mode: nroff
173 .\" fill-column: 72
174 .\" End:
175 .\" vim: set filetype=groff textwidth=72: