I'm reading "Undocumented Secrets of matlab-java programming" by Yair Altman and try to change editor's font by means which are described in this book, but it has explicit examples only for color. Anyway, I managed to change font in matlab.prf by the following code:
FontName = "Consolas";
javaLangString = java.lang.String(FontName);
javaAwtFont = java.awt.Font(javaLangString,0,10);
com.mathworks.services.Prefs.setFontPref('Desktop.Font.Code2',javaAwtFont);
It does change font in preferences but doesn't press "apply" button. In other words it doesn't refresh environment font but change it in configuration file (matlab.prf). In case of color it was solved by this:
com.mathworks.services.ColorPrefs.notifyColorListeners('ColorsBackground');
It there any way to do this for font?
1 Comment
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/376388-undocumented-style-of-changing-matlab-font#comment_523168
Direct link to this comment
https://uk.mathworks.com/matlabcentral/answers/376388-undocumented-style-of-changing-matlab-font#comment_523168
Sign in to comment.