title: Installing fonts so that R postscript() device can recognise them
body: <p>Based on the advice in <a href="https://stackoverflow.com/questions/57478128/saving-ggplot-as-eps">this</a> post I am trying to get the serif font (or 'family' of fonts) installed into R so that I can save ggplots as .eps files. Though the suggestion provided worked I would like to try to resolve the issue for future use.</p>
  
  <p>Here's code to generate the issue. </p>
  
  <pre><code>library(bayesplot)
  df &lt;- data.frame(xVar = rnorm(1e4,0,1), yVar = rnorm(1e4,2,1), zVar = rnorm(1e4,4,1))
  t &lt;- bayesplot::mcmc_trace(df) 
  t
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/c83tN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/c83tN.png" alt="enter image description here"></a></p>
  
  <p>Now when I go to save the figure I get this error</p>
  
  <pre><code>ggplot2::ggsave(filename = "tPlot.eps", 
                  plot = t, 
                  device = "eps", 
                  dpi = 1200, 
                  width = 15,
                  height = 10, 
                  units = "cm")
  </code></pre>
  
  <p>Which throws the error</p>
  
  <pre><code>Error in grid.Call(C_stringMetric, as.graphicsAnnot(x$label)) : 
    family 'serif' not included in postscript() device
  </code></pre>
  
  <p>In the previous post the answerer suggested I download the <code>extrafont</code> package. </p>
  
  <p>I ran</p>
  
  <pre><code>View(fonttable())
  </code></pre>
  
  <p>But the serif font did not appear to be installed. </p>
  
  <p>Then I tried</p>
  
  <pre><code>font_addpackage(pkg = "serif")
  </code></pre>
  
  <p>But I got the error</p>
  
  <pre><code>Error in font_addpackage(pkg = "serif") : 
    Unknown font package type: not type1 or ttf.
  </code></pre>
  
  <p>Does anyone know how to install the serif font so R can recognise/use it?</p>