ragg
ragg copied to clipboard
Unicode text fails after attaching ragg
Attaching the ragg
package prevents one from using unicode characters in base plot()
and ggplot()
, as any string with unicode will be blank. However, printing a plot (with either plot()
or ggplot()
) before attaching ragg fixes the issue:
library('ragg')
plot(1, xlab = '\U1D53C doesn\'t work')
ggplot2::ggplot() +
ggplot2::geom_point(ggplot2::aes(1, 1)) +
ggplot2::xlab('\U1D53C doesn\'t work')
# restart R (Ctrl + Shift + F10)
plot(1, xlab = '\U1D53C')
library('ragg')
plot(1, xlab = '\U1D53C now works')
ggplot2::ggplot() +
ggplot2::geom_point(ggplot2::aes(1, 1)) +
ggplot2::xlab('\U1D53C now works')
# restart R (Ctrl + Shift + F10)
ggplot2::ggplot() +
ggplot2::geom_point(ggplot2::aes(1, 1)) +
ggplot2::xlab('\U1D53C')
library('ragg')
plot(1, xlab = '\U1D53C now works')
ggplot2::ggplot() +
ggplot2::geom_point(ggplot2::aes(1, 1)) +
ggplot2::xlab('\U1D53C now works')
I am using R
4.2.1, RStudio 2022.07.1+554 "Spotted Wakerobin", and ragg
1.2.3 on Windows 10.
I'm not able to reproduce this issue...
What do you get when you run systemfonts::system_fonts()
Thanks for the quick response! I've attached a csv with the output from systemfonts::system_fonts()
. The issue occurs on both my laptop and my work computer.
fonts.csv