diff options
author | wl <wl> | 2013-01-17 12:38:16 +0000 |
---|---|---|
committer | wl <wl> | 2013-01-17 12:38:16 +0000 |
commit | 77750dd055b52daf9e572485bf6487eb5bc49e4d (patch) | |
tree | 9c6b1ae97f87411df139c3791d3725867cafb973 | |
parent | 1f6e13b55959453afa4b7848a1099346d93870e8 (diff) | |
download | groff-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.
-rw-r--r-- | ChangeLog | 35 | ||||
-rw-r--r-- | font/devpdf/Foundry.in | 2 | ||||
-rw-r--r-- | font/devpdf/util/BuildFoundries.pl | 1 | ||||
-rw-r--r-- | src/devices/gropdf/gropdf.man | 31 | ||||
-rw-r--r-- | src/devices/gropdf/gropdf.pl | 29 | ||||
-rw-r--r-- | tmac/pdf.tmac | 32 |
6 files changed, 120 insertions, 10 deletions
@@ -1,3 +1,36 @@ +2013-01-14 Deri James <deri@chuzzlewit.myzen.co.uk> + + * 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. + 2013-01-13 Werner LEMBERG <wl@gnu.org> [eqn] Fix display of matrices in nroff output. @@ -939,7 +972,7 @@ Version 1.22 released * doc/webpage.ms: Fix rendering of title image. -Copyright 2011-2012 +Copyright 2011-2013 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, diff --git a/font/devpdf/Foundry.in b/font/devpdf/Foundry.in index 86d6432c..a6e968f7 100644 --- a/font/devpdf/Foundry.in +++ b/font/devpdf/Foundry.in @@ -37,7 +37,7 @@ CB|Y||||NimbusMonL-Bold!n022004l.pfb CBI|Y||||NimbusMonL-BoldObli!n022024l.pfb CI|Y||||NimbusMonL-ReguObli!n022023l.pfb CR|Y||||NimbusMonL-Regu!n022003l.pfb -EURO|N||||freeeuro.pfa +EURO|N||||*../devps/freeeuro.pfa HB|Y||||NimbusSanL-Bold!n019004l.pfb HBI|Y||||NimbusSanL-BoldItal!n019024l.pfb HI|Y||||NimbusSanL-ReguItal!n019023l.pfb diff --git a/font/devpdf/util/BuildFoundries.pl b/font/devpdf/util/BuildFoundries.pl index 003fdb9b..39f2f0d2 100644 --- a/font/devpdf/util/BuildFoundries.pl +++ b/font/devpdf/util/BuildFoundries.pl @@ -219,6 +219,7 @@ sub LocateFile my $path=shift; my $files=shift; my $tryafm=shift; + return(substr($files,1)) if substr($files,0,1) eq '*'; foreach my $file (split('!',$files)) { 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); diff --git a/tmac/pdf.tmac b/tmac/pdf.tmac index 68fa9e5a..04d1c52b 100644 --- a/tmac/pdf.tmac +++ b/tmac/pdf.tmac @@ -1,5 +1,32 @@ -.\" pdf.tmac -.\" +.ig + +pdf.tmac + + Copyright (C) 2011-2013 Free Software Foundation, Inc. + Written by Deri James <deri@chuzzlewit.myzen.co.uk> + +This file is part of groff. + +groff is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation, either version 3 of the License, or +(at your option) any later version. + +groff is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see <http://www.gnu.org/licenses/>. + +Author's Note +============= + +Much of the code in this macro has come from the excellent original work by +Keith Marshall (see attribution in the pdfmark.tmac file). I, however, +am solely responsible for any bugs I may have introduced into this file. +.. .mso ps.tmac . .de pdf:SS @@ -196,6 +223,7 @@ . ie \\n[pdf:bm.abslev]>\\n[pdf:bm.nl] \{\ . pdf:warn adjusted level \\n[pdf:bm.abslev] bookmark; should be <= \\n[pdf:bm.nl] . nr pdf:bm.abslev 0+\\n[pdf:bm.nl] +. if \\n[pdf:bm.abslev]-1==\\n[PDFOUTLINE.FOLDLEVEL] .nr pdf:bm.lev \\n[pdf:bm.abslev]*-1 . \} . el .nr pdf:bm.nl \\n[pdf:bm.abslev] . if \\n[pdf:bm.lev]<0 .nr pdf:bm.abslev \\n[pdf:bm.abslev]*-1 |