Question

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.

Was it helpful?

Solution

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';
    }];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top