You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 10, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 10, 2026. It is now read-only.
1.3.9 hpgltops breaks some previously working HPGL files #2966
Those were the two places I found after a cursory inspection.
As for the regression, it seems that pen 1 does not work any more. If I replace "SP1;" with "SP2", it works. I think the reason for that is PC_pen_color(). Pens[0] has always been white (before and after the patch), Pens[1] has always been black. However, "SP1" in the past was Pens[1], while it is now Pens[0], and "SP0" (which was valid before) isn't any more. Therefore I think the fix is to revert the "-1" in SP and just make sure that the array does not overflow by 1.
I think I got it right now. I reverted the SP_select_pen() enumeration change to not break the color map, and fixed the remaining loop. The "PenNumber = " in hpgl-vector.c is correct then, too.
HP-GL/2 attribute processing for the Common UNIX Printing System (CUPS).
* Copyright 2007 by Apple Inc.
* Copyright 2007-2008 by Apple Inc.
Copyright 1993-2007 by Easy Software Products.
These coded instructions, statements, and computer programs are the
@@ -214,7 +214,7 @@
"DEBUG: HP-GL/2 'NP' command with invalid number of "
"parameters (%d)!\n", num_params);
for (i = 0; i <= PenCount; i ++)
for (i = 0; i < PenCount; i ++)
Pens[i].width = PenWidth;
PC_pen_color(0, NULL);
@@ -232,14 +232,14 @@
int i; /* Looping var /
static float standard_colors[8][3] = / Standard colors for first 8 pens */
{
Activity
michaelrsweet commentedon Oct 10, 2008
CUPS.org User: martin.pitt.canonical
The second random example I found is at http://en.wikipedia.org/wiki/HPGL, which does not work any more either.
michaelrsweet commentedon Oct 10, 2008
CUPS.org User: martin.pitt.canonical
There also seem to be a couple of places left which were not adapted to the "shifted by 1" pen enumeration, like filter/hpgl-vector.c:396
PenNumber = (int)decode_number(&s, base_bits, 1.0);
or filter/hpgl-attr.c:217
for (i = 0; i <= PenCount; i ++)
Those were the two places I found after a cursory inspection.
As for the regression, it seems that pen 1 does not work any more. If I replace "SP1;" with "SP2", it works. I think the reason for that is PC_pen_color(). Pens[0] has always been white (before and after the patch), Pens[1] has always been black. However, "SP1" in the past was Pens[1], while it is now Pens[0], and "SP0" (which was valid before) isn't any more. Therefore I think the fix is to revert the "-1" in SP and just make sure that the array does not overflow by 1.
michaelrsweet commentedon Oct 10, 2008
CUPS.org User: martin.pitt.canonical
I think I got it right now. I reverted the SP_select_pen() enumeration change to not break the color map, and fixed the remaining loop. The "PenNumber = " in hpgl-vector.c is correct then, too.
michaelrsweet commentedon Oct 22, 2008
CUPS.org User: martin.pitt.canonical
This is a contentless ping to avoid this mercyless auto-timeout of bug reports.
michaelrsweet commentedon Oct 22, 2008
CUPS.org User: mike
Martin,
I only close stale bugs that I am waiting for information from the reporter, so as long as the status is "pending" the bug is safe...
Also, I'll have you know that my index finger always mercifully clicks the mouse button when closing inactive bugs! :)
michaelrsweet commentedon Nov 13, 2008
CUPS.org User: mike
Fixed in Subversion repository.
michaelrsweet commentedon Nov 13, 2008
"str2966.patch":
Index: filter/hpgl-attr.c
--- filter/hpgl-attr.c (revision 8118)
+++ filter/hpgl-attr.c (working copy)
@@ -3,7 +3,7 @@
*
@@ -214,7 +214,7 @@
"DEBUG: HP-GL/2 'NP' command with invalid number of "
"parameters (%d)!\n", num_params);
Pens[i].width = PenWidth;
PC_pen_color(0, NULL);
@@ -232,14 +232,14 @@
int i; /* Looping var /
static float standard_colors[8][3] = / Standard colors for first 8 pens */
{
Index: filter/hpgl-vector.c
--- filter/hpgl-vector.c (revision 8118)
+++ filter/hpgl-vector.c (working copy)
@@ -3,7 +3,7 @@
*
These coded instructions, statements, and computer programs are the
@@ -393,13 +393,20 @@
break;
case ':' : /* Select pen */
s ++;
#ifdef DEBUG
#endif /* DEBUG */
if (PageDirty)
printf("%.3f %.3f %.3f %.2f SP\n", Pens[PenNumber].rgb[0],