MATLAB: Is the font in the GUI rendered differently between MATLAB 6.5 (R13) and MATLAB 7.0 (R14)

figuresfontguiguidejavaMATLABposition;rendersize;uicontrol

The font in my GUI does not look like what I had intended when I first designed my GUI if I display the GUI in different versions of MATLAB. The position and the size of the fonts are different. As a result, I cannot design my GUI to have the desired appearance in both MATLAB 6.5 (R13) and MATLAB 7.0 (R14).

Best Answer

MATLAB 7.0 (R14) uses a Java feature to display figures. This feature is not available in MATLAB 6.5 (R13). As a result of this feature, the fonts are displayed differently between the two versions.
To work around this issue, you can set the default font and font size to one that has not been changed between the two versions.
For example, the following commands will set the default font to "Sans Serif" and the font size to 9, which has the same appearance across different MATLAB versions:
set(0, 'DefaultUicontrolFontName', 'Sans Serif');
set(0, 'DefaultUicontrolFontSize', 9);
If you are using a version of MATLAB prior to MATLAB 7.3 (R2006b), you may also work around this issue by turning java figures off using the following command. Please note that this workaround will not be valid after MATLAB 7.3 (R2006b) as this feature will not be available:
feature('javafigures',0);