render_text <- function() {
  dev <- agg_capture()
  grid::grid.text(label = 'this is a test')
  out <- dev()

# We cannot test exact across systems because fonts may differ. We simply test
# if something is drawn
test_that("text works", {
  skip_on_cran() # Solaris don't have any text support on CRAN
  text <- table(render_text())
  expect_gt(length(text), 1) # Not only white

Try the ragg package in your browser

Any scripts or data that you put into this service are public.

ragg documentation built on Jan. 12, 2023, 5:11 p.m.