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

Bug 326477

Summary: SVG Problem: GraphicsToGraphics2DAdaptor drawTextLayout renders as an Image
Product: [Modeling] GMF-Runtime Reporter: Simon Pope <skjpope>
Component: GeneralAssignee: Project Inbox <gmf-runtime-inbox>
Status: NEW --- QA Contact:
Severity: minor    
Priority: P3 CC: ansgar.radermacher
Version: 2.3.1   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Simon Pope CLA 2010-09-28 23:10:35 EDT
GraphicsToGraphics2DAdaptor drawTextLayout renders as an Image. This would not be a problem, except that when passing in an SVGGraphics2D object, we end up with an ugly image inserted into an otherwise lovely SVG file.

Does anyone have any idea how we can get around this? We have a Draw2D composite figure that uses TextFlow objects, that render using the SWT TextLayout objects.

A credible workaround (or suggestion) would be *very* welcome!
Comment 1 Simon Pope CLA 2010-10-16 07:46:44 EDT
Workaround is to scale the output resolution of the SVGDocument when created and set the height, width and viewBox of the 'svg' element to adjust. By doing so, the SVG document will render the text layout at any arbitrary resolution (eg. 300 dpi) instead of the screen resolution (72 dpi) but will have the correct size in an HTML or PDF document.