Is it possible to get around MATLAB's limitation on font embedding in vector format files?

前端 未结 2 1175
一个人的身影
一个人的身影 2021-01-01 02:13

According to the MATLAB manual, when you save a figure using print or by choosing file|save, if you choose the painters renderer and s

2条回答
  •  甜味超标
    2021-01-01 02:47

    If I'm reading that link correctly, not all fonts get substituted. From 'Choosing a Printer Driver':

    The table below lists the fonts supported by the MATLAB PostScript and Ghostscript drivers when generated with the Painters renderer (fully vectorized output). This same set of fonts is supported on both Windows and UNIX:

    AvantGarde
    Helvetica-Narrow
    Times-Roman
    Bookman
    NewCenturySchlbk
    ZapfChancery
    Courier
    Palatino
    ZapfDingbats
    Helvetica
    Symbol
    

    So, if you use one of the above fonts, the output vector-format figure should maintain the correct font. See for example:

    list_fonts = listfonts
    figure('renderer','painters'),
    plot(peaks),
    xlabel('this font is Helvetica','fontname','Helvetica','fontsize',24)
    set(gcf,'paperpositionmode','auto')
    print(gcf,'-depsc2','test1.eps')
    

    Which produces:

    example output

    So, choose one of the fonts from the list above, and the font will be output correctly. Otherwise, change the font in your presentation to match one of the above fonts.

提交回复
热议问题