summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorwl <wl>2013-07-31 20:19:56 +0000
committerwl <wl>2013-07-31 20:19:56 +0000
commit71c84038822aae6954f01a7804d5aa8cca8af7bb (patch)
tree8b789e69ef9a6942d1f13daceb73e7577c3e2dda /src
parent0c50ce0ddd75f5c7dc6c53e02c69e84fa90a2814 (diff)
downloadgroff-71c84038822aae6954f01a7804d5aa8cca8af7bb.tar.gz
Fix overprinting issue with Acrobat reader.
Problem reported by Heinz-Jürgen Oertel <hj.oertel@t-online.de>. * src/devices/gropdf/gropdf.pl (do_t, FindChar): Use ascii octal notation (i.e., \015) when outputting characters with value < 32. This fixes a bug which affected acroread when control-M (cr) was embedded in a text string.
Diffstat (limited to 'src')
-rw-r--r--src/devices/gropdf/gropdf.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/devices/gropdf/gropdf.pl b/src/devices/gropdf/gropdf.pl
index 078ebf23..92b37878 100644
--- a/src/devices/gropdf/gropdf.pl
+++ b/src/devices/gropdf/gropdf.pl
@@ -3068,7 +3068,7 @@ sub do_t
$xpos+=($pendmv-$nomove)/$unitwidth;
$stream.="% == '$par'=$wid 'xpos=$xpos\n" if $debug;
- $par=~s/\\/\\\\/g;
+ $par=~s/\\(?!\d\d\d)/\\\\/g;
$par=~s/\)/\\)/g;
$par=~s/\(/\\(/g;
@@ -3198,7 +3198,7 @@ sub FindChar
my $ch=$fnt->{GNM}->{$chnm};
$ch=RemapChr($ch,$fnt,$chnm) if ($ch > 255);
- return(chr($ch),$fnt->{WID}->[$ch]*$cftsz);
+ return(($ch<32)?sprintf("\\%03o",$ch):chr($ch),$fnt->{WID}->[$ch]*$cftsz);
}
else
{