Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 315140

Summary: StyledText.RTFWriter ignores font style
Product: [Eclipse Project] Platform Reporter: Rodrigo Peretti <rodrigo>
Component: SWTAssignee: Felipe Heidrich <eclipse.felipe>
Status: RESOLVED FIXED QA Contact: Felipe Heidrich <eclipse.felipe>
Severity: normal    
Priority: P3 CC: eclipse.felipe
Version: 3.6   
Target Milestone: 3.7 M2   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Rodrigo Peretti CLA 2010-05-31 16:24:25 EDT
Eclipse 3.6 RC2

I'm trying to use StyledText to create a simple Rich Text editor. In order to extract RTF from it, I'm using the clipboard workaround.

I'm running into an issue when the style of the text is defined in the font (as opposed to fontStyle). It seems RTFWriter only writes styles if they are in fontStyle but ignores the ones in FontData.getStyle()

I wonder if this is a bug or I am missing something.
Comment 1 Felipe Heidrich CLA 2010-05-31 17:05:36 EDT
This is bug.

In StyledText$RTFWriter#writeHeader it ignores the font style when writting the font table (see that fd.getStyle() is never called).
We could also fix the bug writeStyledLine when item.style != null.

After 3.6, only very serious bugs can be included in the build for 3.6 at this point. Sorry Rodrigo.
Comment 2 Felipe Heidrich CLA 2010-08-13 15:48:10 EDT
Fixed in HEAD > 20100813