The small caps generated by Smallcaps Generator do not work for all fonts. For example, the Linux Libertine family (Libertine, Biolinum) have their small caps and Old Style numbers in the Unicode Private Use Area (E000-F8FF), as shown here (last page).
The example plots below use axis labels assembled from the small caps generator, plus the small_caps
and small_nums
string, assembled from the private use area. The first plot uses Times New Roman, which works with the generated small caps but does not have corresponding glyphs in the private use area. The second plot uses Linux Libertine O, which does not have all Unicode characters from the IPA extensions.
library(ggplot2)
x <- 1L:10
y <- 1L:10
df <- data.frame(x,y)
# assemble strings from Libertine's private use area.
small_caps <- "S\UE05D\UE051\UE05C\UE05C C\UE051\UE060\UE063"
small_nums <- "\UE020\UE021\UE022\UE023\UE024\UE025\UE026\UE027\UE028\UE029"
font <- "Times New Roman"
ggplot(df) +
geom_point(aes(x = x, y = y)) +
labs(x = paste("Sᴍᴀʟʟ Cᴀᴘs /", small_caps),
y = paste("Oʟᴅ Sᴛʏʟᴇ", small_nums)) +
theme(text = element_text(family = font)) +
annotate("text", x = 2, y = 9, label = font)
font <- "Linux Libertine O"
ggplot(df) +
geom_point(aes(x = x, y = y)) +
labs(x = paste("Sᴍᴀʟʟ Cᴀᴘs /", small_caps),
y = paste("Oʟᴅ Sᴛʏʟᴇ", small_nums)) +
theme(text = element_text(family = font)) +
annotate("text", x = 2, y = 9, label = font)
Created on 2018-12-08 by the reprex package (v0.2.1)
tolower()
respectivelyexample(tolower)
might help. – Mamba