GEF diagrams are non-portable [message #636207] |
Fri, 29 October 2010 12:09  |
Eclipse User |
|
|
|
It seems that GEF diagrams' appearance very much depends on the screen DPI setting of an operating system. So when I change DPI my pretty UML diagram becomes absolutely disfigured. Also if I should send the diagram to an another person, then it is very probable that he will see the diagram which has very little similarity to the diagram which was sent, for he may have a different screen settings.
Thus unfortunately it seems that GEF diagrams are non-portable.
I think it is a bug certainly. And I think a new technique must be developed to allow GEF-based editors to create DPI independent diagrams.
I have not found that it discussed before. Shall I open a new bug report?
I am much interested in resolving it. and I have intention to help by patches when any resolution plan will be outlined by the team.
|
|
|
|
|
Re: GEF diagrams are non-portable [message #636302 is a reply to message #636271] |
Sat, 30 October 2010 11:25   |
Eclipse User |
|
|
|
On 30.10.10 09:25, Denis Nedelyaev wrote:
>> There is a mechanism in GMF, called MapMode.
>
> I think, it just converts logical units to device units and can't help
> to resolve the text rendering problem.
Actually I'm not really using this feature (I only know it because I
always has problems with it...)
Also the problem must be solved
> at level of GEF, not GMF.
That's probably true. Actually it's Draw2D where this problem has to be
solved.
> Probable one of best ways to resolve it is to use the Java2D
> capabilities of off-screen rendering instead of drawing text using SWT
> directly.
This would be too much work and not really necessary. However, Kristian
has implemented text rendering using Java2D for GEF3D, so if you need
that you may look at that (it's somewhere in Draw3D). Anyway, I figure
it would be sufficient to simply adjust text size to the screen's DPI
settings. That is, you only have to implement your own
org.eclipse.draw2d.Graphics class (by extending one of the existing
implementations) and correct the text size.
Cheers,
Jens
|
|
|
Re: GEF diagrams are non-portable [message #640942 is a reply to message #636207] |
Tue, 23 November 2010 10:53  |
Eclipse User |
|
|
|
On 29/10/2010 17:09, Denis Nedelyaev wrote:
> It seems that GEF diagrams' appearance very much depends on the screen
> DPI setting of an operating system. So when I change DPI my pretty UML
> diagram becomes absolutely disfigured. Also if I should send the diagram
> to an another person, then it is very probable that he will see the
> diagram which has very little similarity to the diagram which was sent,
> for he may have a different screen settings.
>
> Thus unfortunately it seems that GEF diagrams are non-portable.
>
> I think it is a bug certainly. And I think a new technique must be
> developed to allow GEF-based editors to create DPI independent diagrams.
>
> I have not found that it discussed before. Shall I open a new bug report?
>
> I am much interested in resolving it. and I have intention to help by
> patches when any resolution plan will be outlined by the team.
I wrote a routine to adjust the font size for GEF figures if on Windows
and the DPI is not the usual 96 DPI. It's basically this:
public static Font getAdjustedWindowsFont(Font font) {
int DPI = font.getDevice().getDPI().y;
if(DPI != 96) {
FontData[] fd = font.getFontData();
double factor = (double)96 / DPI;
fd[0].height *= factor;
}
return font;
}
|
|
|
Powered by
FUDForum. Page generated in 0.03741 seconds