Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"GhostScript was not found" on M1 Big Sur Mac #86

Closed
wrmadsen opened this issue Apr 3, 2021 · 2 comments
Closed

"GhostScript was not found" on M1 Big Sur Mac #86

wrmadsen opened this issue Apr 3, 2021 · 2 comments

Comments

@wrmadsen
Copy link

wrmadsen commented Apr 3, 2021

I just switched to an M1, Big Sur Macbook. I need to embed the fonts of a number of pdfs that include plots from ggplot2.

However, when I run the embed_fonts() function, it returns the following error message: GhostScript was not found

With Homebrew, I've installed Ghostscript. I have also reinstalled extrafont and extrafontdb, restarted RStudio, and then run font_import() and loadfonts() again. None of this solves the error message.

Have you experienced this problem? I wonder if it's because of the change to the M1's Apple Silicon?

I have also switched from using bash to zsh in my terminal. Could that have affected this?

A reprex:

> library(ggplot2)
> library(extrafont)
> (plot <- ggplot(cars, aes(x = speed, y = dist)) +
+     geom_point()
+ )
> ggsave("test_plot.pdf", plot)
Saving 5.19 x 6.87 in image
> embed_fonts(file = "test_plot.pdf", outfile = "test_plot_embedded.pdf")
Error in embedFonts(file = file, format = format, outfile = outfile, options = paste(paste("-I",  : 
  GhostScript was not found
@wrmadsen wrmadsen changed the title "GhostScript was not found" on Big Sur Mac "GhostScript was not found" on M1 Big Sur Mac Apr 3, 2021
@wrmadsen wrmadsen closed this as completed Apr 4, 2021
@wrmadsen
Copy link
Author

wrmadsen commented Apr 4, 2021

Problem arose from installing with homebrew install ghostscript. Though everything seemed fine, that did not work.

It was fixed by installing directly from: https://pages.uoregon.edu/koch/

@stephenpg
Copy link

This also worked for me (the direct download) - and embedFonts didn't need telling where to find the GhostScript afterwards. thanks for highlighting the solution. And thanks William for a v cool package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants