Custom font weight in plot
Mostra commenti meno recenti
Since updating from R2021a to R2025a, I can't seem to be able to use the custom font I want to in plots.
Below is a minimal working example, which used to render the correct font, but which now renders Times.
figure;
plot(0:100,[0:100].^2);
set(gca,'FontName','Gill Sans Nova Book');
xlabel('Time (s)');
ylabel('Function, Z (kJ)');
Notes:
- The font name is 'Gill Sans Nova' and that 'Book' is the weight, similarly to Light or Bold
- If I input 'Gill Sans Nova' as fontname, it works and depicts Gill Sans Nova Regular
- I tried setting the FontWeight to 'Book' but that is not a permitted input
- If I copy the plot using print(gcf,'-dmeta') and then copy it in a Word document, the font renders correcly
- I am running Windows 10
- Font is installed as an administrator [edit: I meant Font is installed for all users]
Thanks in advance and best regards,
9 Commenti
What does
listfonts
return ?
Henri
il 29 Apr 2026 alle 14:49
Do you still get "Gill Sans Nova Book" as available font if you type
listfonts(gca)
?
dpb
il 29 Apr 2026 alle 20:21
I'm still betting on not showing as installed for all users... <grin> That would explain Word finding it but not MATLAB. Seems like I recollect having seen before there being differences in searching between graphics and the fontnames list results.
May not turn out that way, but is an easy thing to check firstest...
Henri
il 30 Apr 2026 alle 12:17
"...that confirms they are installed for all users doesn't it?"
I don't think necessarily so, no. Did you follow the steps outlined to confirm? Or just reinstall to be sure?
As noted above, it may turn out that isn't the issue after all, but it should be ruled out definitely as the first step ... it has solved the issue every time I've seen it raised. Again, thre's always a chance of a first time but...
Henri
circa 10 ore fa
If the font appears in "listfonts" and it is installed for all users, I cannot explain why MATLAB doesn't use it.
Maybe TMW can help by remotely logging in to your computer:
Have restarted MATLAB after the reinstall, I presume.
As noted, it's been my experience on forum that reinstalling for all users has solved the problem but that doesn't necessarily mean it will in all cases; this appears to be one--but was still worth trying first.
Just as a flyer, see if
hXL=xlabel('Time (s)','Interpreter','none');
might make any difference...and then what does
hXL.FontName
return?
Risposte (1)
Categorie
Scopri di più su Introduction to Installation and Licensing in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
