Skip to content

feat: svg_to_pdf() + audit fixes (v0.2.5) - #21

Merged
milkway merged 1 commit into
mainfrom
feat/svg-to-pdf-and-audit-fixes
Jun 29, 2026
Merged

feat: svg_to_pdf() + audit fixes (v0.2.5)#21
milkway merged 1 commit into
mainfrom
feat/svg-to-pdf-and-audit-fixes

Conversation

@milkway

@milkway milkway commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Resumo

Adiciona exportação de cards para PDF vetorial e resolve os itens em aberto da auditoria. R CMD check --as-cran: 0 errors | 0 warnings | 0 notes; 85 testes passando.

Mudanças

  • svg_to_pdf() (novo, #17): PDF vetorial via rsvg::rsvg_pdf(), simétrico a svg_to_png() (sanitiza + embute fontes WOFF2). save_card_for_knitr() aceita format = "pdf"; svg_to_formats() reusa svg_to_pdf() e avisa quando cai no fallback rasterizado via magick.
  • svg_card() (#18): badges dimensionados com value_fontsize em vez de 10 fixo — evita corte/desalinhamento do texto.
  • magick/rsvgSuggests (#19): só usados em raster/PDF (já protegidos por requireNamespace); exemplos afetados foram guardados.
  • is_light_color() (#20): nome de cor inválido agora reporta erro via cli em vez do erro cru de col2rgb().

Testes / docs

  • Novos testes para svg_to_pdf() (header %PDF, tempfile) e para o caminho de nome inválido de is_light_color().
  • DESCRIPTION e NEWS.md bumpados para 0.2.5; man/ regenerado (devtools::document()).

Closes #17 #18 #19 #20

🤖 Generated with Claude Code

Export cards to vector PDF and resolve open audit items.

- svg_to_pdf(): vector PDF via rsvg::rsvg_pdf(), mirroring svg_to_png()
  (sanitizes + embeds WOFF2 fonts). save_card_for_knitr() gains format="pdf";
  svg_to_formats() reuses svg_to_pdf() and warns on the rasterized magick
  fallback. (#17)
- svg_card(): size badges with value_fontsize instead of a hard-coded 10,
  preventing clipped/misaligned badge text. (#18)
- Move magick and rsvg from Imports to Suggests (only needed for raster/PDF,
  already guarded by requireNamespace); guard the affected examples. (#19)
- is_light_color(): report unknown color names via cli instead of a raw
  col2rgb() error. (#20)
- Tests for svg_to_pdf() and the is_light_color() name path; DESCRIPTION/NEWS
  bumped to 0.2.5. R CMD check --as-cran: 0/0/0.

Closes #17 #18 #19 #20

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@milkway
milkway merged commit 34953b7 into main Jun 29, 2026
1 check failed
@milkway
milkway deleted the feat/svg-to-pdf-and-audit-fixes branch June 29, 2026 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adicionar svg_to_pdf() dedicado e suporte a PDF no knitr/save_card_for_knitr

1 participant