Bug 14955 - [printing] Support specifying different fonts for viewing and for printing
Summary: [printing] Support specifying different fonts for viewing and for printing
Status: ASSIGNED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P5 enhancement with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: Kai-Uwe Maetzel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 19124 25594 134543 269870 (view as bug list)
Depends on:
Blocks: 13651
  Show dependency tree
 
Reported: 2002-04-30 15:42 EDT by Knut Radloff CLA
Modified: 2015-02-10 08:51 EST (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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!