Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Not able to install xkcd fonts

Tags:

r

I was trying the xkcd font as per the instructions given in the vignette: vignette("xkcd-intro")

However get an error on the following step:

> system("cp xkcd.tff -t ~/.fonts")
cp: xkcd.tff: No such file or directory
cp: -t: No such file or directory

What to do??

like image 999
Shambho Avatar asked Mar 19 '23 19:03

Shambho


2 Answers

  1. Are you sure it's not supposed to be xkcd.ttf instead of xkcd.tff?

  2. I'm fairly certain that cp SOURCE OPTION DESTINATION is not a legal use of cp on any Unix system. In fact, since you're copying only one file, you don't even need the -t option. It should probably just be system("cp xkcd.ttf ~/.fonts/").

like image 165
dg99 Avatar answered Apr 19 '23 14:04

dg99


After a lot of trial and error, I was able to get it to work myself. Essentially, you have to copy the downloaded font file to all the folders in font.paths().

On OS X:

for(dirs in font.paths()) {
    file.copy(file.path(dirs,"xkcd.ttf"), "~/Library/Fonts/")
}

And it's working!!

like image 23
Shambho Avatar answered Apr 19 '23 15:04

Shambho