Merge branch 'topic/sync-to-go-2'
[s-roff.git] / font / dev-ps / generate / make-zapfdr
blob3ef70843f00547d527f730b5637e088d84d44057
1 #!/bin/sh
2 #@ make-zapfdr -- script for creating the file zapfdr.ps
3 #@ Synopsis:
4 #@ $ make-zapfdr < ZapfDingbats.afm > zapfdr.ps
6 # Copyright (c) 2014 - 2017 Steffen (Daode) Nurpmeso <steffen@sdaoden.eu>.
8 # Copyright (C) 2006
9 # Free Software Foundation, Inc.
10 # Written by Werner Lemberg <wl@gnu.org>
12 # This is free software; you can redistribute it and/or modify it under
13 # the terms of the GNU General Public License as published by the Free
14 # Software Foundation; either version 2, or (at your option) any later
15 # version.
17 # This is distributed in the hope that it will be useful, but WITHOUT ANY
18 # WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20 # for more details.
22 # You should have received a copy of the GNU General Public License along
23 # with groff; see the file COPYING. If not, write to the Free Software
24 # Foundation, 51 Franklin St - Fifth Floor, Boston, MA 02110-1301, USA.
26 # Write preamble.
27 cat <<END
28 %!PS-Adobe-3.0 Resource-Font
29 %%DocumentNeededResources: Font ZapfDingbats
30 %%EndComments
31 %%IncludeResource: Font ZapfDingbats
33 /ZapfDingbats findfont [-1 0 0 1 0 0] makefont
35 dup length 1 add dict begin
37 exch dup dup /FID ne exch /UniqueID ne and {
38 exch def
39 } {
40 pop pop
41 } ifelse
42 } forall
44 /FontName /ZapfDingbats-Reverse def
45 END
47 # Emit reverse metrics.
48 sed '
49 /^StartCharMetrics/ {
50 s|StartCharMetrics \([0-9]*\)|/Metrics \1 dict dup begin|
55 /^C / {
56 s|^.*$|&@|
57 s|^.* N \([^ ]*\) ;.*$|&/\1 [|
58 s|^.* B [0-9-]* [0-9-]* \([0-9]*\) [0-9-]* ;.*$|&-\1 |
59 s|^.* B [0-9-]* [0-9-]* -\([0-9]*\) [0-9-]* ;.*$|&\1 |
60 s|^.* WX \([0-9]*\) ;.*$|&-\1] def|
61 s|^.* WX -\([0-9]*\) ;.*$|&\1] def|
62 s|^.*@| |
67 $ {
75 # Write postamble.
76 cat <<END
78 end def
80 /ZapfDingbats-Reverse currentdict end definefont pop
81 END
83 # s-sh-mode