Opened 11 years ago

Closed 18 months ago

#1244 closed defect (fixed)

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: Blocking:
Patch: yes

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 (2)

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

Download all attachments as: .zip

Change History (20)

comment:1 Changed 6 years ago by wojdyr

  • Component set to GUI-generic
  • Keywords printing wxPostScriptDC added

comment:2 Changed 6 years ago by wojdyr

  • Keywords wxPen added

see also #2936

comment:3 Changed 3 years ago by oneeyeman

Is wxPostScriptDC still been used?

comment:4 Changed 3 years ago by oneeyeman

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

comment:5 Changed 3 years 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

comment:6 Changed 3 years 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.

comment:7 Changed 21 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.

comment:8 Changed 21 months ago by oneeyeman

  • Patch set

comment:9 follow-up: Changed 21 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.

comment:10 in reply to: ↑ 9 Changed 21 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.

comment:11 Changed 21 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...

comment:12 Changed 20 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...

comment:13 follow-up: Changed 20 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.

comment:14 in reply to: ↑ 13 Changed 19 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 19 months ago by oneeyeman

First try to implementation

Changed 19 months ago by oneeyeman

Fix compilation of PostScript printing on Windows

comment:15 Changed 19 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.

comment:16 Changed 18 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...

comment:17 Changed 18 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.

comment:18 Changed 18 months ago by VZ

  • Resolution set to fixed
  • Status changed from confirmed to closed

(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.