I tried the Preferences/Font which changes other areas, but not the toolbars. My colleague has done it but doesn't remember how.
MATLAB: How to change the font size of the toolbars at the top of the matlab window
font toolbarMATLAB
Related Solutions
Right click on your matlab exe icon(you can also do it on icon on your desktop shortcut if you have ), and go to Properties and then to compatibility tab, and select Disable display scaling on high DPI settings.
Check if this helps to an extent.
-Krishnam
The font picker issue arose because Windows 10 version 1809 added a feature which allows a font to be installed only for a specific user rather than for all users. This caused inconsistency in the Java API, which retrieves the list of all the fonts for a specific user.
There are 3 workarounds for this issue.
Workaround-1: Install the font for all users.
To install the font for all users, right-click the font and select 'Install for all users'.
The font becomes visible for all users in font picker.
Workaround-2: Copy the font to /jre/lib/fonts folder.
To copy the font to the /jre/lib/fonts folder of your system's Java install location, follow these steps:
1. Run this code in MATLAB to determine the /jre/lib/fonts folder location.
fullfile(java.lang.System.getProperty('java.home').toCharArray', 'lib', 'fonts')
2. Manually copy the font file to the /jre/lib/fonts folder.
Alternatively, you can run this command in MATLAB:
copyfile('\path\to\font\file\font.ttf', fullfile(java.lang.System.getProperty('java.home').toCharArray', 'lib', 'fonts')) % Replace 'path\to\font\file\font.ttf' with the location of the font file.
3. Verify that the font was successfully copied by running the following code in MATLAB.
dir(fullfile(java.lang.System.getProperty('java.home').toCharArray', 'lib', 'fonts'))
4. Restart MATLAB. The copied font is now visible in the font picker.
For more information, see https://www.mathworks.com/help/matlab/matlab_env/change-fonts.html and https://docs.oracle.com/javase/8/docs/technotes/guides/intl/font.html#physical.
Workaround-3: Use Settings to set the font
If the above two workarounds are not feasible due to the lack of admin privileges, and the font can only be installed for a specific user, you can set the font using settings.
Run this code in MATLAB to set the font settings:
s = settings;s.matlab.fonts.codefont.Name.PersonalValue = '<Font Name>' % Replace <Font Name> with the name of the font.
The font name is listed in Windows Font Viewer which can be opened by double-clicking the font file or right clicking the font file and selecting 'Preview' option. Alternatively, run this code in MATLAB to determine the font name:
font = java.awt.Font.createFont(java.awt.Font.TRUETYPE_FONT, java.io.File('\path\to\font\file\font.ttf')); % Replace 'path\to\font\file\font.ttf' with the location of the font file.font.getFamily().toCharArray'
For more information about using settings, see https://www.mathworks.com/help/matlab/matlab_external/access-and-modify-settings.html
Best Answer