wch / extrafont

Tools for using fonts in R graphics
315 stars 48 forks source link

Error loading fonts with `font_import()` #19

Closed jwhendy closed 11 years ago

jwhendy commented 11 years ago

Hi Winston,

Did things in this order:

install.packages(c("extrafontdb", "extrafont", "Rttf2pt1"))
library(extrafontdb)
library(Rttf2pt2)
library(extrafont)

font_import()

I get the following error:

Importing fonts may take a few minutes,
depending on the number of fonts and the speed of the system.
Continue? [y/n] y
Scanning ttf files in  ...
Extracting .afm files from .ttf files...
Error in data.frame(fontfile = ttfiles, FontName = "", stringsAsFactors = FALSE):
arguments imply differing number of rows: 0, 1

Any suggestions?

wch commented 11 years ago

Hm... what kind of system are you using this on? It may be related to #13, which is fixed in the latest development version.

You can install it with:

library(devtools)
install_github("extrafont", "wch")
wch commented 11 years ago

I just released the new version (0.12) to CRAN, so once it's accepted, you won't need to install from github to make it work (if that was indeed the problem).

jwhendy commented 11 years ago

Hi Winston,

Sorry for the delayed response. This was on Arch Linux 64bit running R 2.15.1. The new version (0.12) let me font_import() successfully, so I'll give it a whirl. Nice package and I'm excited to try this. It seems a bit involved, but still might be an improvement from my previous method:

R -> ggplot -> tikzDevice -> edit .tex file for desired font -> pdfLatex.

Thanks for making this!

P.S. By the way, this is John Henderson from the TCRUG meetups :)