[bug #65901] [gropdf] unable to render ellipse with dashed/dotted atribute

2024-06-22 Thread Deri James
Follow-up Comment #5, bug #65901 (group groff):

I don't think bug #44530 is related, that seems to be a misunderstanding what
".PS 1i" does to picture. You may have specified a certain space/dashwid but
the inclusion of .PS 1i has the effect of scaling the whole picture down to 1
inch so everything is reduced proportionally including the spaces, but not it
seems, the linethick setting.

Anyway, I have setup bug #65910, so you can have a look at what I am talking
about. 


___

Reply to this item at:

  

___
Message sent via Savannah
https://savannah.gnu.org/




[bug #65901] [gropdf] unable to render ellipse with dashed/dotted atribute

2024-06-22 Thread G. Branden Robinson
Update of bug #65901 (group groff):

 Planned Release:None => 1.24.0 

___

Follow-up Comment #4:

Thanks, Deri!

> when dashed ellipses are very large the dashes are irregular, grops and
gropdf show identical irregularity so I suspect it is a problem in pic.

Bug #44530 might be related, but I'm just guessing.


___

Reply to this item at:

  

___
Message sent via Savannah
https://savannah.gnu.org/




[bug #65901] [gropdf] unable to render ellipse with dashed/dotted atribute

2024-06-22 Thread Deri James
Update of bug #65901 (group groff):

  Status:None => Fixed  
 Open/Closed:Open => Closed 

___

Follow-up Comment #3:

This should be fixed now:-

commit dd63af83c106a6a44dbb15ab36d5f3e211515ca5
Author: Deri James 
Date:   Sat Jun 22 18:33:49 2024 +0100

Fix invalid pdf when using certain sizes of
dashed ellipse in pic.

* src/devices/gropdf/gropdf.pl: For short dashes on flat part
of ellipse some v. small numbers written in form n.nnnE-n which
is invalid for pdfs. Also rather than split each arc always into
4 pieces, split into number of quadrants described between start
and end angle. If arc describes a straight line, use line segment
rather than bezier curve. (grops does this as well)

Fixes https://savannah.gnu.org/bugs/index.php?65901

Thanks to Morten Bo Johansen for reporting this issue.

The problem reported for dotted ellipses could not be reproduced, and the dots
are much easier to see if you include the command "linethick=2" in the
picture.

Although this bug is now closed, and I hate maths, I will be opening a new bug
since when dashed ellipses are very large the dashes are irregular, grops and
gropdf show identical irregularity so I suspect it is a problem in pic.


___

Reply to this item at:

  

___
Message sent via Savannah
https://savannah.gnu.org/




Re: [bug #65901] [gropdf] unable to render ellipse with dashed/dotted atribute

2024-06-20 Thread Morten Bo Johansen
On 2024-06-20 Deri James wrote:

> Please could you run the dotted ellipse example again but adding this flag
> "-P-d", and post the resulting pdf. This adds some debug data which may be
> helpful.

I include it below, uuencoded.

Actually, it does show up in gv(1), but neither in zathura nor
mupdf.

Regards,
Morten


begin 644 ellipse-no-show.pdf
M)5!$1BTQ+C0*)>+CS],*,R`P(&]B:B`\/"`O0V]N=&5N=',@6S0@,"!2("!=
M"B]'U?&@&4P
M@5:G]233RB#$2?196C7K2FV5B#3(NAUL`:,
M5E<@9F&'(J,*@:+_<_PCTZJ0:?RRPS[K"F1:9*D,)L7J"F18O0.B;FA'>QX1
MF*,Q#W0M%(`Y&E\C5U(`PQ$!SM5M+@!S"N!.+J8`S,G0.KG``QA.$Q#VK0O`
M'`VM53<$`9BC.K,;IP#,T5B1W6`&L!R+-=/*.0"_#FHLC=PZ"YBCPSPBPP*T
MF_,$?E_:;M:1/B+P^:"VF<7ELX#+N76!C'SG?`+7K]8KE$YWOT[@^M[&V+#K
M^PG<_+3.4*V>`,XY7"@SKSETP,WS0(]Y/L%Y,NIB[`(WG<2E?K(GG<<-<01/*X+:]QBF1:ZYZ]!C.2:=4PXI$,ZVW[
M`\)$*.)E;F1S=')E86T*96YD;V)J"C$@,"!O8FH@/#P@+U!A9V5S(#(@,"!2
M(`HO5'EP92`O0V%T86QO9PH^/@IE;F1O8FH*-2`P(&]B:B`\/"`O0W)E871I
M;VY$871E("A$.C(P,C0P-C(P,C`S-C$Y*S`P)S`P)RD*+T-R96%T;W(@*&=R
M;V9F('9E')E9@HY.#D*)25%3T8*
`
end




[bug #65901] [gropdf] unable to render ellipse with dashed/dotted atribute

2024-06-20 Thread Deri James
Follow-up Comment #2, bug #65901 (group groff):

Morton wrote on the bug list:-
 
> Odd. The pdf on my end is simply broken. It doesn't show in
> mupdf either.

Please could you run the dotted ellipse example again but adding this flag
"-P-d", and post the resulting pdf. This adds some debug data which may be
helpful.


___

Reply to this item at:

  

___
Message sent via Savannah
https://savannah.gnu.org/




Re: [bug #65901] [gropdf] unable to render ellipse with dashed/dotted atribute

2024-06-20 Thread Morten Bo Johansen
On 2024-06-20 Deri James wrote:

> Follow-up Comment #1, bug #65901 (group groff):
>
> After changing elipse to ellipse

That was a typo on my part. I did have "ellipse" in my source.

>  in the two code examples, I can't recreate the first problem.
>  The dots are visible in zathura.

Odd. The pdf on my end is simply broken. It doesn't show in
mupdf either.

Regards,
Morten




[bug #65901] [gropdf] unable to render ellipse with dashed/dotted atribute

2024-06-20 Thread Deri James
Follow-up Comment #1, bug #65901 (group groff):

After changing elipse to ellipse in the two code examples, I can't recreate
the first problem. The dots are visible in zathura. The issue with dashed is
real and is down to my appalling ability with maths. For dashed
ellipse/circles groff outputs each segment as an arc:-

Da h1 v1 h2 v2

Draw arc from current position to (h1,v1)+(h2 ,v2 ) with center at (h1,v1);
then
move the current position to the final point of the arc.

Postscript has an operator called arcn which grops uses:-

arcn
centerx centery radius angle1 angle2 arcn 
- 
clockwise

PDF on the other hand uses cubic bezier curves:-

x1 y1 x2 y2 x3 y3 c

Append a cubic Bézier curve to the current path. The curve extends
from the current point to the point (x3 , y3 ), using (x1 , y1 ) and
(x2 , y2 ) as the Bézier control points (see “Cubic Bézier Curves,” be-
low). The new current point is (x3 , y3 ).

So I have to calculate the control points for the curve. I suspect the
algorithm I am using for this ("borrowed" from
http://www.tinaja.com/glib/bezcirc2.pdf) is breaking down when a very small
arc actually describes a straight line.

As this is a maths problem it may take a while for me to sort out, but if a
proper mathematician can give me an algorithm to create a bezier from the arcn
parameters I can pinch code from grops. :-)



___

Reply to this item at:

  

___
Message sent via Savannah
https://savannah.gnu.org/




[bug #65901] [gropdf] unable to render ellipse with dashed/dotted atribute

2024-06-20 Thread G. Branden Robinson
URL:
  

 Summary: [gropdf] unable to render ellipse with dashed/dotted
atribute
   Group: GNU roff
   Submitter: gbranden
   Submitted: Thu 20 Jun 2024 03:15:55 PM UTC
Category: Driver gropdf
Severity: 3 - Normal
  Item Group: Incorrect behaviour
  Status: None
 Privacy: Public
 Assigned to: deri
 Open/Closed: Open
 Discussion Lock: Any
 Planned Release: None


___

Follow-up Comments:


---
Date: Thu 20 Jun 2024 03:15:55 PM UTC By: G. Branden Robinson 
[https://lists.gnu.org/archive/html/bug-groff/2024-06/msg00045.html Morten Bo
Johansen reported:]

Trying to convert to pdf from this groff source:


   .PS
   elipse dotted
   .PE


with the command:


   groff -Tpdf -p


yields a broken/empty pdf. Opening it in e.g. zathura gives
this error message:


  format error: cannot recognize version marker
  warning: trying to repair broken xref
  warning: repairing PDF document


This also applies to circles.

Trying to convert to pdf from this groff source:


   .PS
   elipse dashed width 6 height 3
   .PE


outputs a dashed ellipse with two unwanted vertical lines
running through it. It only happens if width >= 6. With e.g.
width = 5, it renders okay.

With groff -Tps, there is no problem.

~/ % groff --version
GNU groff version 1.23.0







___

Reply to this item at:

  

___
Message sent via Savannah
https://savannah.gnu.org/