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

前端 未结 2 1160
一个人的身影
一个人的身影 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.

    0 讨论(0)
  • 2021-01-01 03:00

    I also encountered this problem for many times, and I have an simple but effective way that never fails me (on Windows, need GSview).

    1) save fig as PDF

    2) save PDF as ps

    3) open ps with GSview, then click "File->PS to EPS", specify a file name and done.

    Hope this helps.

    0 讨论(0)
提交回复
热议问题