-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update embedded svglite to v2.10+ to gain pattern support. #132
Comments
The reason is stability of SVG generation. Updating svglite may require vdffir users to update their snapshots. |
I think write_svg_bleeding_edge <- function(plot, file, title = "") {
svglite::svglite(file)
on.exit(grDevices::dev.off())
# warning: `print_plot()` is not exported by {vdiffr}
vdiffr:::print_plot(plot, title)
}
expect_doppelganger(plot_fn(), writer = write_svg_bleeding_edge) I've experienced pain when developing |
FWIW, if anyone else is encountering this problem (ggdist has the same problem b/c I want to test gradient support with vdiffr), I've been using a modified version of @trevorld's writer to generate SVGs that work across Windows, Linux, and Mac (use of Liberation Sans and Symbola is cribbed from what vdiffr does internally): write_svg_bleeding_edge = function(plot, file, title = "") {
# use Liberation Sans and Symbola to avoid platform-specific font differences
liberation_sans = fontquiver::font_styles("Liberation", "Sans")
symbola = fontquiver::font("Symbola", "Symbols", "Regular")
sysfonts::font_add(
"Liberation Sans",
regular = liberation_sans$Regular$ttf,
bold = liberation_sans$Bold$ttf,
italic = liberation_sans$Italic$ttf,
bolditalic = liberation_sans$`Bold Italic`$ttf,
symbol = symbola$ttf
)
svglite::svglite(file)
showtext::showtext_begin()
on.exit({
showtext::showtext_end()
grDevices::dev.off()
})
print(
plot + ggtitle(title) + theme_test(base_family = "Liberation Sans")
)
} |
This comment was marked as resolved.
This comment was marked as resolved.
In addition to pattern support, it would be nice to have support for other newer graphical features as well (clipping paths, masks, compositing/blending, affine transformations, glyphs and fill/stroke paths). |
The current embedded version of svglite within this package does not appear to be in sync with the latest svglite release.
E.g. Latest svglite (v2.1.1) includes support for pattern and gradient fills (included in v2.1.0).
i.e. vdiffr does not support pattern rendering when comparing images.
Would this just be the case of copying over the latest svglite release?
What is the reason for embedding a local version rather than linking to svglite package?
The text was updated successfully, but these errors were encountered: