Fonts that work correctly
조회 수: 26(최근 30일)
I have been playing around, in MATLAB 2012b, with setting the fonts in a Figure. I have done this both under OS X and Windows 7, but am now completely confused. I find that fonts I select either don't display correctly or print correctly or both.
Is there a document somewhere which explains which fonts I can and cannot use in a Figure under both OS X and Windows?
The sorts of questions I need answered are
- If I change the font of an object to FontName X, that font will be correctly displayed in the MATLAB figure window for these fonts.
- If I change the font of an object to FontName X, that font will be correctly printed in a .png file for these fonts.
- If I change the font of an object to FontName X, that font will be correctly printed in a .pdf file for these fonts.
where by 'correctly' I mean, with the right font at the right size and without bits missing.
Malcolm Lidierth 2012년 9월 30일
You might(?) see better cross-platform consistency with one of the Java virtual fonts such as Serif or Sans Serif.
All MATLAB 2D graphics are pixellated.
Jan 2012년 9월 30일
I've tested this under Matlab R2009a and Win7/64. I get equal fond sizes for 12 and 13 point. The problem does not depend on the renderer, but with a higher resolution the fontsizes differ:
print('test', '-dpng', '-r300');
It seems, like the fontsizes are divided by the resolution and rounded to the next integer value. I'm not surprised that pixelated fonts are not available in 12.4 point.
In consequence the problem is the expectation that "print -dpng" exports the fonts as you like it. Exporting to EPS and letting GhistScript render the output to a PNG might be better.
But the problem of the truncated lines for Macs remains: I guess that the font sizes are rounded to the next integer, but the available extent is not.