Generate SVG Information Cards with Embedded Fonts and Badges
Batch convert multiple SVG cards to PNG
Create a grob for grid/ggplot2
cardargus: Generate SVG Information Cards with Embedded Fonts and Badg...
Check if Chrome/Chromium is available for rendering
Get Chrome cache directory
Compress number to abbreviated format
Create a row of SVG badges with uniform height
Create an SVG Badge
Create logo row for bottom-left corner of card
Create logo row for top-right corner of card
Convert CSS gradient to SVG gradient
Generic logo placeholder SVG
Detect font families used in an SVG
Download a Google Font as WOFF2 to the cache
Embed a font file into an SVG via @font-face
Ensure cardargus fonts are available (WOFF2 cache)
Ensure Chrome is available, downloading if necessary
Ensure output directory exists
Escape XML special characters
Find Chrome executable in a directory
Find Chrome executable path
Check if a font is available for embedding
Get font cache directory
Build a cache filename for a font family
Generate unique ID suffix
Get Chrome for Testing download info
Get platform identifier for Chrome downloads
Get Google Font CSS for embedding in SVG
Get path to a bundled SVG file
Building Icon SVG
Construction Icon SVG
House Icon SVG
Map Pin Icon SVG
Dollar/Money Icon SVG
Display card as PNG in knitr/Quarto document
Display card in knitr/Quarto document (SVG via data URI)
Pre-download fonts for offline use
Check if a color is light
List available bundled SVG files
List registered/cached fonts
Load and process external SVG file for embedding
Parse a numeric width/height from the root <svg ...> tag
Prepare SVG for rasterization (sanitize + embed fonts)
Register cardargus knitr engine
Register a local font file for embedding
Register Google Font (sysfonts)
Sanitize SVG for rasterization engines (librsvg / ImageMagick)
Sanitize SVG metadata for Chrome rendering
Save card and return path for knitr
Save SVG string to file (sanitized + embedded fonts)
Setup showtext for cardargus
Create an Information Card in SVG Format
Convert SVG to multiple formats
Convert SVG to PDF using headless Chrome
Convert SVG to PNG using headless Chrome
Convert SVG to PNG with optional margin and background
Convert SVG to PNG
Get the path to package SVGs directory
Calculate text height using gdtools
Calculate text width using gdtools
Wrap text to fit within a given width
Create a temporary HTML file wrapping an SVG
Write SVG content to a temporary .svg file
Create self-contained SVG information cards with embedded 'Google Fonts', shields-style badges, and custom logos. Cards are fully portable SVG files ideal for dashboards, reports, and web applications. Includes functions to export cards to PNG format and display them in 'R Markdown' and 'Quarto' documents.
Useful links