Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 31067 - [Font] Can't change workbench font
Summary: [Font] Can't change workbench font
Status: RESOLVED DUPLICATE of bug 27408
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P2 major (vote)
Target Milestone: 2.1 RC1   Edit
Assignee: Tod Creasey CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 27406
Blocks: 31156
  Show dependency tree
 
Reported: 2003-02-06 03:21 EST by Gunnar Wagenknecht CLA
Modified: 2003-02-12 08:06 EST (History)
0 users

See Also:


Attachments
Patch to Font PreferencePage (5.35 KB, patch)
2003-02-07 14:51 EST, Tod Creasey CLA
no flags Details | Diff
Patch for message.properties (662 bytes, patch)
2003-02-07 14:52 EST, Tod Creasey CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gunnar Wagenknecht CLA 2003-02-06 03:21:15 EST
In latest integration builds it is not possible to change the workbench text 
editor font.

open any editor or view that uses this font
open "Windows -> Preferences -> Workbench -> Font"
select "Text Font"
change font to another font
click "Apply" -> new font is applied and visible
click "OK" -> old font will be reapplied
Comment 1 Gunnar Wagenknecht CLA 2003-02-06 03:37:05 EST
New font works after restarting Eclipse. A restart shouldn't be necessary.

Anyway, why are there two font options for the same font?

"Java Editor Text Font"
"Text Font"

This is really confusing since the JDT Java editor has its own appearance 
preference page. I also can't see a difference between these two settings. 
Changing the "Java Editor Text Font" also changes the "Text Font" to the same 
font and vice versa. 

The behavior is not consistent and confusing. There should be only one "Text 
Font".

Comment 2 Tod Creasey CLA 2003-02-06 09:59:01 EST
The Java font is the text font by default - if you change the text font and 
have not changed the java font you get it on both.

I'll verify it behaves as desired in 2.1.
Comment 3 Gunnar Wagenknecht CLA 2003-02-06 11:44:01 EST
Its more complicated.

You can change as you want and click "Apply" and the changes are applied. But 
as soon as you click "OK" they are changed so that both reflect the same font.

Anyway, it is better and more intuitive to have the preference option for the 
Java editor text font on the Java editor preference page.
Comment 4 Tod Creasey CLA 2003-02-06 16:33:29 EST
I can't replicate this behaviour in 20030205

Here is the steps I used
1) Open a java editor
2) Opened the fonts preference page
3) Selected the bold italic version of the default
4) Hit Apply. It was applied to the editor
5) Hit OK. No change
6) Reopened the font preference page and selected dialog font
7) Showed up as bold italic as it should have

For 2.1 the fonts were moved to a central preference page to prevent the need 
for plugin developers to manage their own fonts which was very difficult when 
they wanted to just pass through a JFcae font if thiers was not specified.

There were also complaints from users that they had to search around for fonts.
Comment 5 Gunnar Wagenknecht CLA 2003-02-07 02:57:01 EST
I tried I20030206 and have the confusing behavior.

- use a new workspace
- create new simple project with a simple text file
- create a new java project with a simple class
- open text editor for text file and java editor for java file (java editor is 
visible)

By default, "Java Editor Text Font" and "Text Font" are set to "Courier-regular-
10". Now start playing with fonts :)

1. change text font to any another (fanc) font, click ok
-> Java Editor is changed also 
-> EXPECTED

2. open preferences again
3. select "Java Editor Text Font"
4. click "Restore Defaults"
-> nothing changes, preview still shows fancy font

5. select "Text Font"
-> Text Font was reseted to "Courier-regular-10"

6. select "Java Editor Text Font
-> now Java Editor Text Font is also reseted to "Courier-regular-10"

7. select "Text Font"
8. change font to "Courier New-regular-10" 
(I took this font from Acrobat some time ago. It renders better and the Courier 
system font.)
-> preview shows new font

9. click "Apply"
-> Java editor under preferenced dialog also updates to new font

10. click "OK"
-> Java editor is reseted to "Courier-regular-10"
-> UNEXPECTED
Comment 6 Tod Creasey CLA 2003-02-07 11:49:58 EST
Now we have found the problem....

The java editor font is defualting to the text font - the problem is when you 
hit Restore Defualts the Text Font is being reset after the java font so you 
do not see the update being propogated.

We should also make this more obvious in the text 
Comment 7 Gunnar Wagenknecht CLA 2003-02-07 11:54:12 EST
And why is it reseted between step 9 and 10?
Comment 8 Tod Creasey CLA 2003-02-07 12:07:17 EST
Why is it unexpected? If the dialog shows Courier 10 and you hit OK you should 
expect it to show up in the editor in another font?
Comment 9 Gunnar Wagenknecht CLA 2003-02-07 12:11:04 EST
No! Please watch the difference. 

"Courier New-regular-10" != "Courier-regular-10"

The dialog shows "Courier New-regular-10" which is a slightly different font. 
Click Apply and also the editor has it. Next click ok and the editor looses it 
becomming the old "Courier-regular-10".
Comment 10 Tod Creasey CLA 2003-02-07 14:51:32 EST
Created attachment 3369 [details]
Patch to Font PreferencePage
Comment 11 Tod Creasey CLA 2003-02-07 14:52:12 EST
Created attachment 3370 [details]
Patch for message.properties
Comment 12 Tod Creasey CLA 2003-02-07 14:53:31 EST
Thanks Gunnar - I have replicated the Courer/Courier new issue as well.
Comment 13 Tod Creasey CLA 2003-02-10 08:51:18 EST
Fixed in build >20030210
Comment 14 Tod Creasey CLA 2003-02-11 09:07:01 EST
Reopening. I am getting the "Courier New" problem Gunnar mentioned in the 
latest code stream.
Comment 15 Tod Creasey CLA 2003-02-11 10:35:32 EST
The current problem is due to the JavaPlugin slamming the text font in a 
propertyChangeListener.
Comment 16 Dani Megert CLA 2003-02-12 06:21:55 EST
I contradict to Tod's comment. In my opinion the bug is in
PreferenceConverter.setValue(IPreferenceStore,String,FontData[]) which as a side
effect (which is not mentioned in the API contract) modifies the JFace registry.

See bug 27408 for more details.
Comment 17 Tod Creasey CLA 2003-02-12 08:06:51 EST

*** This bug has been marked as a duplicate of 27408 ***