wch / extrafont

Tools for using fonts in R graphics
313 stars 49 forks source link

Embedding Cambria font isn't working #30

Open adamliter opened 10 years ago

adamliter commented 10 years ago

I'm running R version 3.0.1 (2013-05-16) on Mac OS X v. 10.8.5, and I'm having trouble embedding the Cambria font in a PDF of a plot created with ggplot2.

I followed all of the instructions for installing extrafont, I created the plot, and then embedded the fonts, using embed_fonts(), which leads to 45 warnings. (The first time it led to 49 warnings, so I assume that the 4 warnings that have disappeared are the warnings that you mentioned might be thrown about missing characters in your instructions.)

The problem seems to be that spaces are not embedding properly, nor are single quotation marks ('). Here is the resulting image:

example

And here are the 45 warnings:

Warning messages:
1: In grid.Call(L_textBounds, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x20
2: In grid.Call(L_textBounds, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x20
3: In grid.Call(L_textBounds, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x20
4: In grid.Call(L_textBounds, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x20
5: In grid.Call(L_textBounds, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x20
6: In grid.Call(L_textBounds, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x27
7: In grid.Call(L_textBounds, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x27
8: In grid.Call(L_textBounds, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x20
9: In grid.Call(L_textBounds, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x20
10: In grid.Call(L_textBounds, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x20
11: In grid.Call(L_textBounds, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x20
12: In grid.Call(L_textBounds, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x20
13: In grid.Call(L_textBounds, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x20
14: In grid.Call(L_textBounds, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x20
15: In grid.Call(L_textBounds, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x20
16: In grid.Call(L_textBounds, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x20
17: In grid.Call(L_textBounds, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x20
18: In grid.Call(L_textBounds, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x20
19: In grid.Call(L_textBounds, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x20
20: In grid.Call(L_textBounds, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x20
21: In grid.Call(L_textBounds, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x27
22: In grid.Call(L_textBounds, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x27
23: In grid.Call(L_textBounds, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x20
24: In grid.Call(L_textBounds, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x20
25: In grid.Call(L_textBounds, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x20
26: In grid.Call(L_textBounds, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x20
27: In grid.Call(L_textBounds, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x20
28: In grid.Call(L_textBounds, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x20
29: In grid.Call(L_textBounds, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x20
30: In grid.Call(L_textBounds, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x20
31: In grid.Call.graphics(L_text, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x20
32: In grid.Call.graphics(L_text, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x20
33: In grid.Call.graphics(L_text, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x20
34: In grid.Call.graphics(L_text, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x20
35: In grid.Call.graphics(L_text, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x20
36: In grid.Call.graphics(L_text, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x27
37: In grid.Call.graphics(L_text, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x27
38: In grid.Call.graphics(L_text, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x20
39: In grid.Call.graphics(L_text, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x20
40: In grid.Call.graphics(L_text, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x20
41: In grid.Call.graphics(L_text, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x20
42: In grid.Call.graphics(L_text, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x20
43: In grid.Call.graphics(L_text, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x20
44: In grid.Call.graphics(L_text, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x20
45: In grid.Call.graphics(L_text, as.graphicsAnnot(x$label),  ... :
  font width unknown for character 0x20
adamliter commented 10 years ago

I should note that these exact same problems also occurred when I tried using Cambria Math instead of Cambria.