X-Git-Url: https://melusine.eu.org/syracuse/G/git/?a=blobdiff_plain;f=opt%2Fpsftopst.pl;h=7cd5f5145493234c76233132ca645262f37836fd;hb=2073587ccf8518370f5bccac9f1c045f64c96e0e;hp=c577a1eb99d7cabeebd9c20147419db36dcd7734;hpb=b2262dadfc33a16c396136b8b0aa6f3c8bc34e00;p=pst-anamorphosis.git diff --git a/opt/psftopst.pl b/opt/psftopst.pl index c577a1e..7cd5f51 100755 --- a/opt/psftopst.pl +++ b/opt/psftopst.pl @@ -9,7 +9,7 @@ use strict; # http://melusine.eu.org/syracuse/G/git/?p=pst-anamorphosis.git git # ============================================================================== -our $windows_pstoedit = ""; +our $windows_pstoedit = ''; our $on_windows = $^O =~ /^MSWin/; our $GS = $on_windows ? "gswin32c" : "gs"; @@ -18,11 +18,11 @@ our $PS = $on_windows ? $windows_pstoedit : "pstoedit"; # === Acquisition des options de la ligne de commande ------------------------- $::opt_dimmax = 4; # Dimension maximale : 4 cm par défaut -$::opt_t = 0; # Transformation initiale par pstoedit +$::opt_ps = 0; # Transformation initiale par pstoedit use Getopt::Long; GetOptions( "dimmax=s", - "t" + "ps" ); our $debug = 1; @@ -37,11 +37,11 @@ our $Fichier = $ARGV[0]; our ($Nom, $Dir, $Ext) = &FichierNRE($Fichier); # === Transformation éventuelle par pstoedit ----------------------------------- -if ($::opt_t) { +if ($::opt_ps) { use File::Copy; - my $f = "$Nom-original$Ext"; + my $f = "$Nom-original.$Ext"; copy($Fichier, $f); - my @a = ($PS, "-f ps", $f, $Fichier); + my @a = ($PS, "-f", "ps", $f, $Fichier); $debug and print STDERR "Processing by pstoedit...\n"; system(@a) == 0 or die "Running pstoedit failed\nCommand :".join(" ",@a)."\n"; $debug and print STDERR "Ok!\n"; @@ -108,7 +108,7 @@ sub EcritureFichierPST { my $l = ($$b[2] - $$b[0]); my $h = ($$b[3] - $$b[1]); my $max = $l; $max = $h if $h > $l; - $facteur = ($DimMax * $cm) / $max; + $facteur = $DimMax / $max; $out .= "%\@FACTEUR: $facteur\n"; my $abox = &xy_couple_modifie($b); $out .= "%\@PSPICTURE:\n"; @@ -124,7 +124,7 @@ sub EcritureFichierPST { if ($$r[$i]->{path}) { $out .= "%% Path : $i\n"; my $couleur = $$cmyk{$$r[$i]->{setcmykcolor}}; - my $epaisseur = $$r[$i]->{setlinewidth}; $epaisseur = sprintf("linewidth=%0.5fpt", $epaisseur / $facteur); + my $epaisseur = $$r[$i]->{setlinewidth}; $epaisseur = sprintf("linewidth=%0.5fpt", $epaisseur * $facteur * $cm); my $t = $$r[$i]->{type}; $t eq "fill" and $out .= "\\pscustom[fillstyle=solid,fillcolor=$couleur,linestyle=none]{\n"; $t eq "eofill" and $out .= "\\pscustom[fillstyle=asolid,fillcolor=$couleur,linestyle=none]{\n";