Skip to contents

Card Creation

Main functions for creating SVG cards

svg_card()
Create an Information Card in SVG Format

Badges

Functions for creating shields.io-style badges

create_badge()
Create an SVG Badge
create_badge_row()
Create a row of SVG badges with uniform height

Icons

SVG icons for use in cards (or use your own SVG file paths)

icon_house()
House Icon SVG
icon_building()
Building Icon SVG
icon_construction()
Construction Icon SVG
icon_map_pin()
Map Pin Icon SVG
icon_money()
Dollar/Money Icon SVG

Logos

Logo and SVG management

load_svg_for_embed()
Load and process external SVG file for embedding
create_logo_row()
Create logo row for top-right corner of card
create_bottom_logo_row()
Create logo row for bottom-left corner of card
get_svg_path()
Get path to a bundled SVG file
list_bundled_svgs()
List available bundled SVG files
svgs_dir()
Get the path to package SVGs directory

Fonts

Google Fonts management

setup_fonts()
Setup showtext for cardargus
install_fonts()
Pre-download fonts for offline use
register_google_font()
Register Google Font (sysfonts)
register_font()
Register a local font file for embedding
font_available()
Check if a font is available for embedding
list_fonts()
List registered/cached fonts
font_cache_dir()
Get font cache directory
get_font_css()
Get Google Font CSS for embedding in SVG

Export

Functions for saving and converting cards

save_svg()
Save SVG string to file (sanitized + embedded fonts)
svg_to_png()
Convert SVG to PNG
svg_to_png_with_margin()
Convert SVG to PNG with optional margin and background
svg_to_formats()
Convert SVG to multiple formats
batch_svg_to_png()
Batch convert multiple SVG cards to PNG

Chrome Rendering

High-fidelity conversion using headless Chrome

svg_to_png_chrome()
Convert SVG to PNG using headless Chrome
svg_to_pdf_chrome()
Convert SVG to PDF using headless Chrome
chrome_available()
Check if Chrome/Chromium is available for rendering
ensure_chrome()
Ensure Chrome is available, downloading if necessary
find_chrome_path()
Find Chrome executable path

R Markdown / Quarto

Functions for displaying cards in documents

include_card()
Display card in knitr/Quarto document (SVG via data URI)
include_card_png()
Display card as PNG in knitr/Quarto document
save_card_for_knitr()
Save card and return path for knitr
register_cardargus_knitr()
Register cardargus knitr engine
card_to_grob()
Create a grob for grid/ggplot2

Utilities

Helper functions

is_light_color()
Check if a color is light
compress_number()
Compress number to abbreviated format