summaryrefslogtreecommitdiff
path: root/fonts/utilities/fontload/unix/INSTALL
blob: bbc444d6bd2d7b931d6ea9ff4df30cea36fe3d3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#!/bin/csh
# Install
# This C-shell will help to install fload tool,
# which realizes Partial Downloading of the ATM compatible Type 1 fonts
# for some PostScript file.
###############################################################################
if ( ! -e INSTALL ) then 
   echo Installation available only from directory with install script.
   exit
endif
if ( -e install.dirs ) then 
   source install.dirs
else
   # Directory to put system dependent executable files (subfont program)
   setenv FBIN /usr/local/bin
   # Directory to put system independent scripts (fload C-shell script)
   setenv FSHR /usr/local/bin
   # Directory for library files (Fontmap, psfstat.ps, SubFont.map, *.FS)
   setenv FLIB /usr/local/lib/fload
   # Also Check that all your fonta are in list directory tries
   setenv FPATH /usr/local/lib/texmf/fonts
endif
##############################################################################
echo Check environment ...
set gsbin=`which gs`
if ( ! -e "$gsbin" ) then
  echo Can not found GhostScript program in path $path
  exit
endif

echo Making subfont program first ...
pushd ../src 
make
popd
if ( ! -e ../src/subfont ) then 
   echo Make failed.
   exit 1
endif
echo Copying SubFont program to $FBIN/subfont
cp ../src/subfont $FBIN/subfont
if ( ! -e $FBIN/subfont ) then
   echo Can not copying SubFont program to $FBIN directory.
   exit
endif
chmod +x $FBIN/subfont

############## Copying man pages if FMAN environment is on ###################
if ( $?FMAN ) then 
   echo Copying man pages subfont.1 and fload.1 into $FMAN directory ...
   cp ../doc/fload.1 $FMAN
   cp ../doc/subfont.1 $FMAN
endif

############## Making fload C-shell script ###################################

set out=$FSHR/fload
echo Create $out C-shell script. 
echo "#\!/bin/csh" >$out
if ( ! -e $FSHR/fload ) then
   echo Can not write fload C-shell script into $FSHR directory.
   exit
endif
echo "# Copyright (C) 1994, Basil K. Malyshev. All rights reserved." >>$out
echo "# WARNING this script was created automatically." >>$out
echo "set lib=$FLIB" >>$out
echo "setenv FONTPATH $FPATH" >>$out
cat <fload.csh >>$out
chmod +x $out

############## Create files in library directory #############################

if ( ! -e $FLIB ) then
   mkdir -p $FLIB
else
   if ( -e $FLIB/Fontmap ) then
      rm -f $FLIB/Fontmap
   endif
endif
echo Copying psfstat.ps PostScript script to $FLIB/psfstat.ps
cp ../lib/psfstat.ps $FLIB/psfstat.ps
if ( ! -e $FLIB/psfstat.ps ) then
   echo Can not copying psfstat.ps PostScript script to $FLIB directory.
   exit
endif
echo "Copying files ../lib/*.FS to $FLIB directory."
cp ../lib/*.FS $FLIB

#### Create standard head of the Fontmap file for GhostScript.
### $gsbin -DNODISPLAY -sOUT=$FLIB/Fontmap ../lib/Fontmap.get
### echo "(Fontmap.t1) run" >>$FLIB/Fontmap

#### Scan all font directories and add records to Fontmap & SubFont.map ####
# Split FPATH variable into elements 
set pathSave=($path)
setenv PATH $FPATH
set fpath=($path)
set path=($pathSave)
# Now go throght all font directories
setenv SUBFONT $FBIN/subfont
echo >$FLIB/Fontmap.t1
foreach root ($fpath)
   echo "Scanning $root directory..."
   echo "%% This part was constructed from $root directory" >>$FLIB/Fontmap.t1
   pushd root
   find . -name "*.pf[ab]" -exec $SUBFONT -z$FLIB/Fontmap.t1 {} \;
   popd
end

### # And creates map for SubFont program
### $gsbin -DNODISPLAY -sINFILE=$FLIB/Fontmap.t1 -sOUTFILE=$FLIB/SubFont.map \
###   ../lib/cvtmap.ps quit.ps 

echo "=================================================="
echo "== Installation have been completed.            =="
echo "== Now you can use command:                     =="
echo "==   fload PS-without-fonts >PS-with-fonts      =="
echo "== to preload fonts partially into your PS-file =="
echo "=================================================="

#### End of installation script ####