TextFlow and FlowPage producing ugly-cropped texts [message #486943] |
Mon, 21 September 2009 05:09  |
Eclipse User |
|
|
|
Hi,
where implementing a tool using GEF. For drawing some labels, we've
implemented the following Figure:
public class PetriNetLabelFigure extends Figure {
private TextFlow textFlow;
private FlowPage flowPage;
public PetriNetLabelFigure() {
setBackgroundColor(ColorConstants.tooltipBackground);
setForegroundColor(ColorConstants.tooltipForeground);
flowPage = new FlowPage();
textFlow = new TextFlow();
textFlow.setLayoutManager(new ParagraphTextLayout(textFlow,
ParagraphTextLayout.WORD_WRAP_SOFT));
flowPage.add(textFlow);
setLayoutManager(new StackLayout());
add(flowPage);
}
....
This works so far, except for 2 problems:
1) While zooming, with some text-lengths in the flowPage (we're setting
these using textFlow.setText) and some zoom-levels, the last character of
the text gets truncated. I consider this a bug, so we posted this under
https://bugs.eclipse.org/bugs/show_bug.cgi?id=288745
2) When changing the windows font-size from 96 dpi to 120 dpi and opening my
drawings, the text gets truncated very ugly. Is there a way to make TextFlow
and FlowPage independent of the windows "font-size" (set unter
system-display-advanced) ? This problems makes GEF nearly unusable in our
context, since having different dpi-settings is commonly used here.
Is there a better way to format a label with automatic word-wrap? It would
be great if our drawings would look the same when getting openend again. Can
I do some manual scaling? Any hints?
http://dev.eclipse.org/newslists/news.eclipse.platform.swt/m sg23152.html
seems to have the same problems, but there is no solution given over there
:-(
-orgler
|
|
|