diff options
author | wl <wl> | 2012-08-31 12:17:33 +0000 |
---|---|---|
committer | wl <wl> | 2012-08-31 12:17:33 +0000 |
commit | 847b504be937b13d472024555b5abd7f094aa739 (patch) | |
tree | 6b6a75bb27ec545a8cdf4c54f698a94675a59b05 /src/devices/gropdf/gropdf.pl | |
parent | a529116ae6922d775b4270adcdb2c0f227831957 (diff) | |
download | groff-847b504be937b13d472024555b5abd7f094aa739.tar.gz |
Add `pdfmom' to handle mom documents with gropdf.
* Makefile.in (OTHERDIRS): Move contrib/mom to be run after
devices/gropdf.
* src/devices/gropdf/gropdf.pl: Various fixes:
. Correct image scaling issue.
. Handle relative horizontal movement 'h' followed by absolute
vertical movement 'V'.
. Correct handling of track kerning.
* src/devices/gropdf/pdfmom.pl: New wrapper for mom (pdfmom)
using gropdf or grops driver.
* src/devices/gropdf/pdfmom.man: New man page.
* src/devices/gropdf/Makefile.sub: Updated to handle new files.
Diffstat (limited to 'src/devices/gropdf/gropdf.pl')
-rw-r--r-- | src/devices/gropdf/gropdf.pl | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/devices/gropdf/gropdf.pl b/src/devices/gropdf/gropdf.pl index 0084b952..d8a21e25 100644 --- a/src/devices/gropdf/gropdf.pl +++ b/src/devices/gropdf/gropdf.pl @@ -907,13 +907,13 @@ sub do_x { IsGraphic(); my $bbox=$incfil{$fil}->[1]; - my $xscale=$wid/($bbox->[2]-$bbox->[0]+1); - my $yscale=($hgt<=0)?$xscale:($hgt/($bbox->[3]-$bbox->[1]+1)); + my $xscale=$wid/($bbox->[2]-$bbox->[0]); + my $yscale=($hgt<=0)?$xscale:($hgt/($bbox->[3]-$bbox->[1])); $xscale=($wid<=0)?$yscale:$xscale; $xscale=$yscale if $yscale < $xscale; $yscale=$xscale if $xscale < $yscale; - $wid=($bbox->[2]-$bbox->[0]+1)*$xscale; - $hgt=($bbox->[3]-$bbox->[1]+1)*$yscale; + $wid=($bbox->[2]-$bbox->[0])*$xscale; + $hgt=($bbox->[3]-$bbox->[1])*$yscale; if ($flag eq '-C' and $ll > $wid) { @@ -2978,7 +2978,7 @@ sub do_V } - $nomove=$pendmv=0; +# $nomove=$pendmv=0; $poschg=1; } @@ -2997,6 +2997,7 @@ sub TextWid { my $txt=shift; my $w=0; + my $ck=0; foreach my $c (split('',$txt)) { @@ -3005,7 +3006,9 @@ sub TextWid $w+=$widtbl->[$cn]; } - return($w/$unitwidth); + $ck=length($txt)*$curkern; + + return(($w/$unitwidth)+$ck); } sub do_t |