Set Default Font To Use Eclipse Neon Editor Font Zoom Feature [message #1736017] |
Fri, 24 June 2016 08:35  |
Eclipse User |
|
|
|
I would like to adapt my custom Eclipse editor to use the new font zoom feature as described here ("Commands and shortcuts to zoom in text editors"):
https://www.eclipse.org/eclipse/news/4.6/M4/
Momentarily I set the default font in a PreferenceInitializer class.
PreferenceConverter.setDefault(storeR, "colourkeyfont1", new FontData(font, fsize, 0));
However this ahs no effect when using the default TextEditor font settings. I also tried the JFaceResources.getTextFont() to no avail.
How do I have to configure the default editor font that the new feature is applied?
|
|
|
|
|
|
Re: Set Default Font To Use Eclipse Neon Editor Font Zoom Feature [message #1747075 is a reply to message #1747069] |
Wed, 09 November 2016 04:15   |
Eclipse User |
|
|
|
My editor inherits from "org.eclipse.ui.editors.text.TextEditor"
So I have to add a font definition to my editor from the extension points like this:
http://stackoverflow.com/questions/34952310/how-to-change-font-size-for-an-eclipse-editor-programmatically/34953145
Do I have to implement the getSymbolicFontName() myself?
Will the editor automatically resize the fonts from the font definition after an zoom event or do I need to implement an extra action to update my fonts from my custom font preferences?
Please note that I have defined several font preferences to change several fonts individually.
IPreferenceStore storeR = EditorPlugin.getDefault().getPreferenceStore();
Font f= JFaceResources.getFont(JFaceResources.TEXT_FONT);
PreferenceConverter.setDefault(storeR, "colourkeyfont", f.getFontData());
PreferenceConverter.setDefault(storeR, "colourkeyfont1", f.getFontData());
PreferenceConverter.setDefault(storeR, "colourkeyfont2", f.getFontData());
PreferenceConverter.setDefault(storeR, "colourkeyfont3", f.getFontData());
PreferenceConverter.setDefault(storeR, "colourkeyfont4", f.getFontData());
PreferenceConverter.setDefault(storeR, "colourkeyfont5", f.getFontData());
PreferenceConverter.setDefault(storeR, "colourkeyfont6", f.getFontData());
PreferenceConverter.setDefault(storeR, "colourkeyfont7", f.getFontData());
PreferenceConverter.setDefault(storeR, "colourkeyfont8", f.getFontData());
[Updated on: Wed, 09 November 2016 04:21] by Moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.28840 seconds