Community
Participate
Working Groups
20080422-0800 As bug 225351 is fixed, we can remove the restriction on StyledCellLabelProvider about the usage of fonts in stylers.
Created attachment 97217 [details] patch Patch to support different fonts in Stylers. Note that if bug 228376 could be fixed, the implementation would be simpler and more efficient (see comments in patch)
Martin, do you have a snippet for testing this?
Created attachment 97238 [details] patch for org.eclipse.jface.snippets
Looks good - thanks Martin! Released to HEAD.
Reopening - the patch does not work on GTK.
Created attachment 97487 [details] patch to make it work on GTK
Created attachment 97488 [details] mylyn/context/zip
I have reverted Martin's patches. We talked about this and agreed that we should postpone font support until 3.5 rather than trying to work around bug 228695 because the workaround has a performance cost. It also makes sense to avoid major changes to how we do owner draw at this late point in the development cycle.
Boris, can you assign a milestone to this? I guess we also need the OK for the blocking SWT bugs before we proceed.
(In reply to comment #9) > Boris, can you assign a milestone to this? I guess we also need the OK for the > blocking SWT bugs before we proceed. Yes - at least they are not currently listed on SWT's milestone plan. Steve, can we expect fixes for bug 228376 and bug 228695 in 3.5, or do we need to defer?
Created attachment 118828 [details] combined patch Combined patch with fix for focus rectangle drawing on Windows XP.
(In reply to comment #11) > Created an attachment (id=118828) [details] > combined patch > > Combined patch with fix for focus rectangle drawing on Windows XP. > Still testing now, but FYI, those snippets that obtain a display in a static initializer don't work on Mac (Carbon or Cocoa). The static initializers are run in one thread and the main method is invoked in another so there's no default display.
Thanks Apple!
(In reply to comment #13) > Thanks Apple! > You are such a bitter, bitter man.
Created attachment 118939 [details] Updated patch that works on OS X This appears to work fine on Carbon and Cocoa.
Unfortunately, it looks like this will slow down things quite a bit, at least when using my synthetic test case that measures refreshes per second. Since I don't know how much this matters in practice, I have released the changes to HEAD for now so that we get a couple of builds with the font support (i.e. with the slow down). Here are my numbers, from running org.eclipse.jface.tests.viewers.interactive.StyledCellLabelProviderTests (in ui.tests), for the case where owner draw is enabled: old code new code Windows XP 16 rps 15 rps Linux GTK 33 rps 27 rps Mac Carbon 20 rps 13 rps Mac Cocoa 25 rps 16 rps (rps = refresh operations per second) Now the question is, is the new feature (being able to have multiple fonts in one cell) worth the >30% slowdown for refresh operations on the Mac?
I just realized that the slowdown could be happening only when actually using multiple fonts, not just by switching to the new code. I updated my test program with a new option to test this but haven't been able to run it on the platforms yet.
Here are some new numbers, all units are refresh operations per second, i.e. more is better. Mac Carbon N20081201-2011 old code, no custom draw 39.5 new code, no custom draw 39.4 old code, custom draw single font 28.2 new code, custom draw single font 20.8 old code, custom draw and bold n/a new code, custom draw and bold 18.9 Mac Cocoa I20081202-1812 old code, no custom draw 60.0 new code, no custom draw 60.0 old code, custom draw single font 30.0 new code, custom draw single font 27.1 old code, custom draw and bold n/a new code, custom draw and bold 23.3 Linux GTK I20081202-1812 old code, no custom draw 58 new code, no custom draw 58 old code, custom draw single font 35 new code, custom draw single font 30 old code, custom draw and bold n/a new code, custom draw and bold 28
Windows XP N20081206-2000 old code, no custom draw 31 new code, no custom draw 31 old code, custom draw single font 18 new code, custom draw single font 17 old code, custom draw and bold n/a new code, custom draw and bold 16
Marking as fixed. The performance degradation does not seem to be too bad, and I don't think it will matter much overall. Let's see if there is any feedback.
Boris I saw you updated the Snippet to add this support - now people looking at the snippets under 3.4 get confused because fonts are not working there. Could we add a comment in the snippet to state that Font-Stuff only works in 3.5 M4.
(In reply to comment #21) > Could > we add a comment in the snippet to state that Font-Stuff only works in 3.5 M4. Done.
font works but fontStyle is ignored?
(In reply to comment #23) > font works but fontStyle is ignored? See bug 131988.
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/170638
Gerrit change https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/170638 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=d7005e7340ba64ceca88fbb35fa524b9eb86529e