Bug 14955

Summary: [printing] Support specifying different fonts for viewing and for printing
Product: [Eclipse Project] Platform Reporter: Knut Radloff <knut_radloff>
Component: TextAssignee: Kai-Uwe Maetzel <kai-uwe_maetzel>
Status: ASSIGNED --- QA Contact:
Severity: enhancement    
Priority: P5 CC: andrew.ferguson, batthish, dak2009, daniel_megert, J.F.Lanting, quartz12h, randolphskahle-eclipse.a49c93
Version: 2.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 13651    

Description Knut Radloff CLA 2002-04-30 15:42:36 EDT
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."
Comment 1 Knut Radloff CLA 2002-04-30 15:45:25 EDT
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.
Comment 2 Erich Gamma CLA 2002-05-09 17:57:21 EDT
not for 2.0
Comment 3 Dani Megert CLA 2003-10-27 04:07:47 EST
*** Bug 25594 has been marked as a duplicate of this bug. ***
Comment 4 Dani Megert CLA 2003-10-27 04:15:56 EST
*** Bug 19124 has been marked as a duplicate of this bug. ***
Comment 5 Dani Megert CLA 2006-04-04 09:47:00 EDT
*** Bug 134543 has been marked as a duplicate of this bug. ***
Comment 6 Dani Megert CLA 2007-06-22 09:59:12 EDT
Get rid of deprecated state.
Comment 7 Dani Megert CLA 2007-10-23 11:30:30 EDT
>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.
Comment 8 quartz quartz CLA 2007-10-23 20:11:05 EDT
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.
Comment 9 Dani Megert CLA 2007-10-24 03:02:23 EDT
Feel free to provide a patch. We won't work around StyledText.
Comment 11 Anton Leherbauer CLA 2009-03-25 03:38:21 EDT
*** Bug 269870 has been marked as a duplicate of this bug. ***
Comment 12 J.F.Lanting CLA 2015-02-10 08:51:13 EST
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!