RE: Fix for Bug 686948, dotted
"Jeong Kim" <[email protected]>
| Newsgroups | gmane.comp.printing.ghostscript.patches |
|---|---|
| Message-ID | <000b01c36ecf$53fcfc00$020ba8c0@daedun> |
Dan, I agree with your fix. Jeong > -----Original Message----- > From: [email protected] > [mailto:[email protected]] On Behalf Of Dan Coby > Sent: Thursday, August 14, 2003 9:56 AM > To: Jeong Hee Kim; Gs-Code-Review > Subject: RE: [gs-code-review] Fix for Bug 686948, dotted > > > > This is a (minor) revision to a the previous fix from Jeong for > this problem. > > For those people who do not remember, this problem involves a dashed > line with a zero line length for the imaged (pen down) part of the > dashed line. Ghostscript currently calls this a degenerate situation > and does nothing except for round line caps. Jeong had previously > proposed changing the test to any line cap except butt caps. Jeong > removed this proposal after testing and finding that Adobe Acrobat > drew thin line segments even for butt line caps. > > This proposal simply removes the test for line cap type completely. > It does still leaves a test for dot length = 0. > > The routine already contains code for using adjacent line segments > to determine a 'direction' for zero length segments. > > Testing with both butt and square line caps and with on axis and > diagonal lines produces results comparable to Adobe Acrobat. > (Acrobat is not consistent with segment widths for the butt joints.) > > Log message: > > Fix for 686948 Dotted lines messing in PDF. Draw all line cap > types for zero line lengths. Previously only rounded caps were > drawn. > > > Dan > > > > Index: src/gxstroke.c > =================================================================== > RCS file: /cvs/ghostscript/gs/src/gxstroke.c,v > retrieving revision 1.7 > diff -c -5 -r1.7 gxstroke.c > *** src/gxstroke.c 31 Oct 2002 09:00:28 -0000 1.7 > --- src/gxstroke.c 14 Aug 2003 00:38:10 -0000 > *************** > *** 554,570 **** > if (udx | udy) > goto d; > } > /* > * The entire subpath is degenerate, but it includes > ! * more than one point. If we are using round caps or > ! * the dot length is non-zero, draw the caps, > otherwise > ! * do nothing. > */ > ! if (!(pgs_lp->cap == gs_cap_round || > ! pgs_lp->dot_length != 0) > ! ) > break; > /* > * Orient the dot according to the previous segment if > * any, or else the next segment if any, or else > * according to the specified dot orientation. > --- 554,567 ---- > if (udx | udy) > goto d; > } > /* > * The entire subpath is degenerate, but it includes > ! * more than one point. If the dot length is > non-zero, > ! * draw the caps, otherwise do nothing. > */ > ! if (pgs_lp->dot_length != 0) > break; > /* > * Orient the dot according to the previous segment if > * any, or else the next segment if any, or else > * according to the specified dot orientation. > > > -----Original Message----- > > From: [email protected] > > [mailto:[email protected]]On Behalf Of Jeong Kim > > > >Dan and Ray, > > > >I tried butt line ends with Adobe Illustrator 10 and Acrobat. > >Adobe draws very thin dashes with butt line ends too. > > > >I think we should remove the line I changed. > > > >Jeong > > > >Log: > >When drawing dashed lines, if the dot length is zero with > >square caps, the lines were missing. Adobe draws lines with > >every caps for zero dot length. Now fixed. Bug 686948. > >DETAILS: jeong > > > >Index: src/gxstroke.c > >=================================================================== > >RCS file: /cvs/ghostscript/gs/src/gxstroke.c,v > >retrieving revision 1.7 > >diff -r1.7 gxstroke.c > >558,567d557 > >< * The entire subpath is degenerate, but it includes > >< * more than one point. If we are using > round caps or > >< * the dot length is non-zero, draw the > caps, otherwise > >< * do nothing. > >< */ > >< if (!(pgs_lp->cap == gs_cap_round || > >< pgs_lp->dot_length != 0) > >< ) > >< break; > >< /* > > > > > > -----Original Message----- > > From: [email protected] > > [mailto:[email protected]] On Behalf Of Dan Coby > > Sent: Monday, July 07, 2003 4:19 AM > > To: Jeong Kim; 'gs-code-review' > > Subject: RE: [gs-code-review] Fix for Bug 686948, dotted > > lines missing in pdf. > > > > > > > > Jeong, > > > > I had also spent a few minutes looking at this problem and I > > agree that the cause of this problem is that Ghostscript > > would not draw zero length dashed lines with square ends. > > The choice of everything except butt line ends seems > > reasonable. Curiosity: Did you try butt line ends with Adobe? > > > > > > Dan > > > > > > -----Original Message----- > > From: [email protected] > > [mailto:[email protected]]On Behalf Of Jeong Kim > > Sent: Sunday, July 06, 2003 4:48 AM > > To: 'gs-code-review' > > Subject: [gs-code-review] Fix for Bug 686948, dotted lines > > missing in pdf. > > > > > > Reviewers, > > > > The mentioned dotted lines in the PDF file, had zero-length > > dash patterns with square caps. > > > > Now Ghoscript draws caps if we are using round caps or the > > dot length is non-zero, otherwise does nothing. > > > > But in the case of square caps with zero dot length, Acrobat > > and Illustrator draws caps. > > > > So I made Ghostscript to draw caps always except the > > condition using butt caps when dot length is zero. > > > > Jeong > > > > Log: > > When drawing dashed lines, if the dot length is zero with > > square caps, the lines were missing. Now fixed. Bug 686948. > > > > Index: src/gxstroke.c > > =================================================================== > > RCS file: /cvs/ghostscript/gs/src/gxstroke.c,v > > retrieving revision 1.7 > > diff -C2 -r1.7 gxstroke.c > > *** src/gxstroke.c 31 Oct 2002 09:00:28 -0000 1.7 > > --- src/gxstroke.c 6 Jul 2003 11:44:45 -0000 > > *************** > > *** 561,568 **** > > * do nothing. > > */ > > ! if (!(pgs_lp->cap == gs_cap_round || > > ! pgs_lp->dot_length != 0) > > ! ) > > ! break; > > /* > > * Orient the dot according to the previous > segment if > > --- 561,565 ---- > > * do nothing. > > */ > > ! if (pgs_lp->cap == gs_cap_butt && > > pgs_lp->dot_length == > > 0) break; > > /* > > * Orient the dot according to the previous > > segment if > > > > _______________________________________________ > > gs-code-review mailing list > > [email protected] > > http://www.ghostscript.com/mailman/listinfo/gs-code-review > > _______________________________________________ > gs-code-review mailing list > [email protected] > http://www.ghostscript.com/mailman/listinfo/gs-code-review >