Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Aug 2004 10:11:59 +0200
From:      Marco Molteni <mmolteni@cisco.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        marcus@FreeBSD.org
Subject:   ports/70199: [PATCH] graphics/graphopt: fix postscript export
Message-ID:  <20040809101159.673c4fb8@barbapapa.cisco.com>
Resent-Message-ID: <200408090820.i798KQiQ078585@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         70199
>Category:       ports
>Synopsis:       [PATCH] graphics/graphopt: fix postscript export
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Mon Aug 09 08:20:26 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Marco Molteni
>Release:        FreeBSD 5.2-CURRENT i386
>Organization:
<organization of PR author (multiple lines)>
>Environment:
System: FreeBSD 5.2-CURRENT FreeBSD
>Description:
        graphics/graphopt generates a broken postscript file.
        I notified the author, which helped me diagnose the problem.
>How-To-Repeat:
        Use graphopt to generate a graph and then export it to postscript.
        First line will be missing the % sign.
>Fix:
        Apply following patch:

diff --unified=6 --show-c-function -rN graphopt/files/patch-src:classes:psExporter.cc graphopt-marco/files/patch-src:classes:psExporter.cc
--- graphopt/files/patch-src:classes:psExporter.cc	Thu Jan  1 01:00:00 1970
+++ graphopt-marco/files/patch-src:classes:psExporter.cc	Mon Aug  9 09:34:26 2004
@@ -0,0 +1,17 @@
+--- src/classes/psExporter.cc.orig	Mon Aug  9 09:31:11 2004
++++ src/classes/psExporter.cc	Mon Aug  9 09:31:38 2004
+@@ -23,13 +23,13 @@ void psExporter::do_export() {
+    fclose(outfile);
+ }
+ 
+ 
+ void psExporter::write_headers(FILE *outfile) {
+    char *line = new char[200];
+-   sprintf(line, "\%!PS-Adobe-1.0\n%%%%BoundingBox: 0 0 %d %d\n%%%%DocumentFonts: Helvetica\n%%%%Pages: 1\n",
++   sprintf(line, "%%!PS-Adobe-1.0\n%%%%BoundingBox: 0 0 %d %d\n%%%%DocumentFonts: Helvetica\n%%%%Pages: 1\n",
+            translatexcoord((double) biggest_x) + 2 * margin,
+            translateycoord((double) biggest_y) + 2 * margin);
+    fwrite(line, strlen(line), 1, outfile);
+    delete line;
+ }
+ 
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040809101159.673c4fb8>