Not able to install xkcd fonts

前端 未结 3 570
挽巷
挽巷 2021-01-19 11:59

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:



        
相关标签:
3条回答
  • 2021-01-19 12:10

    @dg99 is correct but the issue is that the filename changes in the documentation

    download.file("http://simonsoftware.se/other/xkcd.ttf", dest="xkcd.ttf", mode="wb")
    system("cp xkcd.tff -t ~/.fonts")
    

    Change the second line to: system("cp xkcd.ttf -t ~/.fonts")

    0 讨论(0)
  • 2021-01-19 12:11

    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!!

    0 讨论(0)
  • 2021-01-19 12:20
    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/").

    0 讨论(0)
提交回复
热议问题