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
이 댓글에 대한 바로 가기 링크
https://kr.mathworks.com/matlabcentral/answers/376388-undocumented-style-of-changing-matlab-font#comment_523168
이 댓글에 대한 바로 가기 링크
https://kr.mathworks.com/matlabcentral/answers/376388-undocumented-style-of-changing-matlab-font#comment_523168
댓글을 달려면 로그인하십시오.