Characters are fuzzy. Where do these fonts come from?
10 次查看(过去 30 天)
显示 更早的评论
I ran the script show below on my windows 10 based computer with 3 differenct versions of Matlab (2021b, 2013b, and version 6.1 from 2001).
The top figure in the image shown below is from Matlab 6.1 and is also identical to the figure generated by Matlab R2013b. (I looked quite carefully and I couldn't see any differences). The bottom figure is from Matlab R2021b. Note that the top line uses the default font which is Helvetica followed by 5 other popular fonts (the last two with serifs). The default font size (which is 10) has been used thruout. One fairly objective difference is that Matlab 6 uses less horizontal space for the default font and for the Lucida Fax font, but uses more horizontal space for Verdana and the Times font (when compared to Matlab 2021b). A more important difference is obvious to me immediately. The characters in the top figure are bright, crisp, and pleasing where as the characters in the bottom figure are ... well excuse my language ... shitty. Makes me think I forgot to put my glasses on. I'm I wrong to be worried about essthetics in a computational tool? I can after all read the text in both figures, but good looking figures just make me feel better (whether it's a figure on a computer screen or a person's figure). Where does Matlab get these fonts from? If it's from Windows, shouldn't they look the same in all Matlab versions? If Matlab stores these fonts internally, is there any hack to allow Matlab 2021b to import a font from an older version of Matlab. I would be happy with just two nice looking san serif fonts (one proportionally spaces like Helvetica and one mono spaced such as Lucida Sans Typewriter). By the way, although I used white characters here, the same effect is there when using black characters on a white background. Thanks for any insights you may have. ~Paul
figure('pos',[10 10 995 140],'Menubar','none');
axes('pos',[0 0 1 1],'color','black','xcolor','black','ycolor','black');
t = ['The quick brown fox jumps over the lazy dog. ' ...
'1234567890-=~!@#$%\^&*()+?>< ' ...
'THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG.'];
text(.01,6/7,t,'color','white');
text(.01,5/7,t,'color','white','fontname','Verdana');
text(.01,4/7,t,'color','white','fontname','Segoe UI');
text(.01,3/7,t,'color','white','fontname','Lucida Sans Typewriter');
text(.01,2/7,t,'color','white','fontname','Lucida Fax');
text(.01,1/7,t,'color','white','fontname','Times');
1 个评论
Rik
2022-4-11
I don't have an actual answer for you, but this is one of the reasons why I wrote my text2im function.
回答(1 个)
DGM
2022-4-11
编辑:DGM
2022-4-11
Well, this shows up like extra-fuzzy garbage in the forum editor due to the figure resizing, so I don't know if this demonstrates anything. It looks better when I run it on desktop, but I don't have these fonts, so I'm running it here instead.
At any rate, here's a possible improvement. Try turning off the font smoothing. As far as what I'm seeing from other posts, the font smoothing in various parts of the newer versions (e.g. the editor) is what might be described as "aggressive" or "bad". That's just my second-hand impressions though. It might also depend on the environment.
figure('pos',[10 10 200 140],'Menubar','none');
axes('pos',[0 0 1 1],'color','black','xcolor','black','ycolor','black');
t = ['The quick brown fox'];
text(.01,6/7,t,'color','white');
text(.01,5/7,t,'color','white','fontname','Verdana');
text(.01,4/7,t,'color','white','fontname','Segoe UI');
text(.01,3/7,t,'color','white','fontname','Lucida Sans Typewriter');
text(.01,2/7,t,'color','white','fontname','Lucida Fax');
text(.01,1/7,t,'color','white','fontname','Times');
figure('pos',[10 10 200 140],'Menubar','none');
axes('pos',[0 0 1 1],'color','black','xcolor','black','ycolor','black');
t = ['The quick brown fox'];
text(.01,6/7,t,'color','white');
text(.01,5/7,t,'color','white','fontname','Verdana','fontsmoothing','off');
text(.01,4/7,t,'color','white','fontname','Segoe UI','fontsmoothing','off');
text(.01,3/7,t,'color','white','fontname','Lucida Sans Typewriter','fontsmoothing','off');
text(.01,2/7,t,'color','white','fontname','Lucida Fax','fontsmoothing','off');
text(.01,1/7,t,'color','white','fontname','Times','fontsmoothing','off');
5 个评论
DGM
2022-4-12
FWIW, this is what I get in R2009b
A lot of the graphics stuff has changed since 2014. I haven't seen any clear answers to similar issues before, and I agree that it looks terrible, so maybe contacting support would be worthwhile. You might get an answer, but I don't know if you'll get a solution.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!