Giter Site home page Giter Site logo

Spaces in filename about extrafont HOT 7 CLOSED

wch avatar wch commented on August 9, 2024
Spaces in filename

from extrafont.

Comments (7)

wch avatar wch commented on August 9, 2024

I think this is due to a bug in the embedFonts function (from grDevices), which is called by embed_fonts:

library(ggplot2)
qplot(1:3, 1:3)
ggsave('foo 2.pdf')

embedFonts('foo 2.pdf')  # Error

But it looks like you can make it work if you put quotes in the filename (this makes the output format auto-detection fail, so you also need to specify the output format).

embedFonts("'foo 2.pdf'", format="pdfwrite")

from extrafont.

wch avatar wch commented on August 9, 2024

Fixed in 3dbbbc7.

from extrafont.

mlt avatar mlt commented on August 9, 2024

Is it time to remove enquoting? It looks like original bug has been fixed. Now I'm getting an error that file with extra single quotes can't be found.

from extrafont.

wch avatar wch commented on August 9, 2024

Hm, this will have to be done with an R version check. Something like this:

if (getRversion() <= numeric_version("2.15.2")) {
  # Add quotes (or perhaps use shQuote)
}

@mlt if I push a branch with this modification, could you test it on your system for me? I don't have the development version of R installed.

from extrafont.

mlt avatar mlt commented on August 9, 2024

I don't have the development version of R installed.

I don't know what was actually going on with my installation as I'm also using stable 2.15.2 (under MS Windows). I suspect it might be related to GS update as I might have used 8.63 and when I moved to 9.05 (and 9.06) it did not like single quotes.

First time I though grDevices package was updated along with other updates I installed. But it looks like it is not the case.

Long story short... perhaps I had another issue that recent version of GS does not like single quotes under MS Windows. With shQuote in your development branch it works.

from extrafont.

wch avatar wch commented on August 9, 2024

I'm going to revert the version check part. I had assumed that you were using the development version of R, since the embedFonts bug was fixed only a week or two ago and you suggested that it was causing new problems.

from extrafont.

mlt avatar mlt commented on August 9, 2024

you suggested that it was causing new problems

I did not. With you version as is, it works.

I do not even have spaces in file names, only underscores. I was just surprised why previous installation suddenly quit working. I though grDevices could be updated independently from the rest. I thought I was using 2.15.2 with newer grDevices. But now I tend to think that single quotes were passed as is to GS and newer version was not happy about it.

from extrafont.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.