gEDA-dev: PCB-HID patch - subtle behavior changes

ldoolitt at recycle.lbl.gov ldoolitt at recycle.lbl.gov
Fri Jul 7 14:55:15 EDT 2006


For your consideration:

Apply PCB->minSlk even when in a GUI, so people aren't surprised
  at the text linewidths when they make a Gerber

Keep consistent board location on page for all pages of PostScript output

Keep consistent rotation for all pages of PostScript output, after
  conversion to PDF by ps2pdf

Improve accuracy of logic that places drill table

diff --exclude=Makefile.in --exclude=CVS --exclude=aclocal.m4 --exclude=configure -ur pcb/src/draw.c /home/ldoolitt/src/pcb-20060707/src/draw.c
--- pcb/src/draw.c	2006-06-09 20:07:41.000000000 -0700
+++ /home/ldoolitt/src/pcb-20060707/src/draw.c	2006-07-07 10:53:02.000000000 -0700
@@ -1808,7 +1808,7 @@
 	      newline.Point2.X = (newline.Point2.X + x) * Text->Scale / 100;
 	      newline.Point2.Y = newline.Point2.Y * Text->Scale / 100;
 	      newline.Thickness = newline.Thickness * Text->Scale / 200;
-	      if (newline.Thickness < PCB->minSlk && !gui->gui)
+	      if (newline.Thickness < PCB->minSlk)  /* && !gui->gui */
 		newline.Thickness = PCB->minSlk;
 
 	      RotateLineLowLevel (&newline, 0, 0, Text->Direction);
diff --exclude=Makefile.in --exclude=CVS --exclude=aclocal.m4 --exclude=configure -ur pcb/src/hid/ps/ps.c /home/ldoolitt/src/pcb-20060707/src/hid/ps/ps.c
--- pcb/src/hid/ps/ps.c	2006-07-07 08:52:26.000000000 -0700
+++ /home/ldoolitt/src/pcb-20060707/src/hid/ps/ps.c	2006-07-07 11:48:55.000000000 -0700
@@ -399,9 +399,13 @@
       fprintf (f, "%d %d translate\n",
 	       -PCB->MaxWidth / 2, -PCB->MaxHeight / 2);
 
+      /* Somebody must have had a really long drill list, and hacked this in to
+       * keep it from falling off the edge of the paper */
+#if 0
       if (SL_TYPE (idx) == SL_FAB)
 	fprintf (f, "0 %d translate\n",
 		 (int) ((boffset - 0.5) * 100000) - PCB->MaxHeight / 2);
+#endif
 
       if (invert)
 	{
@@ -449,10 +453,14 @@
 		 "/dh { gsave %d setlinewidth 0 gray %d 0 360 arc stroke grestore} bind def\n",
 		 MIN_PINORVIAHOLE, MIN_PINORVIAHOLE * 3 / 2);
     }
+  /* Try to outsmart ps2pdf's heuristics for page rotation, by putting
+   * text on all pages -- even if that text is blank */
   if (SL_TYPE (idx) != SL_FAB)
     fprintf (f,
 	     "gsave tx ty translate 1 -1 scale 0 0 moveto (Layer %s) show grestore newpath /ty ty ts sub def\n",
 	     name);
+  else
+    fprintf (f, "gsave tx ty translate 1 -1 scale 0 0 moveto ( ) show grestore newpath /ty ty ts sub def\n");
   return 1;
 }
 
diff --exclude=Makefile.in --exclude=CVS --exclude=aclocal.m4 --exclude=configure -ur pcb/src/print.c /home/ldoolitt/src/pcb-20060707/src/print.c
--- pcb/src/print.c	2006-06-09 20:07:41.000000000 -0700
+++ /home/ldoolitt/src/pcb-20060707/src/print.c	2006-07-07 10:36:43.000000000 -0700
@@ -207,9 +207,9 @@
    * drill table header doesn't fall on top of the board info
    * section.
    */
-  if (AllDrills->DrillN < 4)
+  if (ds < 4)
     {
-      yoff -= (4 - AllDrills->DrillN) * TEXT_LINE;
+      yoff -= (4 - ds) * TEXT_LINE;
     }
 
   gui->set_line_width (Output.fgGC, FAB_LINE_W);


More information about the geda-dev mailing list