Package 'easeling'

Title: Minimal DrawingML Graphics Device for openxlsx2
Description: A base-R graphics device that writes R plots directly as OOXML DrawingML shapes, for use with openxlsx2::wb_add_drawing(). No dependency on Cairo, FreeType, fontconfig, or xml2.
Authors: Jan Marvin Garbuszus [aut, cre]
Maintainer: Jan Marvin Garbuszus <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2026-07-14 21:39:20 UTC
Source: https://github.com/JanMarvin/easeling

Help Index


Open a DrawingML graphics device for openxlsx2

Description

Draws directly to a standalone DrawingML XML file containing 'xdr:sp' shapes, suitable for 'openxlsx2::wb_add_drawing(xml = file)'. No dependency on Cairo, FreeType, fontconfig, or xml2.

Usage

easel_dev(
  file = tempfile(fileext = ".xml"),
  width = 6,
  height = 6,
  pointsize = 12,
  fontname = "Calibri",
  underline = FALSE,
  strikeout = FALSE
)

Arguments

file

Path to the output XML file. Defaults to a temp file.

width, height

Device size in inches.

pointsize

Default font pointsize.

fontname

Default font typeface (matches ‘openxlsx2::wb_add_font()'’s 'name' argument), e.g. '"Calibri"', '"Arial"'. Used whenever R itself doesn't request a specific family — i.e. whenever a plot's own ‘family'/'fontfamily' is unset or is one of R’s generic aliases ('"sans"', '"serif"', '"mono"', '"symbol"', or '""'). If a plot sets an actual font name (e.g. 'par(family = "Georgia")' or 'theme_minimal(base_family = "Georgia")'), that takes priority over this default.

underline, strikeout

Apply underline/strikeout to all text on this device. Unlike 'fontname', these have no per-call R equivalent (base graphics has no underline/strikeout concept), so they're a device-wide setting.

Value

The output file path, invisibly.

Examples

f <- easel_dev(width = 6, height = 4, fontname = "Georgia")
plot(1:10, (1:10)^2, type = "b")
dev.off()