Community
Participate
Working Groups
build 20020426 Spawned off of bug 13651. The Java editor... "-should support specifying different fonts for viewing and for printing JDT can do this now: Right before calling the StyledText print API you would change all styles to black (remove all non-bold styles, change bold styles to black). When the printing API returns you would change the styles back to the original. Same for the font. Note that there may be a flash when you are done with this as the setStyleRange and setFont API issues a redraw. There shouldn't be any visible style change though."
The proposed solution quoted above actually applies to the following reuqest: "should support printing all text in black" Using a different font for printing is easy.
not for 2.0
*** Bug 25594 has been marked as a duplicate of this bug. ***
*** Bug 19124 has been marked as a duplicate of this bug. ***
*** Bug 134543 has been marked as a duplicate of this bug. ***
Get rid of deprecated state.
>Using a different font for printing is easy. This is not true as we cannot set the font in the StyledTextPrintOptions and hence would have to change the font of the widget which is a no go.
The printing menu action just takes a copy of the requested document/editor text, do the good old fashion setcolor(black), setfont(printfont), and issues many drawString() in a graphics from the PrintJob (or Printable.print() call) and we get on with our lives. If eclipse is in your way to drill to the editor's text, then workaround eclipse. Stop waiting for the clever and perfect API, nothing gets done this way, and people are waiting. Put a big //TODO: refactor in your code with an bugzilla entry to schedule the fix... and keep users happy.
Feel free to provide a patch. We won't work around StyledText.
To all those that have had enough, try the CodePrinter plugin: http://sourceforge.net/projects/codeprinter/ http://eclipse-plugins.2y.net/eclipse/plugin_details.jsp?id=737 http://jdraw.sourceforge.net/index.php?page=7
*** Bug 269870 has been marked as a duplicate of this bug. ***
Having read all comments above mine, did you know that (in 4.5) the stated printing procedure is NOT true for OSX? The editor font and the printing font differ so much that the output is a waste of paper. So, as this bug has been assigned: please make your statements true and provide the EQUAL font for editing and printing on OSX. Thanks in advance. ;JOOP!