rsvg/ 0000755 0001762 0000144 00000000000 14510577212 011237 5 ustar ligges users rsvg/NAMESPACE 0000644 0001762 0000144 00000000435 14226314110 012446 0 ustar ligges users # Generated by roxygen2: do not edit by hand
export(librsvg_version)
export(rsvg)
export(rsvg_eps)
export(rsvg_nativeraster)
export(rsvg_pdf)
export(rsvg_png)
export(rsvg_ps)
export(rsvg_raw)
export(rsvg_svg)
export(rsvg_webp)
useDynLib(rsvg,R_librsvg_version)
useDynLib(rsvg,R_rsvg)
rsvg/LICENSE 0000644 0001762 0000144 00000000051 14226314110 012226 0 ustar ligges users YEAR: 2016
COPYRIGHT HOLDER: Jeroen Ooms
rsvg/tools/ 0000755 0001762 0000144 00000000000 14507603417 012402 5 ustar ligges users rsvg/tools/winlibs.R 0000644 0001762 0000144 00000001631 14507603417 014175 0 ustar ligges users
if(!file.exists("../windows/librsvg/include/librsvg-2.0/librsvg/rsvg.h")){
unlink("../windows", recursive = TRUE)
url <- if(grepl("aarch", R.version$platform)){
"https://github.com/r-windows/bundles/releases/download/librsvg-2.57.0/librsvg-2.57.0-clang-aarch64.tar.xz"
} else if(grepl("clang", Sys.getenv('R_COMPILED_BY'))){
"https://github.com/r-windows/bundles/releases/download/librsvg-2.57.0/librsvg-2.57.0-clang-x86_64.tar.xz"
} else if(getRversion() >= "4.2") {
"https://github.com/r-windows/bundles/releases/download/librsvg-2.57.0/librsvg-2.57.0-ucrt-x86_64.tar.xz"
} else {
"https://github.com/rwinlib/rsvg/archive/v2.50.5.tar.gz"
}
download.file(url, basename(url), quiet = TRUE)
dir.create("../windows", showWarnings = FALSE)
untar(basename(url), exdir = "../windows", tar = 'internal')
unlink(basename(url))
setwd("../windows")
file.rename(list.files(), 'librsvg')
}
rsvg/man/ 0000755 0001762 0000144 00000000000 14226314110 012000 5 ustar ligges users rsvg/man/librsvg_version.Rd 0000644 0001762 0000144 00000000364 14226314110 015507 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/version.R
\name{librsvg_version}
\alias{librsvg_version}
\title{librsvg version}
\usage{
librsvg_version()
}
\description{
Print the version of the librsvg library
}
rsvg/man/figures/ 0000755 0001762 0000144 00000000000 14226314110 013444 5 ustar ligges users rsvg/man/figures/logo.svg 0000644 0001762 0000144 00000206026 14226314110 015133 0 ustar ligges users
rsvg/man/rsvg.Rd 0000644 0001762 0000144 00000004607 14226314110 013257 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/rsvg.R
\name{rsvg}
\alias{rsvg}
\alias{rsvg_raw}
\alias{rsvg_nativeraster}
\alias{rsvg_webp}
\alias{rsvg_png}
\alias{rsvg_pdf}
\alias{rsvg_svg}
\alias{rsvg_ps}
\alias{rsvg_eps}
\title{Render SVG into Bitmap}
\usage{
rsvg(svg, width = NULL, height = NULL, css = NULL)
rsvg_raw(svg, width = NULL, height = NULL, css = NULL)
rsvg_nativeraster(svg, width = NULL, height = NULL, css = NULL)
rsvg_webp(svg, file = NULL, width = NULL, height = NULL, css = NULL)
rsvg_png(svg, file = NULL, width = NULL, height = NULL, css = NULL)
rsvg_pdf(svg, file = NULL, width = NULL, height = NULL, css = NULL)
rsvg_svg(svg, file = NULL, width = NULL, height = NULL, css = NULL)
rsvg_ps(svg, file = NULL, width = NULL, height = NULL, css = NULL)
rsvg_eps(svg, file = NULL, width = NULL, height = NULL, css = NULL)
}
\arguments{
\item{svg}{path/url to svg file or raw vector with svg data. Use \link{charToRaw} to convert
an SVG string into raw data.}
\item{width}{output width in pixels or \code{NULL} for default.}
\item{height}{output height in pixels or \code{NULL} for default}
\item{css}{path/url to external css file or raw vector with css data. This
requires your system has a recent version of librsvg.}
\item{file}{path to output file or \code{NULL} to return content as raw vector}
}
\description{
Render svg image into a high quality bitmap. When both \code{width} and \code{height}
are \code{NULL}, the output resolution matches that of the input. When either \code{width}
or \code{height} is specified, the image is scaled proportionally. When both \code{width}
and \code{height} are specified, the image is stretched into the requested size.
}
\examples{
# create some svg
options(example.ask=FALSE)
tmp <- tempfile()
svglite::svglite(tmp, width = 10, height = 7)
ggplot2::qplot(mpg, wt, data = mtcars, colour = factor(cyl))
dev.off()
# convert directly into a vector or bitmap graphics format
rsvg_pdf(tmp, "out.pdf")
rsvg_png(tmp, "out.png")
rsvg_svg(tmp, "out.svg")
rsvg_ps(tmp, "out.ps")
rsvg_eps(tmp, "out.eps")
# render into raw bitmap array
bitmap <- rsvg(tmp, height = 1440)
dim(bitmap) # h*w*c
# render to native raster object
nr <- rsvg_nativeraster(tmp)
# grid::grid.raster(nr)
# read in your package of choice
magick::image_read(bitmap)
webp::write_webp(bitmap, "bitmap.webp", quality = 100)
# cleanup
unlink(c("out.*", "bitmap.webp"))
}
rsvg/DESCRIPTION 0000644 0001762 0000144 00000002561 14510577212 012751 0 ustar ligges users Type: Package
Package: rsvg
Title: Render SVG Images into PDF, PNG, (Encapsulated) PostScript, or
Bitmap Arrays
Version: 2.6.0
Authors@R: c(
person("Jeroen", "Ooms", , "jeroen@berkeley.edu", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-4035-0289")),
person("Salim", "Brüggemann", , "salim-b@pm.me", role = c("ctb"),
comment = c(ORCID = "0000-0002-5329-5987")))
Description: Renders vector-based svg images into high-quality custom-size
bitmap arrays using 'librsvg2'. The resulting bitmap can be written to
e.g. png, jpeg or webp format. In addition, the package can convert
images directly to various formats such as pdf or postscript.
License: MIT + file LICENSE
URL: https://docs.ropensci.org/rsvg/, https://github.com/ropensci/rsvg
BugReports: https://github.com/ropensci/rsvg/issues
Suggests: ggplot2, knitr, magick, rmarkdown, spelling, svglite,
testthat (>= 3.0.0), webp, png
VignetteBuilder: knitr
Encoding: UTF-8
Language: en-US
RoxygenNote: 7.1.2
SystemRequirements: librsvg2
Config/testthat/edition: 3
NeedsCompilation: yes
Packaged: 2023-10-05 21:50:38 UTC; jeroen
Author: Jeroen Ooms [aut, cre] (),
Salim Brüggemann [ctb] ()
Maintainer: Jeroen Ooms
Repository: CRAN
Date/Publication: 2023-10-08 19:10:02 UTC
rsvg/build/ 0000755 0001762 0000144 00000000000 14507627656 012354 5 ustar ligges users rsvg/build/vignette.rds 0000644 0001762 0000144 00000000334 14507627656 014713 0 ustar ligges users ‹ ‹àb```b`afd`b2™… 1#'æ..K×M..ÖÊMA“’JÍKI-ÊÌKWsW(Ï,ÉPpVÈÌSBSÊ3%£$7MŽnÐ5Â` ˆ `aBRÈš—˜›ZŒ¦›Ý%µ èð?ìúÿ£iáðN,Ï/‚éAQÃUÃâ–™“
³7$³Îapqƒ2ƒÐÝ€a>Šû9‹òËõ`~à…}øèMÎI,F÷(WJbI¢^ZP?ÈÝ ÞS×o½ rsvg/tests/ 0000755 0001762 0000144 00000000000 14507603735 012407 5 ustar ligges users rsvg/tests/spelling.R 0000644 0001762 0000144 00000000074 14226314110 014330 0 ustar ligges users spelling::spell_check_test(vignettes = TRUE, error = FALSE)
rsvg/tests/engine.R 0000644 0001762 0000144 00000000016 14227506743 013774 0 ustar ligges users library(rsvg)
rsvg/tests/testthat/ 0000755 0001762 0000144 00000000000 14510577212 014241 5 ustar ligges users rsvg/tests/testthat/au.svg 0000644 0001762 0000144 00000001542 14507603551 015373 0 ustar ligges users