Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Load, then use any font on the system
require(extrafont)
require(ggplot2)
font_import(pattern = "GIL", prompt = FALSE) # Import Gill family
loadfonts(device="win") # Load them all
fonts() # See what fonts are available
zp1 <- ggplot(data = iris,
aes(x = Sepal.Length, y = Sepal.Width, label = Species))
zp1 <- zp1 + geom_text(family = "Gill Sans MT")
zp1 <- zp1 + theme(text=element_text(family="Gill Sans Ultra Bold"))
print(zp1)
@jrvianna

This comment has been minimized.

Copy link

jrvianna commented Jun 13, 2016

The ggplots with Gill Sans MT look ok on the screen, but when saving to pdf (on Mac) get "font width unknown for character ..." errors and some symbols such as minus or µ don't appear on the saved pdf. Any way to solve this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.