Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Figure truncation when printing on Mac
Figure truncation when printing on Mac [message #249661] Thu, 16 July 2009 10:02 Go to next message
Justin Dolezy is currently offline Justin DolezyFriend
Messages: 68
Registered: July 2009
Member
Hi,

When printing on a Mac (Leopard) I'm seeing some figures truncate their
contents - notably anything with a TextFlow in it, the last few chars at
the right edge get chopped. Has anyone else experience this?

I believe the cause of the problem is that Printer.getDPI() always returns
72x72 - as reported in this bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=219133, which also causes
low quality output.

My diagrams are slightly larger than the available print area (small size
due to low res reported) so the scale factor is just under 0.8, causing
the TextFlow truncation.

Widening the figure containing the TextFlow doesn't work - presumably
because its preferred size is based on the width of the contained text.
Padding the text with spaces at the end does work. Is there a way to force
the width of the TextFlow perhaps? Its currently in a StackLayout.

Thanks,
Justin
Re: Figure truncation when printing on Mac [message #249731 is a reply to message #249661] Sat, 25 July 2009 03:06 Go to previous message
Alex Boyko is currently offline Alex BoykoFriend
Messages: 200
Registered: July 2009
Senior Member
Hi,

The shape is probably sized to fit the text (TextFlow) inside. Layout asks
the GC to calculate the size of the string given a font. If the size of
the string is incorrect, the text may get truncated. See if
GC#stringExtents(...) returns the same size of the text as when the text
is painted. If not, you may want to call GC#setAdvanced(false). Layout
uses an off-screen GC to determine the size of the text in draw2d. If
off-screen GC is set up differently from the actual GC during painting
then text might be cut off as well.

Cheers,
Alex
Previous Topic:Wiggly line
Next Topic:'No more handles' when creating image
Goto Forum:
  


Current Time: Thu Apr 25 17:19:03 GMT 2024

Powered by FUDForum. Page generated in 0.03407 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top