summaryrefslogtreecommitdiff
path: root/context
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2004-03-09 00:00:00 +0100
committerHans Hagen <pragma@wxs.nl>2004-03-09 00:00:00 +0100
commitb3e51f52d2070a709e3089ada6054cd2080590ca (patch)
treeb14c8903849be35210f217cfa559862a750a87fd /context
parentaff54a32fba80a11d2349133324c2c90064b938b (diff)
downloadcontext-b3e51f52d2070a709e3089ada6054cd2080590ca.tar.gz
stable 2004.03.09
Diffstat (limited to 'context')
-rw-r--r--context/data/cont-cz.tws3
-rw-r--r--context/data/cont-de.tws3
-rw-r--r--context/data/cont-en.tws3
-rw-r--r--context/data/cont-it.tws3
-rw-r--r--context/data/cont-nl.tws3
-rw-r--r--context/data/cont-ro.tws3
-rw-r--r--context/data/type-buy.dat24
-rw-r--r--context/data/type-fsf.dat8
-rw-r--r--context/data/type-ghz.dat5
-rw-r--r--context/data/type-tmf.dat73
-rw-r--r--context/perltk/makempy.pl364
-rw-r--r--context/perltk/texexec.pl4
-rw-r--r--context/perltk/texfont.pl657
13 files changed, 663 insertions, 490 deletions
diff --git a/context/data/cont-cz.tws b/context/data/cont-cz.tws
index 2edbcd0ae..e5fabf138 100644
--- a/context/data/cont-cz.tws
+++ b/context/data/cont-cz.tws
@@ -361,6 +361,7 @@ var:textovyprikaz:*\prikaz#1::
var:split:tolerantni,striktni,velmistriktni,*cislo::
var:styltextu:normalni,tucne,sklonene,tucnesklonene,opis,kap,male...,*prikaz::
var:barvatextu:*jmeno::
+var:interakce:ano,ne::
ivr:oramovani::
stopsetup
@@ -1922,7 +1923,7 @@ stopsetup
startsetup
com:strana:
typ:vals/:
-val:ano,zlom,ne,nastaveni,vysokapriorita, vlevo,vpravo,zablokovat,posledni,ctyrnasobny, sude,liche,prazdny,prazdne,reset:ano:
+val:ano,zlom,ne,nastaveni,vysokapriorita, vlevo,vpravo,zablokovat,posledni,ctyrnasobny, sude,liche,prazdny,prazdne,reset,start,stop:ano:
stopsetup
startsetup
diff --git a/context/data/cont-de.tws b/context/data/cont-de.tws
index 54db10f48..b59ee1b5f 100644
--- a/context/data/cont-de.tws
+++ b/context/data/cont-de.tws
@@ -361,6 +361,7 @@ var:textbefehl:*\Befehl#1::
var:split:tolerant,streng,sehrstreng,*Nummer::
var:textstil:normal,fett,geneigt,fettgeneigt,tippen,kap,klein...,*Befehl::
var:textfarbe:*Name::
+var:interaktion:ja,nein::
ivr:umrahmt::
stopsetup
@@ -1922,7 +1923,7 @@ stopsetup
startsetup
com:seite:
typ:vals/:
-val:ja,umbruch,nein,einstellung,grosszuegig, links,rechts,sperren,letzte,viertel, gerade,ungerade,blanko,leer,zuruecksetzten:ja:
+val:ja,umbruch,nein,einstellung,grosszuegig, links,rechts,sperren,letzte,viertel, gerade,ungerade,blanko,leer,zuruecksetzten,start,stop:ja:
stopsetup
startsetup
diff --git a/context/data/cont-en.tws b/context/data/cont-en.tws
index 833e6e70f..d48f8472e 100644
--- a/context/data/cont-en.tws
+++ b/context/data/cont-en.tws
@@ -361,6 +361,7 @@ var:textcommand:*\command#1::
var:split:tolerant,strict,verystrict,*number::
var:textstyle:normal,bold,slanted,boldslanted,type,cap,small...,*command::
var:textcolor:*name::
+var:interaction:yes,no::
ivr:framed::
stopsetup
@@ -1922,7 +1923,7 @@ stopsetup
startsetup
com:page:
typ:vals/:
-val:yes,makeup,no,preference,bigpreference, left,right,disable,last,quadruple, even,odd,blank,empty,reset:yes:
+val:yes,makeup,no,preference,bigpreference, left,right,disable,last,quadruple, even,odd,blank,empty,reset,start,stop:yes:
stopsetup
startsetup
diff --git a/context/data/cont-it.tws b/context/data/cont-it.tws
index 69fbd0cef..8b97c9d8d 100644
--- a/context/data/cont-it.tws
+++ b/context/data/cont-it.tws
@@ -361,6 +361,7 @@ var:comandotesto:*\comando#1::
var:separa:tollerante,rigido,moltorigido,*numero::
var:stiletesto:normale,grassetto,inclinato,grassettoinclinato,type,cap,piccolo...,*comando::
var:coloretesto:*nome::
+var:interazione:si,no::
ivr:incorniciato::
stopsetup
@@ -1922,7 +1923,7 @@ stopsetup
startsetup
com:pagina:
typ:vals/:
-val:si,makeup,no,preferenza,grandepreferenza, sinistra,destra,disattiva,ultimo,quadruplo, pari,dispari,rigovuoto,vuoto,reimposta:si:
+val:si,makeup,no,preferenza,grandepreferenza, sinistra,destra,disattiva,ultimo,quadruplo, pari,dispari,rigovuoto,vuoto,reimposta,inizia,termina:si:
stopsetup
startsetup
diff --git a/context/data/cont-nl.tws b/context/data/cont-nl.tws
index d659e6a51..bbb89e537 100644
--- a/context/data/cont-nl.tws
+++ b/context/data/cont-nl.tws
@@ -361,6 +361,7 @@ var:tekstcommando:*\commando#1::
var:splitsen:soepel,streng,zeerstreng,*getal::
var:tekstletter:normaal,vet,schuin,vetschuin,type,kap,klein...,*commando::
var:tekstkleur:*naam::
+var:interactie:ja,nee::
ivr:omlijnd::
stopsetup
@@ -1922,7 +1923,7 @@ stopsetup
startsetup
com:pagina:
typ:vals/:
-val:ja,opmaak,nee,voorkeur,grotevoorkeur, links,rechts,blokkeer,laatste,viertal, even,oneven,blanko,leeg,reset:ja:
+val:ja,opmaak,nee,voorkeur,grotevoorkeur, links,rechts,blokkeer,laatste,viertal, even,oneven,blanko,leeg,reset,start,stop:ja:
stopsetup
startsetup
diff --git a/context/data/cont-ro.tws b/context/data/cont-ro.tws
index 309fb42e4..e28483ec4 100644
--- a/context/data/cont-ro.tws
+++ b/context/data/cont-ro.tws
@@ -361,6 +361,7 @@ var:comandatext:*\comanda#1::
var:split:tolerant,strict,foartestrict,*numar::
var:stiltext:normal,aldin,inclinat,aldininclinat,type,cap,mic...,*comanda::
var:culoaretext:*nume::
+var:interactiune:da,nu::
ivr:framed::
stopsetup
@@ -1922,7 +1923,7 @@ stopsetup
startsetup
com:pagina:
typ:vals/:
-val:da,marcaj,nu,preferinta,preferintamare, stanga,dreapta,dezactivat,ultim,cvadrupul, par,impar,blank,gol,reset:da:
+val:da,marcaj,nu,preferinta,preferintamare, stanga,dreapta,dezactivat,ultim,cvadrupul, par,impar,blank,gol,reset,start,stop:da:
stopsetup
startsetup
diff --git a/context/data/type-buy.dat b/context/data/type-buy.dat
index 0655f7fab..b3d52d29d 100644
--- a/context/data/type-buy.dat
+++ b/context/data/type-buy.dat
@@ -1,6 +1,6 @@
# itc officina
---en=? --ve=itc --co=officina --re
+--en=? --ve=itc --co=officina --re
--en=? --ve=itc --co=officina --so=itc/officina --ma --in
--en=? --ve=itc --co=officina --so=itc/officina --ca=* ovbk_*
@@ -14,7 +14,7 @@
# bh lucida
--en=? --ve=bh --co=lucida --re
---en=? --ve=bh --co=lucida --so=bh/lucida --ma --in
+--en=? --ve=bh --co=lucida --so=bh/lucida --ma --in --expert
# fontfont meta
@@ -45,7 +45,7 @@
--en=? --ve=creative --co=industria --re
--en=? --ve=creative --co=industria --so=creative/industria --ma --in
-# creative insignia
+# creative insignia
--en=? --ve=creative --co=insignia --re
--en=? --ve=creative --co=insignia --so=creative/insignia --ma --in
@@ -55,12 +55,12 @@
--en=? --ve=fontfont --co=din --re
--en=? --ve=fontfont --co=din --so=fontfont/din --ma --in
-# adobe myriad
+# adobe myriad
--en=? --so=adobe/myriad --weight=400 --width=600 MyriadMM
--en=? --so=adobe/myriad --weight=700 --width=600 MyriadMM
---en=? --so=adobe/myriad --weight=400 --width=600 MyriadMM-It
---en=? --so=adobe/myriad --weight=700 --width=600 MyriadMM-It
+--en=? --so=adobe/myriad --weight=400 --width=600 MyriadMM-It
+--en=? --so=adobe/myriad --weight=700 --width=600 MyriadMM-It
--en=? --ve=adobe --co=myriad --so=adobe/myriad --ma --in MyriadMM-we*
--en=? --ve=adobe --co=myriad --so=adobe/myriad --ma --in MyriadMM-It-we*
@@ -73,22 +73,22 @@
--en=? --ve=adobe --co=frutiger --re
--en=? --ve=adobe --co=frutiger --so=adobe/frutiger --ma --in
-# itc mendoza
+# itc mendoza
--en=? --ve=itc --co=mendoza --re
--en=? --ve=itc --co=mendoza --so=itc/mendoza --ma --in
-# linotype univers
+# linotype univers
--en=? --ve=linotype --co=univers --re
--en=? --ve=linotype --co=univers --so=linotype/univers --ma --in
-# adobe utopia
-#
+# adobe utopia
+#
# --en=? --ve=adobe --co=utopia --re
# --en=? --ve=adobe --co=utopia --so=adobe/utopia --ma --in
-# itc kabel
+# itc kabel
--en=? --ve=itc --co=kabel --re
---en=? --ve=itc --co=kabel --so=itc/kabel --ma --in
+--en=? --ve=itc --co=kabel --so=itc/kabel --ma --in \ No newline at end of file
diff --git a/context/data/type-fsf.dat b/context/data/type-fsf.dat
index df57ed362..7ccec15a4 100644
--- a/context/data/type-fsf.dat
+++ b/context/data/type-fsf.dat
@@ -1,4 +1,4 @@
-# fontsite opus
+# fontsite opus
--en=? --ve=fontsite --co=opus --re
--en=? --ve=fontsite --co=opus --so=fontsite/500 --ma --in opus*
@@ -14,10 +14,10 @@
--en=? --ve=fontsite --co=typewriter --so=fontsite/500 --sl=* typerg_*
--en=? --ve=fontsite --co=typewriter --so=fontsite/500 --sl=* typeb_*
-# fontsite garamond
+# fontsite garamond
--en=? --ve=fontsite --co=garamond --re
--en=? --ve=fontsite --co=garamond --so=fontsite/500 --ma --in gara*
---en=? --ve=fontsite --co=garamond --so=fontsite/500 --sl=* garai_*
---en=? --ve=fontsite --co=garamond --so=fontsite/500 --sl=* garab_*
+--en=? --ve=fontsite --co=garamond --so=fontsite/500 --sl=* garamond*
+--en=? --ve=fontsite --co=garamond --so=fontsite/500 --sl=* garab_* \ No newline at end of file
diff --git a/context/data/type-ghz.dat b/context/data/type-ghz.dat
index a59ada772..5e2b59360 100644
--- a/context/data/type-ghz.dat
+++ b/context/data/type-ghz.dat
@@ -28,7 +28,10 @@
# linotype kompakt
-# linotype linotype-zapfino
+# linotype zapfino
+
+--en=? --ve=linotype --co=zapfino --re
+--en=? --ve=linotype --co=zapfino --so=ghz/linotype-zapfino --ma --in
# linotype marconi
diff --git a/context/data/type-tmf.dat b/context/data/type-tmf.dat
index 433e491ee..af727b2e9 100644
--- a/context/data/type-tmf.dat
+++ b/context/data/type-tmf.dat
@@ -6,62 +6,67 @@
# public antp
---en=? --ve=public --co=antp --so=auto
+--en=? --ve=public --co=antp --so=auto --ro=TEXMFMAIN
# public antt
---en=? --ve=public --co=antt --so=auto
+--en=? --ve=public --co=antt --so=auto --ro=TEXMFMAIN
# urw helvetica
---en=? --ve=urw --co=helvetica --so=auto
+--en=? --ve=urw --co=helvetica --so=auto --ro=TEXMFMAIN
# urw courier
---en=? --ve=urw --co=courier --so=auto
+--en=? --ve=urw --co=courier --so=auto --ro=TEXMFMAIN
+
+# urw zapfchan
+
+--en=? --ve=urw --co=zapfchan --so=auto --ro=TEXMFMAIN
# urw times
---en=? --ve=urw --co=times --so=auto
---en=? --ve=urw --co=times --so=auto --ca=* utmr8a
---en=? --ve=urw --co=times --so=auto --sl=* utmr8a
---en=? --ve=urw --co=times --so=auto --sl=* utmb8a
+--en=? --ve=urw --co=times --so=auto --ro=TEXMFMAIN
+--en=? --ve=urw --co=times --so=auto --ca=* utmr8a --ro=TEXMFMAIN
+--en=? --ve=urw --co=times --so=auto --sl=* utmr8a --ro=TEXMFMAIN
+--en=? --ve=urw --co=times --so=auto --sl=* utmb8a --ro=TEXMFMAIN
# urw palatino
---en=? --ve=urw --co=palatino --so=auto
---en=? --ve=urw --co=palatino --so=auto --ca=* uplr8a
---en=? --ve=urw --co=palatino --so=auto --sl=* uplr8a
---en=? --ve=urw --co=palatino --so=auto --sl=* uplb8a
+--en=? --ve=urw --co=palatino --so=auto --ro=TEXMFMAIN
+--en=? --ve=urw --co=palatino --so=auto --ca=* uplr8a --ro=TEXMFMAIN
+--en=? --ve=urw --co=palatino --so=auto --sl=* uplr8a --ro=TEXMFMAIN
+--en=? --ve=urw --co=palatino --so=auto --sl=* uplb8a --ro=TEXMFMAIN
-# adbobe utopia
+# adobe utopia
---en=? --ve=adobe --co=utopia --so=auto
---en=? --ve=adobe --co=utopia --so=auto --ca=* putr8a
---en=? --ve=adobe --co=utopia --so=auto --sl=* putr8a
---en=? --ve=adobe --co=utopia --so=auto --sl=* putb8a
+--en=? --ve=adobe --co=utopia --so=auto --ro=TEXMFMAIN
+--en=? --ve=adobe --co=utopia --so=auto --ca=* putr8a --ro=TEXMFMAIN
+--en=? --ve=adobe --co=utopia --so=auto --sl=* putr8a --ro=TEXMFMAIN
+--en=? --ve=adobe --co=utopia --so=auto --sl=* putb8a --ro=TEXMFMAIN
-# bit charter
+--en=? --ve=adobe --co=utopia --so=auto --ro=TEXMFEXTRA # texlive 2003+
+--en=? --ve=adobe --co=utopia --so=auto --ca=* putr8a --ro=TEXMFEXTRA # texlive 2003+
+--en=? --ve=adobe --co=utopia --so=auto --sl=* putr8a --ro=TEXMFEXTRA # texlive 2003+
+--en=? --ve=adobe --co=utopia --so=auto --sl=* putb8a --ro=TEXMFEXTRA # texlive 2003+
---en=? --ve=bitstrea --co=charter --so=auto
---en=? --ve=bitstrea --co=charter --so=auto --ca=* bchr8a
---en=? --ve=bitstrea --co=charter --so=auto --sl=* bchr8a
---en=? --ve=bitstrea --co=charter --so=auto --sl=* bchb8a
+# bitstream charter
-# uwr bookman
+--en=? --ve=bitstrea --co=charter --so=auto --ro=TEXMFMAIN
+--en=? --ve=bitstrea --co=charter --so=auto --ca=* bchr8a --ro=TEXMFMAIN
+--en=? --ve=bitstrea --co=charter --so=auto --sl=* bchr8a --ro=TEXMFMAIN
+--en=? --ve=bitstrea --co=charter --so=auto --sl=* bchb8a --ro=TEXMFMAIN
---en=? --ve=urw --co=bookman --so=auto
---en=? --ve=urw --co=bookman --so=auto --ca=* ubkl8a
---en=? --ve=urw --co=bookman --so=auto --sl=* ubkl8a
---en=? --ve=urw --co=bookman --so=auto --sl=* ubkd8a
-
-# urw zapfchan
+# uwr bookman
---en=? --ve=urw --co=zapfchan --so=auto
+--en=? --ve=urw --co=bookman --so=auto --ro=TEXMFMAIN
+--en=? --ve=urw --co=bookman --so=auto --ca=* ubkl8a --ro=TEXMFMAIN
+--en=? --ve=urw --co=bookman --so=auto --sl=* ubkl8a --ro=TEXMFMAIN
+--en=? --ve=urw --co=bookman --so=auto --sl=* ubkd8a --ro=TEXMFMAIN
# uwr schoolbook
---en=? --ve=urw --co=ncntrsbk --so=auto
---en=? --ve=urw --co=ncntrsbk --so=auto --ca=* uncr8a
---en=? --ve=urw --co=ncntrsbk --so=auto --sl=* uncr8a
---en=? --ve=urw --co=ncntrsbk --so=auto --sl=* uncb8a \ No newline at end of file
+--en=? --ve=urw --co=ncntrsbk --so=auto --ro=TEXMFMAIN
+--en=? --ve=urw --co=ncntrsbk --so=auto --ca=* uncr8a --ro=TEXMFMAIN
+--en=? --ve=urw --co=ncntrsbk --so=auto --sl=* uncr8a --ro=TEXMFMAIN
+--en=? --ve=urw --co=ncntrsbk --so=auto --sl=* uncb8a --ro=TEXMFMAIN \ No newline at end of file
diff --git a/context/perltk/makempy.pl b/context/perltk/makempy.pl
index ef8fa3cfc..3efbce4e0 100644
--- a/context/perltk/makempy.pl
+++ b/context/perltk/makempy.pl
@@ -4,8 +4,8 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $
#D \module
#D [ file=makempy.pl,
#D version=2000.12.14,
-#D title=\METAFUN,
-#D subtitle=\METAPOST\ Text Graphics,
+#D title=\METAFUN,
+#D subtitle=\METAPOST\ Text Graphics,
#D author=Hans Hagen,
#D date=\currentdate,
#D copyright={PRAGMA / Hans Hagen \& Ton Otten}]
@@ -14,129 +14,129 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $
#C therefore copyrighted by \PRAGMA. See licen-en.pdf for
#C details.
-# Tobias Burnus provided the code needed to proper testing
-# of binaries on UNIX as well as did some usefull suggestions
-# to improve the functionality.
-
-# This script uses GhostScript and PStoEdit as well as
-# pdfTeX, and if requested TeXEdit and ConTeXt.
+# Tobias Burnus provided the code needed to proper testing
+# of binaries on UNIX as well as did some usefull suggestions
+# to improve the functionality.
+
+# This script uses GhostScript and PStoEdit as well as
+# pdfTeX, and if requested TeXEdit and ConTeXt.
use Getopt::Long ;
-use Config ;
-use strict ;
+use Config ;
+use strict ;
$Getopt::Long::passthrough = 1 ; # no error message
$Getopt::Long::autoabbrev = 1 ; # partial switch accepted
-my $help = 0 ;
-my $silent = 0 ;
+my $help = 0 ;
+my $silent = 0 ;
my $force = 0 ;
-my $noclean = 0 ;
+my $noclean = 0 ;
-my $amethod = my $pmethod = my $gmethod = 0 ;
+my $amethod = my $pmethod = my $gmethod = 0 ;
-my $format = "plain" ; # can be "context" for plain users too
+my $format = "plain" ; # can be "context" for plain users too
&GetOptions
( "help" => \$help ,
"silent" => \$silent ,
- "force" => \$force ,
- "pdftops" => \$pmethod ,
- "xpdf" => \$pmethod ,
- "acrobat" => \$amethod ,
- "reader" => \$amethod ,
- "gs" => \$gmethod ,
- "ghostscript" => \$gmethod ,
+ "force" => \$force ,
+ "pdftops" => \$pmethod ,
+ "xpdf" => \$pmethod ,
+ "acrobat" => \$amethod ,
+ "reader" => \$amethod ,
+ "gs" => \$gmethod ,
+ "ghostscript" => \$gmethod ,
"noclean" => \$noclean ) ;
-
-my $mpochecksum = 0 ;
-my %tex ; my %start ; my %stop ;
+my $mpochecksum = 0 ;
+
+my %tex ; my %start ; my %stop ;
$tex{plain} = "pdftex" ;
$tex{latex} = "pdflatex" ;
-$tex{context} = "texexec --batch --once --interface=en --pdf" ;
+$tex{context} = "texexec --batch --once --interface=en --pdf" ;
-$start{plain} = '' ;
+$start{plain} = '' ;
$stop{plain} = '\end' ;
-$start{latex} = '\begin{document}' ;
+$start{latex} = '\begin{document}' ;
$stop{latex} = '\end{document}' ;
-$start{context} = '\starttext' ;
-$stop{context} = '\stoptext' ;
+$start{context} = '\starttext' ;
+$stop{context} = '\stoptext' ;
-my $ghostscript = "" ;
-my $pstoedit = "" ;
-my $pdftops = "" ;
-my $acroread = "" ;
+my $ghostscript = "" ;
+my $pstoedit = "" ;
+my $pdftops = "" ;
+my $acroread = "" ;
my $wereondos = ($Config{'osname'} =~ /dos|mswin/io) ;
# Unix only: assume that "gs" in the path. We could also
-# use $ghostscipt = system "which gs" but this would require
+# use $ghostscipt = system "which gs" but this would require
# that which is installedd on the system.
sub checkenv
- { my ($var, $env) = @_ ;
- if ($var)
- { return $var }
- elsif ($ENV{$env})
- { return $ENV{$env} }
- else
+ { my ($var, $env) = @_ ;
+ if ($var)
+ { return $var }
+ elsif ($ENV{$env})
+ { return $ENV{$env} }
+ else
{ return $var } }
-
-$ghostscript = checkenv ($ghostscript, "GS_PROG" ) ;
+
+$ghostscript = checkenv ($ghostscript, "GS_PROG" ) ;
$ghostscript = checkenv ($ghostscript, "GS" ) ;
$pstoedit = checkenv ($pstoedit , "PSTOEDIT") ;
$pdftops = checkenv ($pdftops , "PDFTOPS" ) ;
$acroread = checkenv ($acroread , "ACROREAD") ;
sub setenv
- { my ($var, $unix, $win) = @_ ;
- if ($var)
- { return $var }
- elsif ($wereondos)
- { return $win }
- else
+ { my ($var, $unix, $win) = @_ ;
+ if ($var)
+ { return $var }
+ elsif ($wereondos)
+ { return $win }
+ else
{ return $unix } }
-$ghostscript = setenv($ghostscript, "gs" , "gswin32c") ;
-$pstoedit = setenv($pstoedit , "pstoedit", "pstoedit") ;
-$pdftops = setenv($pdftops , "pdftops" , "pdftops" ) ;
-$acroread = setenv($acroread , "acroread", "" ) ;
+$ghostscript = setenv($ghostscript, "gs" , "gswin32c") ;
+$pstoedit = setenv($pstoedit , "pstoedit", "pstoedit") ;
+$pdftops = setenv($pdftops , "pdftops" , "pdftops" ) ;
+$acroread = setenv($acroread , "acroread", "" ) ;
+
+# Force a method if unknown.
-# Force a method if unknown.
+unless ($pmethod||$amethod||$gmethod)
+ { if ($wereondos) { $pmethod = 1 } else { $amethod = 1 } }
-unless ($pmethod||$amethod||$gmethod)
- { if ($wereondos) { $pmethod = 1 } else { $amethod = 1 } }
-
# Set the error redirection used under Unix:
# stderr -> stdout
my $logredirection = '>>' ;
-# This unfortunally doen't work with the ksh and simple sh
+# This unfortunally doesn't work with the ksh and simple sh
#
-# if (!$wereondos)
+# if (!$wereondos)
# { $logredirection = '2>&1 >>' ; # Bash
# $logredirection = '>>&' ; # tcsh, Bash
# default $logredirection. }
-# Some TeX Code Snippets.
+# Some TeX Code Snippets.
my $macros = '
-% auxiliary macros
+% auxiliary macros
\input supp-mis.tex
-\def\startTEXpage[scale=#1]%
- {\output{}
- \batchmode
- \pdfoutput=1
+\def\startTEXpage[scale=#1]%
+ {\output{}
+ \batchmode
+ \pdfoutput=1
\pdfcompresslevel=9
- \hoffset=-1in
+ \hoffset=-1in
\voffset=\hoffset
\scratchcounter=#1
\divide\scratchcounter1000
@@ -148,9 +148,9 @@ my $macros = '
{\egroup
\dimen0=\ht0 \advance\dimen0 \dp0
\setbox2=\vbox to 10\dimen0
- {\pdfliteral{\TEXscale 0 0 \TEXscale 0 0 cm}
+ {\pdfliteral{\TEXscale 0 0 \TEXscale 0 0 cm}
\copy0
- \pdfliteral{1 0 0 1 0 0 cm}
+ \pdfliteral{1 0 0 1 0 0 cm}
\vfill}
\wd2=10\wd0
\pdfpageheight=\ht2
@@ -158,53 +158,53 @@ my $macros = '
\ScaledPointsToBigPoints{\number\pdfpageheight}\pdfcropheight
\ScaledPointsToBigPoints{\number\pdfpagewidth }\pdfcropwidth
\expanded{\pdfpageattr{/CropBox [0 0 \pdfcropwidth \space \pdfcropheight]}}
- \shipout\hbox{\box2}}
+ \shipout\hbox{\box2}}
-% end of auxiliary macros' ;
+% end of auxiliary macros' ;
-sub report
- { return if $silent ;
- my $str = shift ;
- if ($str =~ /(.*?)\s+([\:\/])\s+(.*)/o)
- { if ($1 eq "") { $str = " " } else { $str = $2 }
- print sprintf("%22s $str %s\n",$1,$3) } }
+sub report
+ { return if $silent ;
+ my $str = shift ;
+ if ($str =~ /(.*?)\s+([\:\/])\s+(.*)/o)
+ { if ($1 eq "") { $str = " " } else { $str = $2 }
+ print sprintf("%22s $str %s\n",$1,$3) } }
-sub error
- { report("processing aborted : " . shift) ;
- exit }
+sub error
+ { report("processing aborted : " . shift) ;
+ exit }
-sub process
- { report("generating : " . shift) }
+sub process
+ { report("generating : " . shift) }
-sub banner
- { return if $silent ;
+sub banner
+ { return if $silent ;
print "\n" ;
- report ("MakeMPY 1.1 - MetaFun / PRAGMA ADE 2000-2001") ;
+ report ("MakeMPY 1.1 - MetaFun / PRAGMA ADE 2000-2004") ;
print "\n" }
-my $metfile = "" ; # main metapost file
+my $metfile = "" ; # main metapost file
my $mpofile = "" ; # metapost text specifiation file (provided)
my $mpyfile = "" ; # metapost text picture file (generated)
-my $texfile = "" ; # temporary tex file
-my $pdffile = "" ; # temporary pdf file
-my $tmpfile = "" ; # temporary metapost file
-my $posfile = "" ; # temporary postscript file
-my $logfile = "" ; # temporary log file
+my $texfile = "" ; # temporary tex file
+my $pdffile = "" ; # temporary pdf file
+my $tmpfile = "" ; # temporary metapost file
+my $posfile = "" ; # temporary postscript file
+my $logfile = "" ; # temporary log file
my $errfile = "" ; # final log file (with suffix log)
-sub show_help_info
- { banner ;
- report ("--help : this message" ) ;
- report ("--noclean : don't remove temporary files" ) ;
- report ("--force : force processing (ignore checksum)" ) ;
- report ("--silent : don't show messages" ) ;
- print "\n" ;
- report ("--acrobat : use acrobat (reader) for ps->pdf (on unix)") ;
- report ("--pdftops : use pdftops (xpdf) ps->pdf") ;
- report ("--ghostscript : use ghostscript (gs) for ps->pdf") ;
- print "\n" ;
- report ("input file : metapost file with graphics") ;
- report ("programs needed : texexec and english context") ;
+sub show_help_info
+ { banner ;
+ report ("--help : this message" ) ;
+ report ("--noclean : don't remove temporary files" ) ;
+ report ("--force : force processing (ignore checksum)" ) ;
+ report ("--silent : don't show messages" ) ;
+ print "\n" ;
+ report ("--acrobat : use acrobat (reader) for ps->pdf (on unix)") ;
+ report ("--pdftops : use pdftops (xpdf) ps->pdf") ;
+ report ("--ghostscript : use ghostscript (gs) for ps->pdf") ;
+ print "\n" ;
+ report ("input file : metapost file with graphics") ;
+ report ("programs needed : texexec and english context") ;
report (" : pdftops from the xpdf suite, or") ; # page size buggy
report (" : pdf2ps and ghostscript, or") ;
report (" : acrobat reader for unix, and") ;
@@ -212,103 +212,103 @@ sub show_help_info
report ("output file : metapost file with pictures") ;
exit }
-sub check_input_file
- { my $file = $ARGV[0] ;
- if ((!defined($file))||($file eq ""))
- { banner ; error("no filename given") }
+sub check_input_file
+ { my $file = $ARGV[0] ;
+ if ((!defined($file))||($file eq ""))
+ { banner ; error("no filename given") }
else
- { $file =~ s/\.mp.*$//o ;
- $metfile = "$file.mp" ;
- $mpofile = "$file.mpo" ;
+ { $file =~ s/\.mp.*$//o ;
+ $metfile = "$file.mp" ;
+ $mpofile = "$file.mpo" ;
$mpyfile = "$file.mpy" ;
$logfile = "$file.log" ;
- $texfile = "mpy-$file.tex" ;
+ $texfile = "mpy-$file.tex" ;
$pdffile = "mpy-$file.pdf" ;
$posfile = "mpy-$file.pos" ;
$tmpfile = "mpy-$file.tmp" ;
$errfile = "mpy-$file.log" ;
- if (! -f $metfile)
+ if (! -f $metfile)
{ banner ; error("$metfile is empty") }
- elsif (-s $mpofile < 32)
- { unlink $mpofile ; # may exist with zero length
+ elsif (-s $mpofile < 32)
+ { unlink $mpofile ; # may exist with zero length
unlink $mpyfile ; # get rid of left overs
- exit }
+ exit }
else
{ banner ; report("processing file : $mpofile") } } }
sub verify_check_sum # checksum calculation from perl documentation
{ return unless (open (MPO,"$mpofile")) ;
- $mpochecksum = do { local $/ ; unpack("%32C*",<MPO>) % 65535 } ;
+ $mpochecksum = do { local $/ ; unpack("%32C*",<MPO>) % 65535 } ;
close (MPO) ;
return unless open (MPY,"$mpyfile") ;
- my $str = <MPY> ; chomp $str ;
+ my $str = <MPY> ; chomp $str ;
close (MPY) ;
- if ($str =~ /^\%\s*mpochecksum\s*\:\s*(\d+)/o)
- { if ($mpochecksum eq $1)
+ if ($str =~ /^\%\s*mpochecksum\s*\:\s*(\d+)/o)
+ { if ($mpochecksum eq $1)
{ report("mpo checksum : $mpochecksum / unchanged") ;
exit unless $force }
- else
+ else
{ report("mpo checksum : $mpochecksum / changed") } } }
-sub cleanup_files
- { my @files = <mpy-*.*> ;
- foreach (@files) { unless (/\.log/o) { unlink $_ } } }
+sub cleanup_files
+ { my @files = <mpy-*.*> ;
+ foreach (@files) { unless (/\.log/o) { unlink $_ } } }
-sub construct_tex_file
- { my $n = 0 ;
+sub construct_tex_file
+ { my $n = 0 ;
unless (open (MPO, "<$mpofile"))
- { error("unable to open $mpofile") }
- unless (open (TEX, ">$texfile"))
- { error("unable to open $texfile") }
- my $textext = "" ;
- while (<MPO>)
- { s/\s*$//mois ;
- if (/\%\s*format=(\w+)/)
- { $format = $1 }
+ { error("unable to open $mpofile") }
+ unless (open (TEX, ">$texfile"))
+ { error("unable to open $texfile") }
+ my $textext = "" ;
+ while (<MPO>)
+ { s/\s*$//mois ;
+ if (/\%\s*format=(\w+)/)
+ { $format = $1 }
else # if (!/^\%/)
- { if (/startTEXpage/o)
- { ++$n ;
+ { if (/startTEXpage/o)
+ { ++$n ;
$textext .= "$start{$format}\n" ;
- $start{$format} = "" }
+ $start{$format} = "" }
$textext .= "$_\n" } }
- unless (defined($tex{$format})) { $format = "plain" }
- if ($format eq "context") { $macros = "" }
- # print TEX "$start{$format}\n$macros\n$textext\n$stop{$format}\n" ;
- print TEX "$start{$format}\n" if $start{$format} ;
- print TEX "$macros\n" if $macros ;
- print TEX "$textext\n" if $textext ;
- print TEX "$stop{$format}\n" if $stop{$format} ;
- close (MPO) ;
+ unless (defined($tex{$format})) { $format = "plain" }
+ if ($format eq "context") { $macros = "" }
+ # print TEX "$start{$format}\n$macros\n$textext\n$stop{$format}\n" ;
+ print TEX "$start{$format}\n\n" if $start{$format} ;
+ print TEX "$macros\n" if $macros ;
+ print TEX "$textext\n" if $textext ;
+ print TEX "$stop{$format}\n" if $stop{$format} ;
+ close (MPO) ;
close (TEX) ;
report("tex format : $format") ;
report("requested texts : $n") }
-sub construct_mpy_file
+sub construct_mpy_file
{ unless (open (TMP, "<$tmpfile"))
- { error("unable to open $tmpfile file") }
- unless (open (MPY, ">$mpyfile"))
- { error("unable to open $mpyfile file") }
- print MPY "% mpochecksum : $mpochecksum\n" ;
- my $copying = my $n = 0 ;
- while (<TMP>)
- { if (s/beginfig/begingraphictextfig/o)
- { print MPY $_ ; $copying = 1 ; ++$n }
- elsif (s/endfig/endgraphictextfig/o)
+ { error("unable to open $tmpfile file") }
+ unless (open (MPY, ">$mpyfile"))
+ { error("unable to open $mpyfile file") }
+ print MPY "% mpochecksum : $mpochecksum\n" ;
+ my $copying = my $n = 0 ;
+ while (<TMP>)
+ { if (s/beginfig/begingraphictextfig/o)
+ { print MPY $_ ; $copying = 1 ; ++$n }
+ elsif (s/endfig/endgraphictextfig/o)
{ print MPY $_ ; $copying = 0 }
elsif ($copying)
{ print MPY $_ } }
close (TMP) ;
close (MPY) ;
- report("processed texts : $n") ;
+ report("processed texts : $n") ;
report("produced file : $mpyfile") }
-sub run
- { my ($resultfile, $program,$arguments) = @_ ;
+sub run
+ { my ($resultfile, $program,$arguments) = @_ ;
my $result = system("$program $arguments $logredirection $logfile") ;
unless (-f $resultfile) { error("invalid `$program' run") } }
-sub make_pdf_pages
- { process ("pdf file") ;
+sub make_pdf_pages
+ { process ("pdf file") ;
run ($pdffile, "$tex{$format}", "$texfile") }
sub make_mp_figures
@@ -316,40 +316,40 @@ sub make_mp_figures
if ($pmethod) { run($posfile, "$pdftops",
"-paperw 10000 -paperh 10000 $pdffile $posfile") }
if ($gmethod) { run($posfile, "$ghostscript",
- "-q -sOutputFile=$posfile -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pswrite $pdffile") }
+ "-q -sOutputFile=$posfile -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pswrite $pdffile") }
if ($amethod) { run($posfile, "$acroread",
"-toPostScript -pairs $pdffile $posfile") } }
-sub make_mp_pictures
- { process ("metapost file") ;
- run ($tmpfile, "$pstoedit", "-ssp -dt -f mpost $posfile $tmpfile") }
+sub make_mp_pictures
+ { process ("metapost file") ;
+ run ($tmpfile, "$pstoedit", "-ssp -dt -f mpost $posfile $tmpfile") }
if ($help) { show_help_info }
-check_input_file ;
+check_input_file ;
verify_check_sum ;
-cleanup_files ;
-construct_tex_file ;
-make_pdf_pages ;
-make_mp_figures ;
-make_mp_pictures ;
-construct_mpy_file ; # less save : rename $tmpfile, $mpyfile ;
-unless ($noclean) { cleanup_files }
-
-# a simple test file (needs context)
+cleanup_files ;
+construct_tex_file ;
+make_pdf_pages ;
+make_mp_figures ;
+make_mp_pictures ;
+construct_mpy_file ; # less save : rename $tmpfile, $mpyfile ;
+unless ($noclean) { cleanup_files }
+
+# a simple test file (needs context)
#
# % output=pdftex
-#
-# \starttext
-#
+#
+# \starttext
+#
# \startMPpage
-# graphictext
+# graphictext
# "\bf MAKE"
# scaled 8
-# zscaled (1,2)
-# withdrawcolor \MPcolor{blue}
-# withfillcolor \MPcolor{gray}
-# withpen pencircle scaled 5pt ;
+# zscaled (1,2)
+# withdrawcolor \MPcolor{blue}
+# withfillcolor \MPcolor{gray}
+# withpen pencircle scaled 5pt ;
# \stopMPpage
-#
+#
# \stoptext
diff --git a/context/perltk/texexec.pl b/context/perltk/texexec.pl
index f5e27818d..cd75821a9 100644
--- a/context/perltk/texexec.pl
+++ b/context/perltk/texexec.pl
@@ -325,7 +325,7 @@ if ( ( $LogFile ne '' ) && ( $LogFile =~ /\w+\.log$/io ) ) {
*STDERR = *LOGFILE;
}
-my $Program = " TeXExec 4.0 - ConTeXt / PRAGMA ADE 1997-2003";
+my $Program = " TeXExec 4.0 - ConTeXt / PRAGMA ADE 1997-2004";
print "\n$Program\n\n";
@@ -602,7 +602,7 @@ if ( open( INI, $IniPath ) ) {
if ($Verbose) { print "\n" }
} elsif ($Verbose) {
print
-" warning : $IniPath not found, did you read 'texexec.rme'?\n";
+ " warning : $IniPath not found, did you read 'texexec.rme'?\n";
exit 1;
} else {
print
diff --git a/context/perltk/texfont.pl b/context/perltk/texfont.pl
index d9de200b6..6e0b95978 100644
--- a/context/perltk/texfont.pl
+++ b/context/perltk/texfont.pl
@@ -4,11 +4,13 @@ eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' && eval 'exec perl -S $0 $
# This is an example of a crappy unstructured file but once
# I know what should happen exactly, I will clean it up.
+# once it works all right, afmpl will be default
+
# todo : ttf (partially doen already)
#D \module
#D [ file=texfont.pl,
-#D version=2004.01.10, % 2000.12.14
+#D version=2004.02.06, % 2000.12.14
#D title=Font Handling,
#D subtitle=installing and generating,
#D author=Hans Hagen ++,
@@ -47,47 +49,72 @@ $Getopt::Long::autoabbrev = 1 ; # partial switch accepted
my $dosish = ($Config{'osname'} =~ /^(ms)?dos|^os\/2|^(ms|cyg)win/i) ;
my $IsWin32 = ($^O =~ /MSWin32/i);
+my $SpacyPath = 0 ;
-BEGIN {
- $IsWin32 = ($^O =~ /MSWin32/i);
+# great, the win32api is not present in all perls
- if ($IsWin32) {
- require Win32::API; import Win32::API;
- }
+BEGIN {
+ $IsWin32 = ($^O =~ /MSWin32/i) ;
+ $SpacyPath = 0 ;
+ if ($IsWin32) {
+ my $str = `kpsewhich --expand-path=\$TEXMF` ;
+ $SpacyPath = ($str =~ / /) ;
+ if ($SpacyPath) {
+ require Win32::API; import Win32::API;
+ }
+ }
}
# great, glob changed to bsd glob in an incompatible way ... sigh, we now
# have to catch a failed glob returning the pattern
+#
+# to stupid either:
+#
+# sub validglob {
+# my @globbed = glob(shift) ;
+# if ((@globbed) && (! -e $globbed[0])) {
+# return () ;
+# } else {
+# return @globbed ;
+# }
+# }
+#
+# so now we have:
sub validglob {
my @globbed = glob(shift) ;
- if ((@globbed) && (! -e $globbed[0])) {
- return () ;
- } else {
- return @globbed ;
+ my @globout = () ;
+ foreach my $file (@globbed) {
+ push (@globout,$file) if (-e $file) ;
}
+ return @globout ;
}
sub GetShortPathName {
- my ($filename) = @_;
- return $filename unless ($IsWin32) ;
- my $GetShortPathName = new Win32::API('kernel32', 'GetShortPathName', 'PPN', 'N');
+ my ($filename) = @_ ;
+ return $filename unless (($IsWin32)&&($SpacyPath)) ;
+ my $GetShortPathName = new Win32::API('kernel32', 'GetShortPathName', 'PPN', 'N') ;
if(not defined $GetShortPathName) {
- die "Can't import API GetShortPathName: $!\n";
+ die "Can't import API GetShortPathName: $!\n" ;
}
my $buffer = " " x 260;
- my $len = $GetShortPathName->Call($filename, $buffer, 260);
- return substr($buffer, 0, $len); }
+ my $len = $GetShortPathName->Call($filename, $buffer, 260) ;
+ return substr($buffer, 0, $len) ;
+}
-my $installpath = "" ; my @searchpaths = () ;
+my $installpath = "" ;
-if (defined($ENV{TEXMFLOCAL})) { $installpath = "TEXMFLOCAL" }
-if (defined($ENV{TEXMFFONTS})) { $installpath = "TEXMFFONTS" }
+if (defined($ENV{TEXMFLOCAL})) {
+ $installpath = "TEXMFLOCAL" ;
+}
-# ($installpath eq "") { $installpath = "TEXMFFONTS" } # redundant
-if ($installpath eq "") { $installpath = "TEXMFLOCAL" } # redundant
+if (defined($ENV{TEXMFFONTS})) {
+ $installpath = "TEXMFFONTS" ;
+}
-@searchpaths = ('TEXMFFONTS','TEXMFLOCAL','TEXMFMAIN') ;
+if ($installpath eq "") {
+ $installpath = "TEXMFLOCAL" ; # redundant
+}
my $encoding = "texnansi" ;
my $vendor = "" ;
@@ -102,6 +129,7 @@ my $passon = "" ;
my $extend = "" ;
my $narrow = "" ;
my $slant = "" ;
+my $spaced = "" ;
my $caps = "" ;
my $noligs = 0 ;
my $test = 0 ;
@@ -110,6 +138,9 @@ my $novirtual = 0 ;
my $listing = 0 ;
my $remove = 0 ;
my $expert = 0 ;
+my $trace = 0 ;
+my $afmpl = 0 ;
+my $trees = 'TEXMFFONTS,TEXMFLOCAL,TEXMFEXTRA,TEXMFMAIN' ;
my $fontsuffix = "" ;
my $namesuffix = "" ;
@@ -124,13 +155,15 @@ my $variant = "" ; # atl: encoding variant
my $extension = "pfb" ; # atl: default font extension
my $lcdf = "" ; # atl: trigger for lcdf otftotfm
-my $pdfpath = 0 ;
-my $mappath = 'dvips' ;
+my $mappath = 'fonts/map' ; # will be set later
+my $encpath = 'fonts/enc' ; # will be set later
+
+my @cleanup = () ; # atl: build list of generated files to delete
# todo: parse name for style, take face from command line
#
# @Faces = ("Serif","Sans","Mono") ;
-# @Styles = ("Slanted","Italic","Bold","BoldSlanted","BoldItalic") ;
+# @Styles = ("Slanted","Spaced", "Italic","Bold","BoldSlanted","BoldItalic") ;
#
# for $fac (@Faces) { for $sty (@Styles) { $FacSty{"$fac$sty"} = "" } }
@@ -148,6 +181,7 @@ my $mappath = 'dvips' ;
"sourcepath=s" => \$sourcepath,
"passon=s" => \$passon,
"slant=s" => \$slant,
+ "spaced=s" => \$spaced,
"extend=s" => \$extend,
"narrow=s" => \$narrow,
"listing" => \$listing,
@@ -159,51 +193,68 @@ my $mappath = 'dvips' ;
"batch" => \$batch,
"weight=s" => \$weight,
"width=s" => \$width,
- "pdfpath" => \$pdfpath, # for old texmf trees < 2004
"expert" => \$expert,
+ "afmpl" => \$afmpl,
+ "afm2pl" => \$afmpl,
+ "rootlist=s" => \$trees,
+ "trace" => \$trace, # --verbose conflicts with --ve
"preproc" => \$preproc, # atl: trigger conversion to pfb
"lcdf" => \$lcdf ) ; # atl: trigger use of lcdf fonttoools
# for/from Fabrice:
my $own_path = "$FindBin::Bin/" ;
+
$FindBin::RealScript =~ m/([^\.]*)(\.pl|\.bat|\.exe|)/io ;
+
my $own_name = $1 ;
my $own_type = $2 ;
-my $own_stub = "" ;
-if ($own_type =~ /pl/oi) { $own_stub = "perl " }
+my $own_stub = "" ;
+
+if ($own_type =~ /pl/oi) {
+ $own_stub = "perl "
+}
+
+if ($caps) { $afmpl = 0 } # for the moment
# so we can use both combined
-if ($lcdf) { $novirtual = 1 }
-if (!$novirtual) { $virtual = 1 }
+if ($lcdf) {
+ $novirtual = 1 ;
+}
+
+if (!$novirtual) {
+ $virtual = 1 ;
+}
# starting with 2004 tetex/fptex/texlive will combine pdftex and dvips paths
-if ($pdfpath)
- { $mappath = 'pdftex' }
-else
- { $mappath = 'dvips' }
-
# A couple of routines.
-sub report
- { my $str = shift ;
+sub report {
+ my $str = shift ;
$str =~ s/ / /goi ;
- if ($str =~ /(.*?)\s+([\:\/])\s+(.*)/o)
- { if ($1 eq "") { $str = " " } else { $str = $2 }
- print sprintf("%22s $str %s\n",$1,$3) } }
+ if ($str =~ /(.*?)\s+([\:\/])\s+(.*)/o) {
+ if ($1 eq "") {
+ $str = " " ;
+ } else {
+ $str = $2 ;
+ }
+ print sprintf("%22s $str %s\n",$1,$3) ;
+ }
+}
-sub error
- { report("processing aborted : " . shift) ;
+sub error {
+ report("processing aborted : " . shift) ;
print "\n" ;
report "--help : show some more info" ;
- exit }
+ exit ;
+}
# The banner.
print "\n" ;
-report ("TeXFont 2.0 - ConTeXt / PRAGMA ADE 2000-2004") ;
+report ("TeXFont 2.2 - ConTeXt / PRAGMA ADE 2000-2004") ;
print "\n" ;
# Handy for scripts: one can provide a preferred path, if it
@@ -232,10 +283,14 @@ sub create_mm_font
error ("no amfm file found") unless (-f "$sourcepath/$name.amfm") ;
error ("no pfb file found") unless (-f "$sourcepath/$name.pfb") ;
$args = "$flag --precision=5 --kern-precision=0 --output=$sourcepath/$name$tags.afm" ;
- $ok = `mmafm $args $sourcepath/$name.amfm` ; chomp $ok ;
+ my $command = "mmafm $args $sourcepath/$name.amfm" ;
+ print "$command\n" if $trace ;
+ $ok = `$command` ; chomp $ok ;
if ($ok ne "") { report ("warning $ok") }
$args = "$flag --precision=5 --output=$sourcepath/$name$tags.pfb" ;
- $ok = `mmpfb $args $sourcepath/$name.pfb` ; chomp $ok ;
+ $command = "mmpfb $args $sourcepath/$name.pfb" ;
+ print "$command\n" if $trace ;
+ $ok = `$command` ; chomp $ok ;
if ($ok ne "") { report ("warning $ok") }
report ("mm result file : $name$tags") }
@@ -263,6 +318,7 @@ if ($test)
{ $vendor = $collection = "test" ;
$install = 1 }
+if (($spaced ne "") && ($spaced !~ /\d/)) { $spaced = "50" }
if (($slant ne "") && ($slant !~ /\d/)) { $slant = "0.167" }
if (($extend ne "") && ($extend !~ /\d/)) { $extend = "1.200" }
if (($narrow ne "") && ($narrow !~ /\d/)) { $narrow = "0.800" }
@@ -276,10 +332,15 @@ if ($encoding =~ /default/oi) { $encoding = "texnansi" }
my $lcfontroot = lc $fontroot ;
+# Auto search paths
+
+my @trees = split(/\,/,$trees) ;
+
# Test for help asked.
if ($help)
- { report "--fontroot=path : texmf font root (default: $lcfontroot)" ;
+ { report "--fontroot=path : texmf destination font root (default: $lcfontroot)" ;
+ report "--rootlist=paths : texmf source roots (default: $trees)" ;
report "--sourcepath=path : when installing, copy from this path (default: $sourcepath)" ;
report "--sourcepath=auto : locate and use vendor/collection" ;
print "\n" ;
@@ -288,6 +349,7 @@ if ($help)
report "--encoding=name : encoding vector (default: $encoding)" ;
report "--variant=name : encoding variant (.enc file or otftotfm features)" ;
print "\n" ;
+ report "--spaced=s : space glyphs in font by promille of em (0 - 1000)" ;
report "--slant=s : slant glyphs in font by factor (0.0 - 1.5)" ;
report "--extend=s : extend glyphs in font by factor (0.0 - 1.5)" ;
report "--caps=s : capitalize lowercase chars by factor (0.5 - 1.0)" ;
@@ -308,10 +370,9 @@ if ($help)
print "\n" ;
report "--expert : also handle expert fonts" ;
print "\n" ;
+ report "--afmpl : use afm2pl instead of afm2tfm" ;
report "--preproc : pre-process ttf/otf, converting them to pfb" ;
report "--lcdf : use lcdf fonttools to create virtual encoding" ;
- print "\n" ;
- report "--pdfpath : use /pdftex/config (since 2004: /dvips/config)" ;
exit }
if (($batch)||(($ARGV[0]) && ($ARGV[0] =~ /.+\.dat$/io)))
@@ -329,6 +390,7 @@ if (($batch)||(($ARGV[0]) && ($ARGV[0] =~ /.+\.dat$/io)))
if (open(BAT, $batchfile))
{ while (<BAT>)
{ chomp ;
+ s/(.+)\#.*/$1/o ;
next if (/^\s*$/io) ;
if ($select)
{ if ($selecting)
@@ -345,7 +407,9 @@ if (($batch)||(($ARGV[0]) && ($ARGV[0] =~ /.+\.dat$/io)))
report ("batch line : $_") ;
# system ("perl $0 --fontroot=$fontroot $_") }
my $own_quote = ( $own_path =~ m/^[^\"].* / ? "\"" : "" );
- system ("$own_stub$own_quote$own_path$own_name$own_type$own_quote --fontroot=$fontroot $_") }
+ my $switches = '' ;
+ $switches .= "--afmpl " if $afmpl ;
+ system ("$own_stub$own_quote$own_path$own_name$own_type$own_quote $switches --fontroot=$fontroot $_") }
close (BAT) }
exit }
@@ -354,27 +418,90 @@ error ("unknown collection $collection") unless $collection ;
error ("unknown tex root $lcfontroot") unless -d $fontroot ;
my $varlabel = $variant ;
+
if ($lcdf)
-{ $varlabel =~ s/,/-/goi ;
- $varlabel =~ tr/a-z/A-Z/ }
+ { $varlabel =~ s/,/-/goi ;
+ $varlabel =~ tr/a-z/A-Z/ }
if ($varlabel ne "")
-{ $varlabel = "-$varlabel" }
+ { $varlabel = "-$varlabel" }
my $identifier = "$encoding$varlabel-$vendor-$collection" ;
my $outlinepath = $sourcepath ; my $path = "" ;
-if ($sourcepath eq "auto")
- { foreach my $root (@searchpaths)
+my $shape = "" ;
+
+if ($noligs)
+ { report ("ligatures : removed") ;
+ $fontsuffix .= "-unligatured" ;
+ $namesuffix .= "-NoLigs" }
+
+if ($caps ne "")
+ { if ($caps <0.5) { $caps = 0.5 }
+ elsif ($caps >1.0) { $caps = 1.0 }
+ $shape .= " -c $caps " ;
+ report ("caps factor : $caps") ;
+ $fontsuffix .= "-capitalized-" . int(1000*$caps) ;
+ $namesuffix .= "-Caps" }
+
+if ($extend ne "")
+ { if ($extend<0.0) { $extend = 0.0 }
+ elsif ($extend>1.5) { $extend = 1.5 }
+ report ("extend factor : $extend") ;
+ if ($lcdf)
+ { $shape .= " -E $extend " }
+ else
+ { $shape .= " -e $extend " }
+ $fontsuffix .= "-extended-" . int(1000*$extend) ;
+ $namesuffix .= "-Extended" }
+
+if ($narrow ne "") # goodie
+ { $extend = $narrow ;
+ if ($extend<0.0) { $extend = 0.0 }
+ elsif ($extend>1.5) { $extend = 1.5 }
+ report ("narrow factor : $extend") ;
+ if ($lcdf)
+ { $shape .= " -E $extend " }
+ else
+ { $shape .= " -e $extend " }
+ $fontsuffix .= "-narrowed-" . int(1000*$extend) ;
+ $namesuffix .= "-Narrowed" }
+
+if ($slant ne "")
+ { if ($slant <0.0) { $slant = 0.0 }
+ elsif ($slant >1.5) { $slant = 1.5 }
+ report ("slant factor : $slant") ;
+ if ($lcdf)
+ { $shape .= " -S $slant " }
+ else
+ { $shape .= " -s $slant " }
+ $fontsuffix .= "-slanted-" . int(1000*$slant) ;
+ $namesuffix .= "-Slanted" }
+
+if ($spaced ne "")
+ { if ($spaced < 0) { $spaced = 0 }
+ elsif ($spaced >1000) { $spaced = 1000 }
+ report ("space factor : $spaced") ;
+ if ($lcdf)
+ { $shape .= " -L $spaced " }
+ else
+ { $shape .= " -m $spaced " }
+ $fontsuffix .= "-spaced-" . $spaced ;
+ $namesuffix .= "-Spaced" }
+
+if ($sourcepath eq "auto") # todo uppercase root
+ { foreach my $root (@trees)
{ if ($dosish)
{ $path = `kpsewhich -expand-path=\$$root` }
else
{ $path = `kpsewhich -expand-path=\\\$$root` }
chomp $path ;
- if ($preproc)
+ $path = $ENV{$root} if (($path == '') && defined($ENV{$root})) ;
+ report ("checking root : $root") ;
+ if ($preproc)
{ $sourcepath = "$path/fonts/truetype/$vendor/$collection" }
- else
+ else
{ $sourcepath = "$path/fonts/afm/$vendor/$collection" }
unless (-d $sourcepath)
{ my $ven = $vendor ; $ven =~ s/(........).*/$1/ ;
@@ -391,52 +518,53 @@ if ($sourcepath eq "auto")
{ @files = validglob("$sourcepath/*.otf") ;
report("locating : otf files") }
unless (@files)
- { @files = validglob("$sourcepath/*.ttf") ;
+ { @files = validglob("$sourcepath/*.ttf") ;
report("locating : ttf files") }
- if (@files)
- { if ($listing)
- { report ("fontpath : $sourcepath" ) ;
- print "\n" ;
- foreach my $file (@files)
- { if (open(AFM,$file))
- { my $name = "unknown name" ;
- while (<AFM>)
- { chomp ;
- if (/^fontname\s+(.*?)$/oi)
- { $name = $1 ; last } }
- close (AFM) ;
- if ($preproc)
- { $file =~ s/.*\/(.*)\..tf/$1/io }
- else
- { $file =~ s/.*\/(.*)\.afm/$1/io }
- report ("$file : $name") } }
- exit }
- elsif ($remove)
- { error ("no removal from : $root") if ($root eq 'TEXMFMAIN') ;
- foreach my $file (@files)
- { if ($preproc)
+ if (@files)
+ { if ($listing)
+ { report ("fontpath : $sourcepath" ) ;
+ print "\n" ;
+ foreach my $file (@files)
+ { if (open(AFM,$file))
+ { my $name = "unknown name" ;
+ while (<AFM>)
+ { chomp ;
+ if (/^fontname\s+(.*?)$/oi)
+ { $name = $1 ; last } }
+ close (AFM) ;
+ if ($preproc)
{ $file =~ s/.*\/(.*)\..tf/$1/io }
- else
+ else
{ $file =~ s/.*\/(.*)\.afm/$1/io }
- foreach my $sub ("tfm","vf")
- { foreach my $typ ("","-raw")
- { my $nam = "$path/fonts/$sub/$vendor/$collection/$encoding$varlabel$typ-$file.$sub" ;
- if (-s $nam)
- { report ("removing : $encoding$varlabel$typ-$file.$sub") ;
- unlink $nam } } } }
- my $nam = "$encoding$varlabel-$vendor-$collection.tex" ;
- if (-e $nam)
- { report ("removing : $nam") ;
- unlink "$nam" }
- my $mapfile = "$encoding$varlabel-$vendor-$collection" ;
- my $maproot = "$fontroot/$mappath/config/";
- if (-e "$maproot$mapfile.map")
- { report ("renaming : $mapfile.map -> $mapfile.bak") ;
- unlink "$maproot$mapfile.bak" ;
- rename "$maproot$mapfile.map", "$maproot$mapfile.bak" }
- exit }
- else
- { last } } } }
+ report ("$file : $name") } }
+ exit }
+ elsif ($remove)
+ { error ("no removal from : $root") if ($root eq 'TEXMFMAIN') ;
+ foreach my $file (@files)
+ { if ($preproc)
+ { $file =~ s/.*\/(.*)\..tf/$1/io }
+ else
+ { $file =~ s/.*\/(.*)\.afm/$1/io }
+ foreach my $sub ("tfm","vf")
+ { foreach my $typ ("","-raw")
+ { my $nam = "$path/fonts/$sub/$vendor/$collection/$encoding$varlabel$typ-$file.$sub" ;
+ # { my $nam = "$path/fonts/$sub/$vendor/$collection/$encoding$varlabel$typ-$file$fontsuffix.$sub" ;
+ if (-s $nam)
+ { report ("removing : $encoding$varlabel$typ-$file.$sub") ;
+ unlink $nam } } } }
+ my $nam = "$encoding$varlabel-$vendor-$collection.tex" ;
+ if (-e $nam)
+ { report ("removing : $nam") ;
+ unlink "$nam" }
+ my $mapfile = "$encoding$varlabel-$vendor-$collection" ;
+ my $maproot = "$fontroot/fonts/map/";
+ if (-e "$maproot$mapfile.map")
+ { report ("renaming : $mapfile.map -> $mapfile.bak") ;
+ unlink "$maproot$mapfile.bak" ;
+ rename "$maproot$mapfile.map", "$maproot$mapfile.bak" }
+ exit }
+ else
+ { last } } } }
error ("unknown subpath ../fonts/afm/$vendor/$collection") unless -d $sourcepath }
error ("unknown source path $sourcepath") unless -d $sourcepath ;
@@ -447,8 +575,8 @@ my $tfmpath = "$fontroot/fonts/tfm/$vendor/$collection" ;
my $vfpath = "$fontroot/fonts/vf/$vendor/$collection" ;
my $pfbpath = "$fontroot/fonts/type1/$vendor/$collection" ;
my $ttfpath = "$fontroot/fonts/truetype/$vendor/$collection" ;
-my $pdfpath = "$fontroot/$mappath/config" ;
-my $encpath = "$fontroot/dvips/local" ;
+my $mappath = "$fontroot/fonts/map" ;
+my $encpath = "$fontroot/fonts/enc" ;
# are not on local path ! ! ! !
@@ -472,12 +600,14 @@ sub make_path
if ($makepath&&$install)
{ make_path ("afm") ; make_path ("type1") }
-do_make_path("$fontroot/$mappath") ;
-do_make_path("$fontroot/$mappath/config") ;
+do_make_path($mappath) ;
+do_make_path($encpath) ;
-if ($lcdf)
- { do_make_path("$fontroot/dvips") ;
- do_make_path("$fontroot/dvips/local") }
+# now fonts/map and fonts/enc
+#
+# if ($lcdf)
+# { do_make_path("$fontroot/dvips") ;
+# do_make_path("$fontroot/dvips/local") }
make_path ("vf") ;
make_path ("tfm") ;
@@ -488,7 +618,7 @@ if ($install)
error ("unknown tfm path $tfmpath") unless -d $tfmpath ;
error ("unknown vf path $vfpath" ) unless -d $vfpath ;
-error ("unknown pdf path $pdfpath") unless -d $pdfpath ;
+error ("unknown map path $mappath") unless -d $mappath ;
my $mapfile = "$identifier.map" ;
my $bakfile = "$identifier.bak" ;
@@ -510,6 +640,11 @@ my $runpath = $sourcepath ;
my @files ;
+sub UnLink
+ { foreach my $f (@_)
+ { if (unlink $f)
+ { report "deleted : $f" if $trace } } }
+
sub globafmfiles
{ my ($runpath, $pattern) = @_ ;
my @files = validglob("$runpath/$pattern.afm") ;
@@ -529,8 +664,11 @@ sub globafmfiles
$extension = "ttf" ;
foreach my $file (@files)
{ $file =~ s/\.ttf$//io ;
- report ("generating afm file : $file.afm") ;
- system("ttf2afm '$file.ttf' -o '$file.afm'") }
+ report ("generating afm file : $file.afm") ;
+ my $command = "ttf2afm \"$file.ttf\" -o \"$file.afm\"" ;
+ system($command) ;
+ print "$command\n" if $trace ;
+ push(@cleanup, "$file.afm") }
@files = validglob("$runpath/$pattern.afm") }
else # try doing the pre-processing earlier
{ report("locating afm files : using otf files") ;
@@ -540,10 +678,14 @@ sub globafmfiles
{ $file =~ s/\.otf$//io ;
if (!$lcdf)
{ report ("generating afm file : $file.afm") ;
- preprocess_font("$file.otf", "$file.bdf") }
+ preprocess_font("$file.otf", "$file.bdf") ;
+ push(@cleanup,"$file.afm") }
if ($preproc)
- { system("cfftot1 --output=$file.pfb $file.otf") ;
+ { my $command = "cfftot1 --output=$file.pfb $file.otf" ;
+ print "$command\n" if $trace ;
report("converting : $file.otf to $file.pfb") ;
+ system($command) ;
+ push(@cleanup, "$file.pfb") ;
}
}
if ($lcdf)
@@ -554,12 +696,11 @@ sub globafmfiles
}
return @files }
-
if ($ARGV[0] ne "")
{ $pattern = $ARGV[0] ;
report ("processing files : all in pattern $ARGV[0]") ;
@files = globafmfiles($runpath,$pattern) }
-elsif ("$extend$narrow$slant$caps" ne "")
+elsif ("$extend$narrow$slant$spaced$caps" ne "")
{ error ("transformation needs file spec") }
else
{ $pattern = "*" ;
@@ -574,7 +715,7 @@ sub copy_files
foreach my $file (@files)
{ my $ok = $file =~ /(.*)\/(.+?)\.(.*)/ ;
my ($path,$name,$suffix) = ($1,$2,$3) ;
- unlink "$topath/$name.$suffix" ;
+ UnLink "$topath/$name.$suffix" ;
report ("copying : $name.$suffix") ;
copy ($file,"$topath/$name.$suffix") } }
@@ -593,14 +734,14 @@ error ("no afm files found") unless @files ;
my $map = my $tex = 0 ; my $mapdata = my $texdata = "" ;
-copy ("$pdfpath/$mapfile","$pdfpath/$bakfile") ;
+copy ("$mappath/$mapfile","$mappath/$bakfile") ;
-if (open (MAP,"<$pdfpath/$mapfile"))
- { report ("extending map file : $pdfpath/$mapfile") ;
+if (open (MAP,"<$mappath/$mapfile"))
+ { report ("extending map file : $mappath/$mapfile") ;
while (<MAP>) { unless (/^\%/o) { $mapdata .= $_ } }
close (MAP) }
else
- { report ("no map file at : $pdfpath/$mapfile") }
+ { report ("no map file at : $mappath/$mapfile") }
if (open (TEX,"<$texfile"))
{ while (<TEX>) { unless (/stoptext/o) { $texdata .= $_ } }
@@ -640,46 +781,6 @@ if ($tex)
{ print TEX "$texdata" ;
print TEX "\n\%appended section\n\n\\page\n\n" } }
-my $shape = "" ;
-
-if ($noligs)
- { report ("ligatures : removed") ;
- $fontsuffix .= "-unligatured" ;
- $namesuffix .= "-NoLigs" }
-
-if ($caps ne "")
- { if ($caps <0.5) { $caps = 0.5 }
- elsif ($caps >1.0) { $caps = 1.0 }
- $shape .= " -c $caps " ;
- report ("caps factor : $caps") ;
- $fontsuffix .= "-capitalized-" . int(1000*$caps) ;
- $namesuffix .= "-Caps" }
-
-if ($extend ne "")
- { if ($extend<0.0) { $extend = 0.0 }
- elsif ($extend>1.5) { $extend = 1.5 }
- report ("extend factor : $extend") ;
- $shape .= " -e $extend " ;
- $fontsuffix .= "-extended-" . int(1000*$extend) ;
- $namesuffix .= "-Extended" }
-
-if ($narrow ne "") # goodie
- { $extend = $narrow ;
- if ($extend<0.0) { $extend = 0.0 }
- elsif ($extend>1.5) { $extend = 1.5 }
- report ("narrow factor : $extend") ;
- $shape .= " -e $extend " ;
- $fontsuffix .= "-narrowed-" . int(1000*$extend) ;
- $namesuffix .= "-Narrowed" }
-
-if ($slant ne "")
- { if ($slant <0.0) { $slant = 0.0 }
- elsif ($slant >1.5) { $slant = 1.5 }
- report ("slant factor : $slant") ;
- $shape .= " -s $slant " ;
- $fontsuffix .= "-slanted-" . int(1000*$slant) ;
- $namesuffix .= "-Slanted" }
-
sub removeligatures
{ my $filename = shift ; my $skip = 0 ;
copy ("$filename.vpl","$filename.tmp") ;
@@ -694,7 +795,7 @@ sub removeligatures
else
{ print VPL "$_\n" } }
close(TMP) ; close(VPL) }
- unlink ("$filename.tmp") }
+ UnLink ("$filename.tmp") }
my $raw = my $use = my $maplist = my $texlist = my $report = "" ;
@@ -719,7 +820,7 @@ sub preprocess_font
close (CONVERT) }
foreach my $file (@files)
- { my $option = my $slant = my $extend = my $vfstr = my $encstr = "" ;
+ { my $option = my $slant = my $spaced = my $extend = my $vfstr = my $encstr = "" ;
my $strange = "" ; my ($rawfont,$cleanfont,$restfont) ;
$file = $file ;
my $ok = $file =~ /(.*)\/(.+?)\.(.*)/ ;
@@ -738,9 +839,9 @@ foreach my $file (@files)
$file = "$afmpath/$cleanname.afm" }
# cleanup
foreach my $suf ("tfm", "vf", "vpl")
- { unlink "$raw$cleanname$fontsuffix.$suf" ;
- unlink "$use$cleanname$fontsuffix.$suf" }
- unlink "texfont.log" ;
+ { UnLink "$raw$cleanname$fontsuffix.$suf" ;
+ UnLink "$use$cleanname$fontsuffix.$suf" }
+ UnLink "texfont.log" ;
# set switches
if ($encoding ne "")
{ $encstr = " -T $encfil" }
@@ -751,12 +852,16 @@ foreach my $file (@files)
my $font = "";
# let's see what we have here (we force texnansi.enc to avoid error messages)
if ($lcdf)
- { $font = `otfinfo -p $file` ;
+ { my $command = "otfinfo -p $file" ;
+ print "$command\n" if $trace ;
+ $font = `$command` ;
chomp $font ;
$cleanfont = $font }
else
- { $font = `afm2tfm '$file' -p texnansi.enc texfont.tfm`;
- unlink "texfont.tfm" ;
+ { my $command = "afm2tfm \"$file\" -p texnansi.enc texfont.tfm" ;
+ print "$command\n" if $trace ;
+ $font = `$command` ;
+ UnLink "texfont.tfm" ;
($rawfont,$cleanfont,$restfont) = split(/\s/,$font) }
if ($font =~ /(math|expert)/io) { $strange = lc $1 }
$cleanfont =~ s/\_/\-/goi ;
@@ -766,13 +871,15 @@ foreach my $file (@files)
{ report ("font identifier : $cleanfont$namesuffix -> $strange -> tfm") }
elsif ($strange ne "")
{ report ("font identifier : $cleanfont$namesuffix -> $strange -> skipping") }
+ elsif ($afmpl)
+ { report ("font identifier : $cleanfont$namesuffix -> text -> tfm") }
elsif ($virtual)
{ report ("font identifier : $cleanfont$namesuffix -> text -> tfm + vf") }
else
{ report ("font identifier : $cleanfont$namesuffix -> text -> tfm") }
# don't handle strange fonts
if ($strange eq "")
- { # atl: experimental support for lcdf otftotfm
+ { # atl: support for lcdf otftotfm
if ($lcdf && $extension eq "otf")
{ # no vf, bypass afm, use otftotfm to get encoding and tfm
my $varstr = my $encout = my $tfmout = "" ;
@@ -787,37 +894,61 @@ foreach my $file (@files)
$encout = "$encpath/$use$cleanfont.enc" ;
if (-e $encout)
{ report ("renaming : $encout -> $use$cleanfont.bak") ;
- unlink "$encpath/$use$cleanfont.bak" ;
+ UnLink "$encpath/$use$cleanfont.bak" ;
rename $encout, "$encpath/$use$cleanfont.bak" }
- unlink "texfont.map" ;
- $tfmout = "$use$cleanfont" ;
- my $otfcommand = "otftotfm -a $varstr $encstr $shape --name=\'$tfmout\' --encoding-dir=\'$encpath/\' --tfm-dir=\'$tfmpath/\' --vf-dir=\'$vfpath/\' --no-type1 --map-file=./texfont.map \'$file\'" ;
- print "$otfcommand\n" ;
+ UnLink "texfont.map" ;
+ $tfmout = "$use$cleanfont$fontsuffix" ;
+ my $otfcommand = "otftotfm -a $varstr $encstr $passon $shape --name=\'$tfmout\' --encoding-dir=\'$encpath/\' --tfm-dir=\'$tfmpath/\' --vf-dir=\'$vfpath/\' --no-type1 --map-file=./texfont.map \'$file\'" ;
+ print "$otfcommand\n" if $trace ;
system("$otfcommand") ;
-# $namesuffix = "--base" ; #atl: lcdf currently appends --base to the filename...sometimes
$encfil = $encout }
else
{ # generate tfm and vpl, $file is on afm path
- report "generating raw tfm/vpl : $raw$cleanname$fontsuffix (from $cleanname)" ;
- my $font = `afm2tfm $file $shape $passon $encstr $vfstr $raw$cleanname$fontsuffix` ;
- # generate vf file if needed
- chomp $font ;
- if ($font =~ /.*?([\d\.]+)\s*ExtendFont/io) { $extend = $1 }
- if ($font =~ /.*?([\d\.]+)\s*SlantFont/io) { $slant = $1 }
- if ($extend ne "") { $option .= " $1 ExtendFont " }
- if ($slant ne "") { $option .= " $1 SlantFont " }
- if ($noligs) { removeligatures("$raw$cleanname$fontsuffix") }
- if ($virtual)
- { report "generating new vf : $use$cleanname$fontsuffix (from $raw$cleanname)" ;
- my $ok = `vptovf $raw$cleanname$fontsuffix.vpl $use$cleanname$fontsuffix.vf $use$cleanname$fontsuffix.tfm ` }
- else
- { report "generating new tfm : $use$cleanname$fontsuffix (from $raw$cleanname)" ;
- my $ok = `pltotf $raw$cleanname$fontsuffix.vpl $use$cleanname$fontsuffix.tfm ` } } }
+ my $font = '' ;
+ if ($afmpl)
+ { report " generating pl : $cleanname$fontsuffix (from $cleanname)" ;
+ $encstr = " -p $encfil" ;
+ my $command = "afm2pl $shape $passon $encstr $file $cleanname$fontsuffix.vpl" ;
+ print "$command\n" if $trace ;
+ my $ok = `$command` ;
+ if (open (TMP,"$cleanname$fontsuffix.map"))
+ { $font = <TMP> ;
+ close(TMP) ;
+ UnLink "$cleanname$fontsuffix.map" } }
+ else
+ { report "generating raw tfm/vpl : $raw$cleanname$fontsuffix (from $cleanname)" ;
+ my $command = "afm2tfm $file $shape $passon $encstr $vfstr $raw$cleanname$fontsuffix" ;
+ print "$command\n" if $trace ;
+ $font = `$command` }
+ # generate vf file if needed
+ chomp $font ;
+ if ($font =~ /.*?([\d\.]+)\s*ExtendFont/io) { $extend = $1 }
+ if ($font =~ /.*?([\d\.]+)\s*SlantFont/io) { $slant = $1 }
+ if ($extend ne "") { $option .= " $1 ExtendFont " }
+ if ($slant ne "") { $option .= " $1 SlantFont " }
+ if ($noligs) { removeligatures("$raw$cleanname$fontsuffix") }
+ if ($afmpl)
+ { report "generating new tfm : $use$cleanname$fontsuffix" ;
+ my $command = "pltotf $cleanname$fontsuffix.vpl $use$cleanname$fontsuffix.tfm" ;
+ print "$command\n" if $trace ;
+ my $ok = `$command` }
+ elsif ($virtual)
+ { report "generating new vf : $use$cleanname$fontsuffix (from $raw$cleanname)" ;
+ my $command = "vptovf $raw$cleanname$fontsuffix.vpl $use$cleanname$fontsuffix.vf $use$cleanname$fontsuffix.tfm" ;
+ print "$command\n" if $trace ;
+ my $ok = `$command` }
+ else
+ { report "generating new tfm : $use$cleanname$fontsuffix (from $raw$cleanname)" ;
+ my $command = "pltotf $raw$cleanname$fontsuffix.vpl $use$cleanname$fontsuffix.tfm" ;
+ print "$command\n" if $trace ;
+ my $ok = `$command` } } }
elsif (-e "$sourcepath/$cleanname.tfm" )
{ report "using existing tfm : $cleanname.tfm" }
elsif (($strange eq "expert")&&($expert))
{ report "creating tfm file : $cleanname.tfm" ;
- my $font = `afm2tfm $file $cleanname.tfm` }
+ my $command = "afm2tfm $file $cleanname.tfm" ;
+ print "$command\n" if $trace ;
+ my $font = `$command` }
else
{ report "use supplied tfm : $cleanname" }
# report results
@@ -828,30 +959,36 @@ foreach my $file (@files)
# copy files
my $usename = "$use$cleanname$fontsuffix" ;
my $rawname = "$raw$cleanname$fontsuffix" ;
+
if ($lcdf eq "")
{ if ($strange ne "")
- { unlink "$vfpath/$cleanname.vf", "$tfmpath/$cleanname.tfm" ;
+ { UnLink ("$vfpath/$cleanname.vf", "$tfmpath/$cleanname.tfm") ;
copy ("$cleanname.tfm","$tfmpath/$cleanname.tfm") ;
+ copy ("$usename.tfm","$tfmpath/$usename.tfm") ;
# or when available, use vendor one :
copy ("$sourcepath/$cleanname.tfm","$tfmpath/$cleanname.tfm") }
elsif ($virtual)
- { unlink "$vfpath/$rawname.vf", "$vfpath/$usename.vf" ;
- unlink "$tfmpath/$rawname.tfm", "$tfmpath/$usename.tfm" ;
+ { UnLink ("$vfpath/$rawname.vf", "$vfpath/$usename.vf") ;
+ UnLink ("$tfmpath/$rawname.tfm", "$tfmpath/$usename.tfm") ;
copy ("$usename.vf" ,"$vfpath/$usename.vf") ;
copy ("$rawname.tfm","$tfmpath/$rawname.tfm") ;
copy ("$usename.tfm","$tfmpath/$usename.tfm") }
+ elsif ($afmpl)
+ { UnLink ("$vfpath/$rawname.vf", "$vfpath/$usename.vf", "$vfpath/$cleanname.vf") ;
+ UnLink ("$tfmpath/$rawname.tfm", "$tfmpath/$usename.tfm", "$tfmpath/$cleanname.tfm") ;
+ copy ("$usename.tfm","$tfmpath/$usename.tfm") }
else
- { unlink "$vfpath/$usename.vf", "$tfmpath/$usename.tfm" ;
+ { UnLink ("$vfpath/$usename.vf", "$tfmpath/$usename.tfm") ;
# slow but prevents conflicting vf's
my $rubish = `kpsewhich $usename.vf` ; chomp $rubish ;
- if ($rubish ne "") { unlink $rubish }
+ if ($rubish ne "") { UnLink $rubish }
#
copy ("$usename.tfm","$tfmpath/$usename.tfm") } }
# cleanup
foreach my $suf ("tfm", "vf", "vpl")
- { unlink "$rawname.$suf", unlink "$usename.$suf" ;
- unlink "$cleanname.$suf", unlink "$fontname.$suf" ;
- unlink "$fontname$fontsuffix.$suf" }
+ { UnLink ("$rawname.$suf", "$usename.$suf") ;
+ UnLink ("$cleanname.$suf", "$fontname.$suf") ;
+ UnLink ("$cleanname$fontsuffix.$suf", "$fontname$fontsuffix.$suf") }
# add line to maps file
$option =~ s/^\s+(.*)/$1/o ;
$option =~ s/(.*)\s+$/$1/o ;
@@ -866,6 +1003,8 @@ foreach my $file (@files)
{ $thename = $cleanname ; $theencoding = "" ; }
elsif ($lcdf)
{ $thename = $usename ; $theencoding = " $encoding$varlabel-$cleanname.enc" }
+ elsif ($afmpl)
+ { $thename = $usename ; $theencoding = " $encoding$varlabel.enc" }
elsif ($virtual)
{ $thename = $rawname ; $theencoding = " $encoding$varlabel.enc" }
else
@@ -874,60 +1013,78 @@ foreach my $file (@files)
my $pfb_sourcepath = $sourcepath ;
$pfb_sourcepath =~ s@/afm/@/type1/@ ;
unless ((-e "$pfbpath/$fontname.$extension")||
- (-e "$pfb_sourcepath/$fontname.$extension")||
- (-e "$sourcepath/$fontname.$extension")||
+ (-e "$pfb_sourcepath/$fontname.$extension")||
+ (-e "$sourcepath/$fontname.$extension")||
(-e "$ttfpath/$fontname.$extension"))
{ if ($tex) { $report .= "missing file: \\type \{$fontname.pfb\}\n" }
report ("missing pfb file : $fontname.pfb") }
# now add entry to map
- if ($strange eq "")
- { if ($extension eq "otf")
- { if ($lcdf)
- { my $mapline = "";
- if (open(ALTMAP,"texfont.map"))
- { while (<ALTMAP>)
- { chomp ;
- # atl: we assume this b/c we always force otftotfm --no-type1
- if (/<<(.*)\.otf$/oi)
- { $mapline = $_ ; last } }
- close(ALTMAP) }
- else
- { report("no mapfile from otftotfm : texfont.map") }
- if ($preproc)
- { $mapline =~ s/^(\S+)/$1 </;
- $mapline =~ s/<<(\S+)\.otf$// }
- else
- { $mapline =~ s/<<(\S+)\.otf$/<< $ttfpath\/$fontname.$extension/ }
- $str = "$mapline\n" }
- else
- { if ($preproc)
- { $str = "$thename $cleanfont $option < $fontname.pfb$theencoding\n"}
- else
- # PdfTeX can't subset OTF files, so we have to include the whole thing
- # It looks like we also need to be explicit on where to find the file
- { $str = "$thename $cleanfont $option << $ttfpath/$fontname.$extension <[$theencoding\n" } } }
- else
- { $str = "$thename $cleanfont $option < $fontname.$extension$theencoding\n" } }
- else
- { $str = "$thename $cleanfont < $fontname.$extension\n" }
- if ($map) # check for redundant entries
- { $mapdata =~ s/^$thename\s.*?$//gmis ;
+ if ($strange eq "") {
+ if ($extension eq "otf") {
+ if ($lcdf) {
+ my $mapline = "" ;
+ if (open(ALTMAP,"texfont.map")) {
+ while (<ALTMAP>) {
+ chomp ;
+ # atl: we assume this b/c we always force otftotfm --no-type1
+ if (/<<(.*)\.otf$/oi) {
+ $mapline = $_ ; last ;
+ }
+ }
+ close(ALTMAP) ;
+ } else {
+ report("no mapfile from otftotfm : texfont.map") ;
+ }
+ if ($preproc) {
+ $mapline =~ s/^(\S+)/$1 </;
+ $mapline =~ s/<<(\S+)\.otf$// ;
+ } else {
+ $mapline =~ s/<<(\S+)\.otf$/<< $ttfpath\/$fontname.$extension/ ;
+ }
+ $str = "$mapline\n" ;
+ } else {
+ if ($preproc) {
+ $str = "$thename $cleanfont $option < $fontname.pfb$theencoding\n" ;
+ } else {
+ # PdfTeX can't subset OTF files, so we have to include the whole thing
+ # It looks like we also need to be explicit on where to find the file
+ $str = "$thename $cleanfont $option << $ttfpath/$fontname.$extension <[$theencoding\n" ;
+ }
+ }
+ } else {
+ $str = "$thename $cleanfont $option < $fontname.$extension$theencoding\n" ;
+ }
+ } else {
+ $str = "$thename $cleanfont < $fontname.$extension\n" ;
+ }
+ # check for redundant entries
+ if ($map) {
+ $mapdata =~ s/^$thename\s.*?$//gmis ;
+ if ($afmpl) {
+ if ($mapdata =~ s/^$rawname\s.*?$//gmis) {
+ report ("removing conflicting file : $rawname") ;
+ }
+ }
$maplist .= $str ;
- $mapdata .= $str }
+ $mapdata .= $str ;
+ }
# write lines to tex file
- if (($strange eq "expert")&&($expert))
- { $fntlist .= "\\definefontsynonym[$cleanfont$namesuffix][$cleanname] \% expert\n" }
- elsif ($strange ne "")
- { $fntlist .= "\%definefontsynonym[$cleanfont$namesuffix][$cleanname]\n" }
- else
- { $fntlist .= "\\definefontsynonym[$cleanfont$namesuffix][$usename][encoding=$encoding]\n" }
+ if (($strange eq "expert")&&($expert)) {
+ $fntlist .= "\\definefontsynonym[$cleanfont$namesuffix][$cleanname] \% expert\n" ;
+ } elsif ($strange ne "") {
+ $fntlist .= "\%definefontsynonym[$cleanfont$namesuffix][$cleanname]\n" ;
+ } else {
+ $fntlist .= "\\definefontsynonym[$cleanfont$namesuffix][$usename][encoding=$encoding]\n" ;
+ }
next unless $tex ;
- if (($strange eq "expert")&&($expert))
- { $texlist .= "\\ShowFont[$cleanfont$namesuffix][$cleanname]\n" }
- elsif ($strange ne "")
- { $texlist .= "\%ShowFont[$cleanfont$namesuffix][$cleanname]\n" }
- else
- { $texlist .= "\\ShowFont[$cleanfont$namesuffix][$usename][$encoding]\n" } }
+ if (($strange eq "expert")&&($expert)) {
+ $texlist .= "\\ShowFont[$cleanfont$namesuffix][$cleanname]\n" ;
+ } elsif ($strange ne "") {
+ $texlist .= "\%ShowFont[$cleanfont$namesuffix][$cleanname]\n" ;
+ } else {
+ $texlist .= "\\ShowFont[$cleanfont$namesuffix][$usename][$encoding]\n"
+ }
+}
if ($map)
{ report ("updating map file : $mapfile") ;
@@ -936,7 +1093,7 @@ if ($map)
print MAP $mapdata }
if ($tex)
- { $pdfpath =~ s/\\/\//go ;
+ { $mappath =~ s/\\/\//go ;
$savedoptions =~ s/^\s+//gmois ; $savedoptions =~ s/\s+$//gmois ;
$fntlist =~ s/^\s+//gmois ; $fntlist =~ s/\s+$//gmois ;
$maplist =~ s/^\s+//gmois ; $maplist =~ s/\s+$//gmois ;
@@ -949,7 +1106,7 @@ if ($tex)
print TEX "\\stoptyping\n" ;
print TEX "\n" ;
print TEX "\\starttyping\n" ;
- print TEX "$pdfpath/$mapfile\n" ;
+ print TEX "$mappath/$mapfile\n" ;
print TEX "\\stoptyping\n" ;
print TEX "\n" ;
print TEX "\\starttyping\n" ;
@@ -969,9 +1126,11 @@ if ($tex)
if ($map) { close (MAP) }
if ($tex) { close (TEX) }
-# unlink "$pdfpath/$mapfile" ; # can be same
+copy ($mapfile,"$mappath/$mapfile") ;
+
+# atl: global cleanup with generated files (afm & ttf don't mix)
-copy ($mapfile,"$pdfpath/$mapfile") ;
+UnLink(@cleanup) ;
print "\n" ; report ("generating : ls-r databases") ;