ragg icon indicating copy to clipboard operation
ragg copied to clipboard

Unicode text fails after attaching ragg

Open StefanoMezzini opened this issue 1 year ago • 2 comments

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.

StefanoMezzini avatar Sep 29 '22 23:09 StefanoMezzini

I'm not able to reproduce this issue...

What do you get when you run systemfonts::system_fonts()

thomasp85 avatar Sep 30 '22 07:09 thomasp85

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

StefanoMezzini avatar Sep 30 '22 18:09 StefanoMezzini