summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorwl <wl>2013-01-17 12:38:16 +0000
committerwl <wl>2013-01-17 12:38:16 +0000
commit77750dd055b52daf9e572485bf6487eb5bc49e4d (patch)
tree9c6b1ae97f87411df139c3791d3725867cafb973 /src
parent1f6e13b55959453afa4b7848a1099346d93870e8 (diff)
downloadgroff-77750dd055b52daf9e572485bf6487eb5bc49e4d.tar.gz
* src/devices/gropdf/gropdf.pl (do_x, do_p, do_s, Set_LWidth): The
grops driver defaults to round linecaps and linejoins, gropdf incorrectly used butt caps and miter joins. (Since the MOM package expects to use butt caps and miter joins (emitting the necessary postscript code to change the caps and joins), gropdf now parses the same postscript commands.) * src/devices/gropdf/gropdf.man: Document the handling of linecaps and linejoins. * tmac/pdf.tmac (pdfbookmark): Fix bug where the current PDFOUTLINE.FOLDLEVEL may not be honoured if warnings of the type macro warning: adjusted level n bookmark; should be <= n Added copyright and mention debt owed to Keith Marshall for original `pdfmark.tmac', upon which `pdf.tmac' is largely based. * font/devpdf/Foundry.in, font/devpdf/util/BuildFoundries.pl (LocateFile): The font for EURO had the wrong entry in the `download' file (it pointed to The font in the build directory, which is wrong). It has always been permissable to include a path along with the font name in the Foundry file, but until now the font had to exist to be valid. It is now permitted to start the path with an asterisk which tells BuildFoundry to use the path/filename in the download file without checking if the font exists. This allows the font to be found in `../devps' even though it is not there during the build (if source and build are different), but will be there after the install.
Diffstat (limited to 'src')
-rw-r--r--src/devices/gropdf/gropdf.man31
-rw-r--r--src/devices/gropdf/gropdf.pl29
2 files changed, 54 insertions, 6 deletions
diff --git a/src/devices/gropdf/gropdf.man b/src/devices/gropdf/gropdf.man
index d7953e09..8f86ac48 100644
--- a/src/devices/gropdf/gropdf.man
+++ b/src/devices/gropdf/gropdf.man
@@ -1,5 +1,5 @@
.ig
-Copyright (C) 2011-2012
+Copyright (C) 2011-2013
Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
@@ -620,7 +620,7 @@ understands some of the X\~commands produced using the
.B \[rs]X
escape sequences supported by
.B grops.
-Specifically it supports:-
+Specifically, the following is supported.
.
.TP
.B "\[rs]X'ps: invis'"
@@ -647,7 +647,32 @@ Again used by
to restore after rotation.
.
.TP
-.BI "\[rs]X'ps: ... pdfmark'"
+.BI "\[rs]X'ps: exec " "n " "setlinejoin'"
+where
+.I n
+can be one of the following values.
+.IP
+0 = Miter join
+.br
+1 = Round join
+.br
+2 = Bevel join
+.
+.TP
+.BI "\[rs]X'ps: exec " "n " "setlinecap'"
+where
+.I n
+can be one of the following values.
+.IP
+0 = Butt cap
+.br
+1 = Round cap, and
+.br
+2 = Projecting square cap
+.
+.LP
+.TP
+.B "\[rs]X'ps: ... pdfmark'"
All the
.I pdfmark
macros installed by using
diff --git a/src/devices/gropdf/gropdf.pl b/src/devices/gropdf/gropdf.pl
index d338f200..9a8288c0 100644
--- a/src/devices/gropdf/gropdf.pl
+++ b/src/devices/gropdf/gropdf.pl
@@ -4,7 +4,7 @@
# Deri James : 4th May 2009
#
-# Copyright (C) 2011, 2012 Free Software Foundation, Inc.
+# Copyright (C) 2011-2013 Free Software Foundation, Inc.
# Written by Deri James <deri@chuzzlewit.demon.co.uk>
#
# This file is part of groff.
@@ -56,6 +56,8 @@ my $stream=''; # Current Text/Graphics stream
my $cftsz=10; # Current font sz
my $cft; # Current Font
my $lwidth=1; # current linewidth
+my $linecap=1;
+my $linejoin=1;
my $textcol=''; # Current groff text
my $fillcol=''; # Current groff fill
my $curfill=''; # Current PDF fill
@@ -693,6 +695,18 @@ sub do_x
$stream.="Q\n";
$InPicRotate=0;
}
+ elsif ($par=~m/exec (\d) setlinejoin/)
+ {
+ IsGraphic();
+ $linejoin=$1;
+ $stream.="$linejoin j\n";
+ }
+ elsif ($par=~m/exec (\d) setlinecap/)
+ {
+ IsGraphic();
+ $linecap=$1;
+ $stream.="$linecap J\n";
+ }
elsif ($par=~m/\[(.+) pdfmark/)
{
my $pdfmark=$1;
@@ -2311,7 +2325,7 @@ sub do_p
$objct+=1;
$cpage=$obj[$cpageno]->{DATA};
$pages->{'Count'}++;
- $stream="q 1 0 0 1 0 0 cm\n";
+ $stream="q 1 0 0 1 0 0 cm\n$linejoin J\n$linecap j\n";
$mode='g';
$curfill='';
# @mediabox=@defaultmb;
@@ -2420,6 +2434,7 @@ sub do_s
{
PutLine();
$cftsz=$par;
+ Set_LWidth() if $lwidth < 1;
# $stream.="/F$cft $cftsz Tf\n";
$fontchg=1;
$widtbl=CacheWid($cft);
@@ -2427,9 +2442,17 @@ sub do_s
else
{
$cftsz=$par;
+ Set_LWidth() if $lwidth < 1;
}
}
+sub Set_LWidth
+{
+ IsGraphic();
+ $stream.=((($desc{res}/(72*$desc{sizescale}))*$linewidth*$cftsz)/1000)." w\n";
+ return;
+}
+
sub do_m
{
# Groff uses /m[] for text & graphic stroke, and /M[] (DF?) for graphic fill.
@@ -2583,7 +2606,7 @@ sub do_D
}
elsif ($Dcmd eq 'p' or $Dcmd eq 'P')
{
- # B-Spline
+ # Polygon
my (@p)=split(' ',$par);
my ($nxpos,$nypos);