Bug 430948 - Font used in Tree editor should be standard Eclipse Font
Summary: Font used in Tree editor should be standard Eclipse Font
Status: CLOSED FIXED
Alias: None
Product: Sirius
Classification: Modeling
Component: Tree (show other bugs)
Version: 1.0.0M5   Edit
Hardware: PC Linux
: P4 normal (vote)
Target Milestone: 5.0.0M6   Edit
Assignee: Pierre Guilet CLA
QA Contact:
URL:
Whiteboard:
Keywords: noteworthy, triaged
Depends on:
Blocks:
 
Reported: 2014-03-23 03:52 EDT by Michael Vorburger CLA
Modified: 2017-06-29 03:33 EDT (History)
4 users (show)

See Also:


Attachments
Screenshot Sirius Tree and EMF editor (23.44 KB, image/png)
2014-04-10 04:54 EDT, Florian Barbin CLA
no flags Details
Table and tree on Mac OS X (189.21 KB, image/png)
2015-02-25 11:56 EST, Maxime Porhel CLA
no flags Details
Sample Tree and Tables to see the issue (3.47 KB, application/zip)
2015-02-25 12:11 EST, Maxime Porhel CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Vorburger CLA 2014-03-23 03:52:17 EDT
The Font used in a Tree Editor doesn't seem to be the "standard" Eclipse Font - e.g. it's different from how a standard EMF Tree Editor looks like.  Saw this on Linux; not tested on Win, but probably same problem.

Let me know if this bug isn't clear enough (will post screenshot if needed).
Comment 1 Florian Barbin CLA 2014-04-10 04:54:45 EDT
Created attachment 241817 [details]
Screenshot Sirius Tree and EMF editor
Comment 2 Florian Barbin CLA 2014-04-10 04:55:43 EDT
Hi, 

thanks for the report!

I've attached a screenshot that shows the difference between the Sirius Tree Editor and the EMF one.
Comment 3 Maxime Porhel CLA 2015-02-25 11:56:38 EST
Created attachment 251101 [details]
Table and tree on Mac OS X

I observe the same issue on Mac OS X
Comment 4 Maxime Porhel CLA 2015-02-25 12:11:13 EST
Created attachment 251103 [details]
Sample Tree and Tables to see the issue

Steps to reproduce: 
 . Unzip the attached test case. 
 . Open the session 
 . Open the existing table, cross table and tree.
 . See the font size.
Comment 5 Pierre-Charles David CLA 2015-12-15 04:11:35 EST
Moving out of the 4.0 scope for now, along with all the other issues which were there "by default". This does not mean some of these will not be re-integrated at some point, but for now these issues are not part of the roadmap for 4.0.

If you feel strongly about this removal from 4.0 and/or are ready to sponsor the corresponding work, feel free to comment.
Comment 6 Pierre-Charles David CLA 2016-11-23 15:58:12 EST
Note that if DTreeItemLabelProvider.getFont(Object) returns null we get the correct (standard) font. However because this can be customized in the VSM, each TreeItemDescription has a TreeItemStyle with explicit font size and format, and we use that the compute the font to use.

We could set different defaults in the VSM (in particular the size), but this would still be "hard-coded" at specification time in the VSM, and may not match the runtime users' choice of default font size. There is no way currently to configure a TreeItemStyle to say "use whichever size is the standard font size at runtime".

I'm not sure it would be the right approach, but such an option could be added either:
* to each individual TreeItemStyle;
* to the whole Tree (maybe making it the default, requiring opt-in from the specifier to declare "I will need custom fonts, so please don't ignore the sizes I set in the TreeItemStyles");
* or maybe even as a user preference (something like "Sirius > Sirius Tree > [ ] Always use standard font size" (this is not that different from browser preferences to always use user-defined fonts instead of the ones requested by each page).
Comment 7 Eclipse Genie CLA 2017-02-07 05:48:28 EST
New Gerrit change created: https://git.eclipse.org/r/90510
Comment 8 Pierre Guilet CLA 2017-02-08 04:42:49 EST
The first step done regarding this ticket is to use a preference "Always use standard font size" that will allows to use environment font size instead of the one defined in the VSM when checked. By default this option is not checked.

This option only handle font size override.

For later, we can consider doing modification in the VSM editor to be able to specify for TreeItemStyle a value like 0 or -1 or no value to tells Sirius to use runtime font height when displaying tree items.

We also can consider doing a mechanism allowing to use the runtime font as well as font height.
Comment 10 Pierre-Charles David CLA 2017-03-09 08:51:34 EST
Fixed by b1d79cd38c1b793cb5963ffa5242a7ffe725c0f2, which adds a user preference to ignore custom font sizes that may be defined in the VSM to use the default Eclipse one.
Comment 11 Eclipse Genie CLA 2017-03-16 09:01:57 EDT
New Gerrit change created: https://git.eclipse.org/r/93199
Comment 13 Eclipse Genie CLA 2017-03-25 08:50:51 EDT
New Gerrit change created: https://git.eclipse.org/r/93851
Comment 15 Jessy Mallet CLA 2017-05-15 09:04:03 EDT
Validated with Sirius 5.0.0.201705121003
Comment 16 Pierre-Charles David CLA 2017-05-16 03:43:04 EDT
Verified by Jessy.
Comment 17 Eclipse Genie CLA 2017-06-08 09:16:12 EDT
New Gerrit change created: https://git.eclipse.org/r/98904
Comment 19 Pierre-Charles David CLA 2017-06-29 03:33:14 EDT
Available in Sirius 5.0.0, see https://wiki.eclipse.org/Sirius/5.0.0 for details.