Skip to content

Should we default to cairo_pdf where available? #310

@grantmcdermott

Description

@grantmcdermott

Inspired by @kjhealy's amusing post here: https://kieranhealy.org/blog/archives/2025/02/06/kerning-and-kerning-in-a-widening-gyre/

Should be easy enough to add some kind of if (capabilities("cairo")) logic to R/setup_device.R and add an appropriate switch argument. C.f.

if (exttype == "jpg") exttype = "jpeg"
switch(exttype,
png = png(filepath, width = filewidth, height = fileheight, units = "in", res = fileres),
jpeg = jpeg(filepath, width = filewidth, height = fileheight, units = "in", res = fileres),
pdf = pdf(filepath, width = filewidth, height = fileheight),
svg = svg(filepath, width = filewidth, height = fileheight),
stop("\nUnsupported file extension. Only '.png', '.jpg', '.pdf', or '.svg' are allowed.\n")
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions