|
|
|
|
Re: Set Default Font To Use Eclipse Neon Editor Font Zoom Feature [message #1747075 is a reply to message #1747069] |
Wed, 09 November 2016 09:15 |
Marcel Austenfeld Messages: 160 Registered: July 2009 |
Senior Member |
|
|
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 09:21] Report message to a moderator
|
|
|
Re: Set Default Font To Use Eclipse Neon Editor Font Zoom Feature [message #1747079 is a reply to message #1747075] |
Wed, 09 November 2016 09:21 |
|
Quote:My editor inherits from "org.eclipse.ui.editors.text.TextEditor"
So it is also an AbstractTextEditor and the command is supposed to work as soon as getSymbolicFontName() returns the target font and target font is in the FontRegistry,
I think the best is simply that you debug your code. Put a breakpoint on AbstractTextZoomHandler and try to invoke the zoom command to actually see what it does and what it expects.
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.07086 seconds