tests/testthat/test-system_fonts.R

context("Font listing")

test_that("System fonts can be listed", {
  fonts <- system_fonts()
  expect_is(fonts, 'data.frame')
  expect_gt(nrow(fonts), 0)
  expect_named(
    fonts,
    c(
      "path",
      "index",
      "name",
      "family",
      "style",
      "weight",
      "width",
      "italic",
      "monospace"
    )
  )
})

Try the systemfonts package in your browser

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

systemfonts documentation built on June 8, 2025, 9:41 p.m.