Sync-to-go: update copyright for 2015
[s-roff.git] / contrib / hdtbl / examples / fonts_x.in
blob603a7ab4a16961695e8a00ea1fcd4f7be209affe
1 .ig
2 @ font_x.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 .\"     ******************************************************************
27 .\"     **              groff glyphs vs. character codes:               **
28 .\"     **      .fontdump [font1 font2 ...]                             **
29 .\"     **              Print glyphs of font1, font2, ..., versus       **
30 .\"     **              character code.                                 **
31 .\"     **              `all' as fontname prints all fonts in the       **
32 .\"     **              specified string `fontpath'.                    **
33 .\"     **              without arg: glyphs and codes of active font.   **
34 .\"     ******************************************************************
36 .time start
38 .if !d fontpath \
39 .  ds fontpath @FONTDIR@
41 .de fontdump
42 .  ie \\n[.$] \
43 .    ds *args \\$*
44 .  el \
45 .    ds *args \\n[.fn]
47 .  pso bash -c \
48        "echo -n .ds *f\ ; \
49         ls \\*[fontpath]/dev\*[.T] \
50         | tr '[:cntrl:]' ' '"
51 .  \"   This dummy line is necessary; the preceding line eats it.
53 .  while !"\\*[*args]"" \{\
54 .    pops *$1 *args
56 .    if "\\*[*$1]"all" \{\
57 .      ds *args \\*[*f] \\*[*args]
58 .      pops *$1 *args
59 .      nr *all 1
60 .    \}
62 .    if \\n[*all] \{\
63 .      if "\\*[*$1]"." \
64 .        nr *all 0
65 .      if !F \\*[*$1] \
66 .        continue
67 .    \}
69 .    index "\\*[*f]" \\*[*$1]
71 .    ie (\\n[.y] > 18) \
72 .      if !F \\*[*$1] \{\
73 .        tm \\n[.F]:\\n[.c]: Font \\*[*$1] not found.
74 .        continue
75 .      \}
76 .    el \{\
77 .      if !\\n[index] \{\
78 .        tm \\n[.F]:\\n[.c]: Font \\*[*$1] not found.
79 .        continue
80 .      \}
82 .      nr * \\n[.f]
83 .      ft \\*[*$1]
84 .      nr ** \\n[.f]
85 .      ft
87 .      if (\\n[**] == \\n[*]) \
88 .        continue
89 .    \}
91 .    if \\n[t*cptn] \
92 .      bp
94 .    tm listing font `\\*[*$1]'...
96 .    TBL border=.1n bc=red cpd=0 csp=.1n bgc=
97 .      CPTN @L_ROFF@ font \\*[*$1] \
98             .br \
99             val=b ".pso grep -e internalname \\*[fontpath]/dev\*[.T]/\\*[*$1]"
100 .      TR
101 .        TD
102 .          TBL cols=18 border=.1n bc=red csp=.1n cpd=.2n fgc=red4 bgc=beige \
103                hal=c fsz='1.2 1.7' fst=\\*[*$1]
104 .            nr c# 0-1 1
105 .            nr y# 0 1
106 .            TR fst=HB fgc=blue
107 .              TD
108 .              nr x# 0-1 1
109 .              while (\\n+[x#] < 16) \{\
110 .                d2x \\n[x#]
111 .                  TD
112 .                    nop \&.\\*[hex#]
113 .              \}
114 .              TD
116 .            nr y# -1
117 .            while (\\n+[y#] < 17) \{\
118 .              TR
119 .                TD fgc=blue fst=HB
120 .                d2x \\n[y#]
121 .                  nop \\*[hex#].
122 .                nr x# 0-1 1
123 .                while (\\n+[x#] < 16) \{\
124 .                  TD
125 .                    if c \N'\\n+[c#]' \
126 .                      nop \N'\\n[c#]'
127 .                \}
128 .                TD fgc=blue fst=HB
129 .                d2x \\n[y#]
130 .                  nop \\*[hex#].
131 .            \}
133 .            TR fst=HB fgc=blue
134 .              TD
135 .              nr x# 0-1 1
136 .              while (\\n+[x#] < 16) \{\
137 .                d2x \\n[x#]
138 .                TD
139 .                  nop \&..\\*[hex#]
140 .              \}
141 .              TD
142 .          ETB
143 .    ETB
144 .  \}
147 .fontdump all
149 .time
150 .date
151 .\"     466MHz Celeron CPU, 384MB RAM
152 .\"     WindowsXP/cygwin groff18.1:     107s
153 .\"     WindowsXP/cygwin groff19.2:     390s
154 .\"     Suse Linux 9.3 groff19.2:        66s
155 .\" s-tr-mode