Last active
June 27, 2017 13:20
-
-
Save dsparks/10408082 to your computer and use it in GitHub Desktop.
Load, then use any font on the system
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?