Sync-to-go: update copyright for 2015
[s-roff.git] / contrib / hdtbl / examples / fonts_n.in
blob9bbd468cc8831d7cfa89a4323ed9c1d3c587a9fe
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 .\"     ******************************************************************
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=12 border=.1n bc=red csp=.1n cpd=.2n fgc=red4 bgc=beige \
103                hal=c fsz='1.2 1.2' fst=\\*[*$1]
104 .            nr c# 0-1 1
105 .            nr y# 0-1 1
106 .            TR fst=HB fgc=blue
107 .              TD
108 .                nr x# 0-1 1
109 .                \" following 4 `PN's instead of 4 while-loops as in
110 .                \" font_x.roff; short and easy to write, but a little
111 .                \" bit slower.
112 .              PN 10 .TD \
113                  \&..\\\\n+[x#]
114 .              TD
116 .            PN 27 .TR \
117                ".TD fgc=blue fst=HB" \
118                  \\\\n+[y#]. \
119                ".PN 10 .TD \
120                  "".if c \N'\En+[c#]' \
121                    \N'\En[c#]'""" \
122                ".TD fgc=blue fst=HB" \
123                  \\\\n[y#].
125 .            TR fst=HB fgc=blue
126 .              TD
127 .                nr x# 0-1 1
128 .              PN 10 .TD \
129                  \&..\\\\n+[x#]
130 .              TD
131 .          ETB
132 .    ETB
133 .  \}
136 .fontdump all
138 .time
139 .date
141 .\"     466MHz Celeron CPU, 384MB RAM
142 .\"     WindowsXP/cygwin groff18.1:     115s
143 .\"     WindowsXP/cygwin groff19.2:     450s
144 .\"     Suse Linux 9.3 groff19.2:        76s
145 .\" s-tr-mode