Skip to content
Permalink
Browse files

patches for windows

  • Loading branch information
Dan Gildea
Dan Gildea committed Dec 30, 2019
1 parent bb99a15 commit 4e17471e51507782d9a36f571aa2fb89b968e916
Showing with 47 additions and 15 deletions.
  1. +9 −2 config/config.pl
  2. +35 −12 latex2html.pin
  3. +3 −1 prefs.pm
@@ -1266,10 +1266,16 @@ package main;
my @right_paths = ();
my $gs_lib = 0;
my $gs_fonts = 0;
# 2017-04-11 shige: 2-24)
my $gs_stand_ps;
Gslibpaths: foreach $path (@try_path) {
foreach('',"$dd$gs_version","${dd}gs$gs_version") {
my $testpath = $path . $_;
if(!$gs_lib && -d $testpath && -s "$testpath${dd}gs_init.ps") {
# if(!$gs_lib && -d $testpath && -s "$testpath${dd}gs_init.ps") {
# 2017-04-11, 2019-12-03 shige: 2-24)
if ($testpath =~ /tlgs/) { $gs_stand_ps = "landscape.ps"; }
else { $gs_stand_ps = "gs_init_ps"; }
if(!$gs_lib && -d $testpath && -s "$testpath${dd}$gs_stand_ps") {
push(@right_paths,L2hos->path2os($testpath));
$gs_lib = 1;
}
@@ -1296,7 +1302,8 @@ package main;
EOF
}
else {
push(@right_paths,'.');
#push(@right_paths,'.');
# 2019-12-16 shige: 2-24)
my $item;
foreach $item (@right_paths) {
$item = &simplify_path($item);
@@ -421,7 +421,9 @@ if (defined $opt{math_parsing}) {
}
&set_if_false($NO_ISOLATIN, $opt{latin});
if ($INIT_FILE) {
if ($INIT_FILE !~ /^[.$dd$dd]/) { # should start with / or .
# if ($INIT_FILE !~ /^[.$dd$dd]/) { # should start with / or .
# 2019-12-18 shige: 2-43)
if ($INIT_FILE !~ /^\./ && !L2hos->is_absolute_path($INIT_FILE)) {
$INIT_FILE = ".$dd$INIT_FILE"; # so that value of @INC has no effect
}
if (-f $INIT_FILE && -r _) {
@@ -3870,7 +3872,9 @@ sub make_off_line_images {
# calls either dvips, dvipng, gs, or nothing as specified
# by command line options
sub call_dvips {
local($dvips_call);
# local($dvips_call);
# 2019-12-27 shige: 2-44)
local($dvips_call, $dvips_call2);
if ($USE_PDFTEX || $USE_LUATEX) {
# svg images are produced directly from images.pdf,
# don't need to do anything here
@@ -3881,11 +3885,16 @@ sub call_dvips {
$dvips_call .= "-sDEVICE=png16m -r$DVIPNG_DPI -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -sOutputFile=$TMPDIR$dd$IMAGE_PREFIX%d.png .${dd}${PREFIX}images.pdf";
} else {
# did not usepackage{preview}, need to crop
$dvips_call = "$PDFCROP --hires " . ($DEBUG ? '--debug ' : '')
. ".${dd}${PREFIX}images.pdf"
. ";" . $dvips_call;
# $dvips_call = "$PDFCROP --hires " . ($DEBUG ? '--debug ' : '')
# . ".${dd}${PREFIX}images.pdf"
# . ";" . $dvips_call;
# 2019-12-27 shige: 2-44)
print "\nTransforming PDF images to postscript using gs/ps2write ...\n";
$dvips_call .= "-sDEVICE=ps2write -sOutputFile=$TMPDIR$dd$IMAGE_PREFIX%.3d.ps .${dd}${PREFIX}images-crop.pdf\n";
# $dvips_call .= "-sDEVICE=ps2write -sOutputFile=$TMPDIR$dd$IMAGE_PREFIX%.3d.ps .${dd}${PREFIX}images-crop.pdf\n";
# 2019-12-27 shige: 2-44)
$dvips_call2 = $dvips_call . "-sDEVICE=ps2write -sOutputFile=$TMPDIR$dd$IMAGE_PREFIX%.3d.ps .${dd}${PREFIX}images-crop.pdf";
$dvips_call = "$PDFCROP --hires " . ($DEBUG ? '--debug ' : '')
. ".${dd}${PREFIX}images.pdf";
}
}
} else {
@@ -3899,14 +3908,20 @@ sub call_dvips {
$dvips_call = "$DVIPS -S1 -i $DVIPSOPT -o$TMPDIR$dd${IMAGE_PREFIX} .${dd}${PREFIX}images.dvi";
}
} else {
$dvips_call = "$DVIPS .${dd}${PREFIX}images.dvi && $PS2PDF .${dd}${PREFIX}images.ps";
# $dvips_call = "$DVIPS .${dd}${PREFIX}images.dvi && $PS2PDF .${dd}${PREFIX}images.ps";
# 2019-10-29, 2019-12-27 shige: 2-41)
$dvips_call = "$DVIPS .${dd}${PREFIX}images.dvi";
$dvips_call2 = "$PS2PDF .${dd}${PREFIX}images.ps";
print $dvips_call, "\n";
}
}
if ($dvips_call) {
print $dvips_call if (($DEBUG)||($VERBOSITY > 1));
&close_dbm_database if $DJGPP;
L2hos->syswait($dvips_call) && print "Error: $!\n";
if ($dvips_call2) {
L2hos->syswait($dvips_call2) && print "Error: $!\n";
}
&open_dbm_database if $DJGPP;
}
}
@@ -4264,16 +4279,24 @@ sub extract_image_bitmap { # clean
my $PPMTO=$IMAGE_TYPE=~m/gif/i? $PPMTOGIF : $PNMTOPNG;
#L2hos->syswait("$PNGTOPNM $p.png|$PNMCROP -sides|tee $p.ppm|$PNMCUT -top $millimeter |$PNMCROP -sides|tee $p-.ppm|$PPMTO{$IMAGE_TYPE} --quiet $transparent >img$new_num.$IMAGE_TYPE;");
if ($name =~ /figure|table/) {
L2hos->syswait("$PNGTOPNM $p.png|tee $p.ppm|$PPMTO --quiet $transparent >${PREFIX}img$new_num.$IMAGE_TYPE;");
#L2hos->syswait("$PNGTOPNM $p.png|tee $p.ppm|$PPMTO --quiet $transparent >${PREFIX}img$new_num.$IMAGE_TYPE;");
# 2019-12-12: 2-44)
L2hos->syswait("$PNGTOPNM $p.png >$p.ppm");
L2hos->syswait("$PPMTO --quiet $transparent $p.ppm >${PREFIX}img$new_num.$IMAGE_TYPE;");
} else {
# L2hos->syswait("$PNGTOPNM $p.png|$PNMCROP -sides|tee $p.ppm|$PNMCUT -top $millimeter |$PNMCROP -left -right|tee $p-.ppm|$PPMTO --quiet $transparent >img$new_num.$IMAGE_TYPE;");
L2hos->syswait("$PNGTOPNM $p.png|$PNMCROP -sides|tee $p.ppm|$PPMTO --quiet $transparent >${PREFIX}img$new_num.$IMAGE_TYPE;");
# L2hos->syswait("$PNGTOPNM $p.png|$PNMCROP -sides|tee $p.ppm|$PPMTO --quiet $transparent >${PREFIX}img$new_num.$IMAGE_TYPE;");
# 2019-12-12: 2-44)
L2hos->syswait("$PNGTOPNM $p.png|$PNMCROP -sides >$p.ppm");
L2hos->syswait("$PPMTO --quiet $transparent $p.ppm >${PREFIX}img$new_num.$IMAGE_TYPE;");
}
$edepth{$name}=$ptdepth{$name}/$pt_per_ex{$name};
# extra .5pt in depth is border from latex "preview" package
print "edepth{$name}=$edepth{$name}\n" if ($VERBOSITY > 2);
open PPM,"<$p.ppm"; read(PPM,$_,30);close PPM;
# open PPM,"<$p.ppm"; read(PPM,$_,30);close PPM;
# 2019-12-12 shige: 2-44)
open PPM,"<$p.ppm"; binmode(PPM); read(PPM,$_,30);close PPM;
m/^(\d+) (\d+)$/m;
$eheight{$name}=$2*$imgpixeloverex; # image height in ex
print "eheight{$name}=$ehieight{$name}\n" if ($VERBOSITY > 2);
@@ -4388,7 +4411,7 @@ sub extract_image_bitmap { # clean
. (($custom_size)? "-geometry $custom_size " : '' )
. $croparg
. (($scale != 1)? "-scale $scale " : '' )
. ((($exscale == int($exscale))&&($exscale != 1)&&
. (($exscale && ($exscale == int($exscale))&&($exscale != 1)&&
!($ANTI_ALIAS_TEXT &&($LATEX_COLOR)))?
"-shoreup $exscale$under " :'')
. ((($TRANSPARENT_FIGURES ||($trans))
@@ -4419,7 +4442,7 @@ sub extract_image_bitmap { # clean
. (($INTERLACE) ? "-interlace " : '' )
. ((($ANTI_ALIAS_TEXT||($aalias))&&(!($aalias =~ /no/)))?
"-antialias -depth 1 " :'')
. ((($exscale == int($exscale))&&($exscale != 1)&&
. (($exscale && ($exscale == int($exscale))&&($exscale != 1)&&
!($ANTI_ALIAS_TEXT &&($LATEX_COLOR)))?
"-shoreup $exscale " :'')
. (($scale ne 1) ? "-scale $scale " : '' )
@@ -275,7 +275,9 @@ if($::newcfg{'plat'} eq 'os2') {
$prefs{'GS'} = 'gsos2';
}
elsif($::newcfg{'plat'} eq 'win32') {
$prefs{'GS'} = 'gswin32c';
#$prefs{'GS'} = 'gswin32c';
# 2019-12-12 shige: 2-24)
$prefs{'GS'} = 'rungs,gswin32c';
}
else {
$prefs{'GS'} = 'gs';

0 comments on commit 4e17471

Please sign in to comment.
You can’t perform that action at this time.