Ticket #1244 (closed defect: fixed)

Opened 10 years ago

Last modified 3 months ago

wxPostScriptDC ignores pen's join and cap

Reported by: bernhard Owned by:
Priority: low Milestone:
Component: GUI-generic Version:
Keywords: printing wxPostScriptDC wxPen testing-needed simple Cc: bernhard
Blocked By: Patch: yes
Blocking:

Description

The wxPostScriptDC ignores the join and cap styles of
the pen.

I observed this originally on the WX_2_4_BRANCH but
judging from the source code this bug is also present
in HEAD.

Attachments

1244.patch download (1.5 KB) - added by oneeyeman 5 months ago.
First try to implementation
msw_ps.patch download (1.6 KB) - added by oneeyeman 5 months ago.
Fix compilation of PostScript printing on Windows

Change History

  Changed 5 years ago by wojdyr

  • keywords printing wxPostScriptDC added
  • component set to GUI-generic

  Changed 5 years ago by wojdyr

  • keywords wxPen added

see also #2936

  Changed 18 months ago by oneeyeman

Is wxPostScriptDC still been used?

  Changed 17 months ago by oneeyeman

Since #2936 has been closed, I think it's time to close this one as well...

  Changed 17 months ago by Mojo

wxPostScriptDC still ignores pen's join and cap.
In windows it's OK but in linux it isn't.
I have ubuntu 10.04.3 , wxGTK-2.8.10, gcc version 4.4.3

  Changed 17 months ago by vadz

  • status changed from new to confirmed

Yes, there is no mention of wxPenJoin nor wxPenCap in this code.

I think PostScript actually does support both pen options so it should be possible to implement this and probably it even should be relatively simple so any patches from people interested in this functionality would be very welcome.

  Changed 7 months ago by oneeyeman

Attached please find the first try to implement the functionality needed.
The code compiles cleanly and the printing sample compiles as well.

However I don't have a way to test this as I don't have a PS printer.
Could someone please try it and let me know.

Thank you.

  Changed 7 months ago by oneeyeman

  • patch set

follow-up: ↓ 10   Changed 7 months ago by vadz

FWIW you don't need to print PS output, you can just open it in Ghostscript or any other PS viewer.

in reply to: ↑ 9   Changed 7 months ago by oneeyeman

Vadim,

Which sample I can use to test it? "printing"?

Replying to vadz:

FWIW you don't need to print PS output, you can just open it in Ghostscript or any other PS viewer.

  Changed 7 months ago by vadz

  • priority changed from normal to low

Well, it's the only sample using this class. So either you use it (after adding code testing various joins/caps to it) or you write a new test...

  Changed 5 months ago by vadz

  • keywords testing-needed added

BTW, looking at the patch, what's the meaning of buffer << n in it? AFAICS it should be simply buffer = n...

follow-up: ↓ 14   Changed 5 months ago by oneeyeman

Vadim,
I don't know (don't remember). I think I got compiler error, but not sure.
In any case it should be tested and maybe you are right.

in reply to: ↑ 13   Changed 5 months ago by oneeyeman

Vadim,
Replying to oneeyeman:

Vadim,
I don't know (don't remember). I think I got compiler error, but not sure.
In any case it should be tested and maybe you are right.

Yes, got a compiler error:

C:\wxWidgets\src\generic\dcpsg.cpp(1210) : error C2248: '=' : cannot access private member declared in class 'wxString'

..\..\include\wx/string.h(461) : see declaration of '='

But the patch for some reason does not work. The resulting page is empty.
I will try to see what is happenning if time permits.

Changed 5 months ago by oneeyeman

First try to implementation

Changed 5 months ago by oneeyeman

Fix compilation of PostScript printing on Windows

  Changed 5 months ago by oneeyeman

  • keywords simple added

Attached please find 2 patches: first is 1244.patch which implements the functionality missing that is referenced by this ticket, second is msw_ps.patch which fixes the compilation of printing sample with the postscript printing.

Everything works as expected.

Please apply.

  Changed 3 months ago by vadz

I don't understand how could this work, you're appending to the buffer which already had some contents so you're printing it out twice. I've fixed it blindly as I still have no test code for this...

  Changed 3 months ago by VZ

(In [73628]) Test PostScript printing in the print sample if it is compiled in.

Just use wxUSE_POSTSCRIPT instead of wxTEST_POSTSCRIPT_IN_MSW and also do it
under all platforms, not just MSW.

See #1244.

  Changed 3 months ago by VZ

  • status changed from confirmed to closed
  • resolution set to fixed

(In [73629]) Implement support for pen cap and join in wxPostScriptDC.

Use PostScript "setlinecap" and "setlinejoin" commands to do it.

Closes #1244.

Note: See TracTickets for help on using tickets.