diff options
author | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2019-09-02 13:46:59 +0900 |
commit | e0c6872cf40896c7be36b11dcc744620f10adf1d (patch) | |
tree | 60335e10d2f4354b0674ec22d7b53f0f8abee672 /fonts/utilities/fontload/unix |
Initial commit
Diffstat (limited to 'fonts/utilities/fontload/unix')
-rw-r--r-- | fonts/utilities/fontload/unix/INSTALL | 120 | ||||
-rw-r--r-- | fonts/utilities/fontload/unix/UpdateMap.csh | 35 | ||||
-rw-r--r-- | fonts/utilities/fontload/unix/fload.csh | 140 | ||||
-rw-r--r-- | fonts/utilities/fontload/unix/home.dirs | 15 | ||||
-rw-r--r-- | fonts/utilities/fontload/unix/install.dirs | 18 | ||||
-rw-r--r-- | fonts/utilities/fontload/unix/install.txt | 5 | ||||
-rw-r--r-- | fonts/utilities/fontload/unix/mkmap | 34 | ||||
-rw-r--r-- | fonts/utilities/fontload/unix/ppd2fs | 13 | ||||
-rw-r--r-- | fonts/utilities/fontload/unix/usr-local.dirs | 15 |
9 files changed, 395 insertions, 0 deletions
diff --git a/fonts/utilities/fontload/unix/INSTALL b/fonts/utilities/fontload/unix/INSTALL new file mode 100644 index 0000000000..bbc444d6bd --- /dev/null +++ b/fonts/utilities/fontload/unix/INSTALL @@ -0,0 +1,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 #### diff --git a/fonts/utilities/fontload/unix/UpdateMap.csh b/fonts/utilities/fontload/unix/UpdateMap.csh new file mode 100644 index 0000000000..6e9adfd611 --- /dev/null +++ b/fonts/utilities/fontload/unix/UpdateMap.csh @@ -0,0 +1,35 @@ +#!/bin/csh +# Copyright (C) 1994, Basil K. Malyshev. All rights reserved. +# WARNING this script was created automatically. +set lib=/usr/local/lib/fload +setenv FONTPATH /usr/local/lib/texmf/fonts:/usr/local/lib/ISOFonts/pfa +#! +#! File: UpdateMap.csh +#! This C shell script updates font map which is used by FLoad script. +#! +#! Copyright (C) 1994, Basil K. Malyshev. All rights reserved. +#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +setenv SUBFONT "`which subfont`" +if ( ! -e "$SUBFONT" ) then + echo Can not found SubFont program in path $path + exit +endif + +#### Scan all font directories and add records to Fontmap.t1 +# Split FPATH variable into elements +set pathSave=($path) +setenv PATH $FONTPATH +set fpath=($path) +set path=($pathSave) +# Now go throght all font directories +echo >$lib/Fontmap.t1 +foreach root ($fpath) + echo "Scanning $root directory..." + echo "%% This part was constructed from $root directory" >>$lib/Fontmap.t1 + pushd root + find . -name "*.pf[ab]" -exec $SUBFONT -z$lib/Fontmap.t1 {} \; + popd +end +### + diff --git a/fonts/utilities/fontload/unix/fload.csh b/fonts/utilities/fontload/unix/fload.csh new file mode 100644 index 0000000000..92f670ef84 --- /dev/null +++ b/fonts/utilities/fontload/unix/fload.csh @@ -0,0 +1,140 @@ +#! +#! File: FLoad.csh +#! This C shell script implements partial downloading +#! of the ATM compatible PostScript Type 1 fonts which +#! is used in specified PostScript file. +#! This procedure is done via GhostScript & SubFont programs. +#! +#! Copyright (C) 1994, Basil K. Malyshev. All rights reserved. +#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +set FontMap=$lib/Fontmap.t1 + +# User can place in HOME directory file '.fload' +# which can contains redefinition of the FONTPATH, like +# setenv FONTPATH $FONTPATH:$HOME/psfonts +# and FontMap, like: +# set FontMap=$HOME/Fontmap.t1 +# Also, user can redefine `lib` variable, +# but in this case, also redefinion of the 'FontMap` variable is required. +# +if ( -e ~/.fload ) then + source ~/.fload +endif + +# Check of the existance GhostScript (gs) and SubFont (subfont) programs. +if ( ! -e "`which gs`" ) then + echo "? FLoad: I can not work without GhostScript." | /bin/sh -c "cat 1>&2" + exit +endif +if ( ! -e "`which subfont`" ) then + echo "? FLoad: I can not work without subfont program." | /bin/sh -c "cat 1>&2" + exit +endif + +# Update map if specified option '-updatemap' +if ( "$1" == "-updatemap" ) then + # Split FONTPATH variable into elements + set pathSave=($path) + setenv PATH $FONTPATH + set fpath=($path) + set path=($pathSave) + # Now go throght all font directories + echo >$FontMap + foreach root ($fpath) + echo "Scanning $root directory..." + echo "%% This part was constructed from $root directory" >>$FontMap + pushd root + find . -name "*.pf[ab]" -exec subfont -z$FontMap {} \; + popd + end + exit +endif + +# Which font set is in printer +if ( "$1" == "-p" || "$1" == "-P" ) then + if ( "$2" == "" ) then + echo "List of available font sets:" | /bin/sh -c "cat 1>&2" + cd $lib + ls *.FS | sed -e s/.FS// | /bin/sh -c "cat 1>&2" + exit + endif + set fontSet="$2" + shift + shift +else + set fontSet="Standard" +endif + +if ( ! -e $lib/$fontSet.FS ) then + echo "? $fontSet font set is not known." | /bin/sh -c "cat 1>&2" + exit +endif + +set fn=$1 +set out=$2 + +if ( "$out" == "" ) then + set base=$fn:r +else + set base=$out:r + if ( "$out" == "$out:r" ) then + set out=$out.ps + endif +endif + +# If input file name is not presented show usage and list of built in fonts. +if ( "$fn" == "" ) then + echo "Usage: (of the fload de Basil)" | /bin/sh -c "cat 1>&2" + echo "fload [-p fontSet] <ps-file> [<output-ps-file>]" | /bin/sh -c "cat 1>&2" + echo " where following fontSets is available" | /bin/sh -c "cat 1>&2" + cd $lib + ls *.FS | sed -e s/.FS// | /bin/sh -c "cat 1>&2" + exit +endif +if ( ! -e $fn ) then + echo "? FLoad: I can not found file $fn." | /bin/sh -c "cat 1>&2" + exit +endif + +# Interpret file via Ghostscript to determine required fonts and characters. +set fstat=$base.fstat +echo "Process PS file $fn." | /bin/sh -c "cat 1>&2" +echo "Write font using statistic to $fstat" | /bin/sh -c "cat 1>&2" +if ( -e $fstat ) then + /bin/rm -f $fstat +endif +gs -I${lib}:$FONTPATH -DNODISPLAY -DWRITESYSTEMDICT \ + -sOUTFILE=$fstat -sINFILE=$fn \ + -sRESIDENTFONTS=$fontSet.FS psfstat.ps quit.ps >&$base.flog +if ( -e $fstat ) then + /bin/rm $base.flog +else + echo "There is some errors in scanning PS file." | /bin/sh -c "cat 1>&2" + echo "Look GhostScript log file $base.flog for more information" | /bin/sh -c "cat 1>&2" + echo "Most frequently error is that some font is not anywhere." | /bin/sh -c "cat 1>&2" + exit +endif + +# Began file from conventional metacomment to fit with spooler. +if ( "$out" == "" ) then + echo "%\!PS-Adobe-3.0" +else + echo "Write output into file $out" | /bin/sh -c "cat 1>&2" + echo "%\!PS-Adobe-3.0" >$out +endif + +# Make partial downloading of these fonts which is available +if ( -e $base.undef ) then + /bin/rm -f $base.undef +endif +if ( "$out" == "" ) then + subfont -I$FONTPATH -u$base.undef -m$FontMap -f$fstat -c$fn +else + subfont -I$FONTPATH -u$base.undef -m$FontMap -f$fstat -c$fn >>$out +endif +if ( -e $base.undef ) then + echo "There is unknown font(s)" | /bin/sh -c "cat 1>&2" + cat $base.undef | /bin/sh -c "cat 1>&2" +endif +### diff --git a/fonts/utilities/fontload/unix/home.dirs b/fonts/utilities/fontload/unix/home.dirs new file mode 100644 index 0000000000..96c64d7cb4 --- /dev/null +++ b/fonts/utilities/fontload/unix/home.dirs @@ -0,0 +1,15 @@ +# CHECK THIS DIRECTORIES FIRST !! + +# Directory to put system dependent executable files (subfont program) +setenv FBIN ~/bin + +# Directory to put system independent scripts (fload C-shell script) +setenv FSHR ~/bin + +# Directory for library files (psfstat.ps, Fontmap, SubFont.map, mprint.*) +setenv FLIB ~/lib/fload + +# Also Check that all your fonta are in list of directory tries +setenv FPATH /usr/local/lib/texmf/fonts:/usr/local/lib/ISOFonts/pfa + +### diff --git a/fonts/utilities/fontload/unix/install.dirs b/fonts/utilities/fontload/unix/install.dirs new file mode 100644 index 0000000000..f3494986c4 --- /dev/null +++ b/fonts/utilities/fontload/unix/install.dirs @@ -0,0 +1,18 @@ +# CHECK THIS DIRECTORIES FIRST !! + +# 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 (psfstat.ps, Fontmap, SubFont.map, mprint.*) +setenv FLIB /usr/local/lib/fload + +# Directory for man pages (this directory may be omitted) +setenv FMAN /usr/local/man/man1 + +# Also Check that all your fonts are in list of directory tries +setenv FPATH /usr/local/lib/texmf/fonts:/usr/local/lib/ISOFonts/pfa + +### diff --git a/fonts/utilities/fontload/unix/install.txt b/fonts/utilities/fontload/unix/install.txt new file mode 100644 index 0000000000..edc5fc0a9c --- /dev/null +++ b/fonts/utilities/fontload/unix/install.txt @@ -0,0 +1,5 @@ +==== INSTALLATION on UNIX ==== + +1. Correct directories specified in the 'install.dirs' file. +2. Run installation script by command: 'csh INSTALL'. + diff --git a/fonts/utilities/fontload/unix/mkmap b/fonts/utilities/fontload/unix/mkmap new file mode 100644 index 0000000000..b012e4e346 --- /dev/null +++ b/fonts/utilities/fontload/unix/mkmap @@ -0,0 +1,34 @@ +#!/bin/csh +# +# This script is used to create map of the files available in +# specified tree ... +# +if ( "$1" != "-focus" ) then + # Temorarie, but normally this program is in path... + setenv SUBFONT `pwd`/subfont + + set root=$1 + if ( "$1" == "" ) then + set root="/usr/local/lib/texmf/fonts" + endif + set CWD=`pwd` + if ( -e $CWD/mkmap ) then + set itself=$CWD/mkmap + else + echo Can not found itself when try search in cuurent directory. + exit + endif + echo >SubFont.map + echo >Fontmap.t1 + cd root + find . -name "*.pf[ab]" -exec $itself -focus {} $CWD/Fontmap.t1 $CWD/SubFont.map \; +else + set fn=$2 + set gsmap=$3 + set sfmap=$4 + set font=`$SUBFONT $fn | grep /FontName | cut -d/ -f3 | cut '-d ' -f1` + echo font /$font/ in file /$fn/ + echo "$font $fn" >>$sfmap + echo "/$font ($fn) ;" >>$gsmap +endif +#### diff --git a/fonts/utilities/fontload/unix/ppd2fs b/fonts/utilities/fontload/unix/ppd2fs new file mode 100644 index 0000000000..ff48ce8ff3 --- /dev/null +++ b/fonts/utilities/fontload/unix/ppd2fs @@ -0,0 +1,13 @@ +#!/bin/csh +# File: ppd2fs +# This simple C-Shell script extracts font set declared in PPD file. +# PPD (PostScript(R) Printer Description) file for particular printer +# anyone can extract +# from the '/pub/adobe/PPD/win' directory of the 'ftp.adobe.com' host. +# So, PPD-file for the 'HP LaserJet IIIP PostScript Plus' is hplj_3p1.ppd. +# This printer contains 35 builtin fonts. List of fonts can be extracted +# by command: +# ppd2fs hplj_3p1.ppd >hplj_3p1.FontSet +# +grep "^\*Font" $1 | cut "-d " -f2 | cut -d: -f1 +### diff --git a/fonts/utilities/fontload/unix/usr-local.dirs b/fonts/utilities/fontload/unix/usr-local.dirs new file mode 100644 index 0000000000..d37c3f4f05 --- /dev/null +++ b/fonts/utilities/fontload/unix/usr-local.dirs @@ -0,0 +1,15 @@ +# CHECK THIS DIRECTORIES FIRST !! + +# 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 (psfstat.ps, Fontmap, SubFont.map, mprint.*) +setenv FLIB /usr/local/lib/fload + +# Also Check that all your fonta are in list of directory tries +setenv FPATH /usr/local/lib/texmf/fonts:/usr/local/lib/ISOFonts/pfa + +### |