summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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);