Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Matlab Plot - Font Zapf Dingbats Will Not Render

I have a Matlab program where I need to include a plane icon (Zapf Dingbats 40) in the plot. Everytime I run it, it falls back to a system font.

Is there anything that I am doing wrong? This is not the exact code, but illustrates the problem:

title(char(40),'fontname','ZapfDingbats','fontsize',50);

The resulting plot always displays ( instead of the Dingbats plane icon .

I verified that the font is installed and I can type with it on Word.

I am using Matlab R2013b on Mac OSX 10.9.1.

EDIT: It prints correctly to a pdf, but does not display correctly.

like image 796
USCFan13 Avatar asked Feb 24 '26 04:02

USCFan13


1 Answers

You may use the 'Wingdings' font for that. The following code

text(0.5, 0.5, char(81), 'fontname', 'Wingdings', 'fontsize',50);

gives

enter image description here

The 'ZapfDingbats' font may not be in the /Library/Font folder (but 'Wingdings' is), even if listfonts tells you that the font is there. Actually, the listfonts function adds some extra fonts to the list of the available fonts, and I don't get the rational of that.

% always add postscipt fonts to the system fonts list.
systemfonts = [fonts;
    {
    'AvantGarde';
    'Bookman';
    'Courier';
    'Helvetica';
    'Helvetica-Narrow';
    'NewCenturySchoolBook';
    'Palatino';
    'Symbol';
    'Times';
    'ZapfChancery';
    'ZapfDingbats';
    }];
like image 162
marsei Avatar answered Feb 27 '26 01:02

marsei



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!