Error using Arial in .eps figure with extrafont package

前端 未结 3 1676
臣服心动
臣服心动 2021-01-14 07:42

I\'m using ggplot2 in R to generate figures for a publication in which all figures need to be .eps format and all fonts needs to be Arial. I\'ve been following this guide to

3条回答
  •  误落风尘
    2021-01-14 08:16

    For future reference, I also had trouble using extrafont with Arial (but on Windows), and it turned out there were multiple causes.

    The errors I received were: Error in title(...) : metric information not available for this device, In title(...) : font metrics unknown for character 0x4d and font width unknown.

    It turns out that extrafont requires ghostscript, which is not at all clear from these error messages. In fact, I had ghostscript installed, but (at least in my case) it also had to be registered in the Path environment variable, as described here (substitute your version number).

    Even with that in place, it appears that it is not the font names listed in names(postscriptFonts()) and fonttable() that can be used. Arial and Times New Roman (or TimesNewRoman or TimesNewRomanPSMT) don't work for me, instead ArialMT and Times do. I don't know why this is and how one can find a list of names that do work.

提交回复
热议问题