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

Bug 315873

Summary: Allow to use custom font in FigureUtilities
Product: [Tools] GEF Reporter: Masayuki Fuse <fuse>
Component: GEF-Legacy Draw2dAssignee: gef-inbox <gef-inbox>
Status: RESOLVED INVALID QA Contact:
Severity: enhancement    
Priority: P3 CC: ahunter.eclipse, kitlo, nyssen
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Masayuki Fuse CLA 2010-06-05 07:10:04 EDT
Build Identifier: 3.6.0RC3

"Meiryo" is returned as system font on WindowsVista and 7 Japanese, that's designed on a bit higher base line to get better alignment for alphabet and ideographic mixed string rendering.

This causes of Bug 312492 as the ruler font is system font. The font should be selectable for user to avoid the problem. 

Reproducible: Always
Comment 1 Kit Lo CLA 2010-08-09 12:24:40 EDT
Can we target this for 3.7?
Comment 2 Alexander Nyßen CLA 2011-01-08 08:30:40 EST
What do you mean with "make font selectable" within FigureUtilities?
Comment 3 Masayuki Fuse CLA 2011-01-11 00:44:58 EST
The font should be selectable in Preferences as some other components at General > Appearance > Colors and Fonts
Comment 4 Alexander Nyßen CLA 2011-01-11 06:01:52 EST
Well, FigureUtilities is a mere framework class of Draw2d that is not linked to any Eclipse Workbench UI concept, and should indeed not be, as Draw2d is to be independent of Eclipse. As such, there is also no preference related to it (which also makes no sense). In which context are you using FigureUtilities?
Comment 5 Masayuki Fuse CLA 2011-01-12 01:44:44 EST
Our product is just calling GMF API GraphicalEditPart. I thought that GEF draw2d set the font and opened this enhancement.
If eclipse workbench UI is not a right place, I guess that having a font properties file in GEF plug-in may be an another choice.
Comment 6 Alexander Nyßen CLA 2011-01-12 02:36:43 EST
Draw2d figures use a font to display text. They are however not responsible of managing font selection or preferences, because that would be within the responsibility of the controller part in an MVC architecture. As such, there is no sense in introducing a properties file or preferences to Draw2d. 

One could think of introducing basic support for handling (figure related) preferences in GEF (MVC), but this is another issue. It has been out of scope for GEF up to now, because GMF deals with this. However , for clients that do not use GMF it would be legal to request better support in GEF (MVC) for this, as they up to now have to do pretty much hand-coding on their own. Maybe this would be another example where pulling done some of the GMF functionality could make sense (where already have some issues concerning this; due to API restrictions it may not happen before the next major release of both frameworks). 

In your concrete scenario, GMF provides support for what you want to do. E.g. take a look into ShapeEditPart#refreshFont(), where the figure's fonts get updated based on the settings in the view (i.e. the model). GMF also provides support for having a properties section and preferences to deal with fonts, so that could be used to address your initial system font issue.
Comment 7 Alexander Nyßen CLA 2011-01-14 02:33:10 EST
Resolving this as invalid due to last comments.
Comment 8 Masayuki Fuse CLA 2011-01-14 03:25:49 EST
I will tell the comment to our development team.

As for bug 312492, it occurs on GEF example. I'd like to know your opinion. Thanks
Comment 9 Alexander Nyßen CLA 2011-01-14 04:19:07 EST
(In reply to comment #8)
> I will tell the comment to our development team.
> 
> As for bug 312492, it occurs on GEF example. I'd like to know your opinion.
> Thanks


(In reply to comment #8)
> I will tell the comment to our development team.
> 
> As for bug 312492, it occurs on GEF example. I'd like to know your opinion.
> Thanks

Bug #312492 indeed is an issue that could be related to GEF or SWT. I will add my comments there.