Skip to content

Commit

Permalink
update to version 0.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
clauswilke committed Dec 10, 2020
1 parent 909ba5f commit 519eea2
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: gridtext
Type: Package
Title: Improved Text Rendering Support for 'Grid' Graphics
Version: 0.1.3
Version: 0.1.4
Authors@R:
person(
given = "Claus O.",
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# gridtext 0.1.4

- Make sure tests don't fail if vdiffr is missing.

# gridtext 0.1.3

- Remove unneeded systemfonts dependency.
Expand Down
4 changes: 1 addition & 3 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
Remove unnecessary dependency on systemfonts, per request by Brian Ripley:

"Version 0.1.2 has added a requirement of package systemfonts. The latter is not easy to install because of its (mis-stated) system requirements. Clearly systemfonts is not needed for all the package users of gridtext as 0.1.1 sufficed, so it should be in Suggests and used conditionally. Please do so ASAP."
Make sure tests don't fail just because vdiffr couldn't be installed, per request by Brian Ripley.

## Test environments
* ubuntu 20.04, devel and release
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test-grid-renderer.R
Original file line number Diff line number Diff line change
Expand Up @@ -77,22 +77,22 @@ test_that("visual tests", {
grid_renderer_text(r, "red bold", 20, 380, gp = gpar(col = "red", fontsize = 12, fontface = "bold"))
grid_renderer_text(r, "roman", 30, 360, gp = gpar(fontsize = 12, fontfamily = "Times"))
g <- grid_renderer_collect_grobs(r)
vdiffr::expect_doppelganger("Text in different stylings", draw_grob(g))
expect_doppelganger("Text in different stylings", draw_grob(g))

grid_renderer_rect(r, 100, 400, 200, 20, gp = gpar(col = "blue"))
grid_renderer_rect(r, 100, 200, 300, 30, gp = gpar(fill = "cornsilk"), r = 8)
grid_renderer_text(r, "text 1, square box blue", 100, 400, gp = gpar(fontsize = 20))
grid_renderer_text(r, "text 2, rounded box filled", 100, 200, gp = gpar(fontsize = 20))
g <- grid_renderer_collect_grobs(r)
vdiffr::expect_doppelganger("Mixing text and boxes", draw_grob(g))
expect_doppelganger("Mixing text and boxes", draw_grob(g))

logo_file <- system.file("extdata", "Rlogo.png", package = "gridtext")
logo <- png::readPNG(logo_file, native = TRUE)
width <- ncol(logo)
height <- nrow(logo)
grid_renderer_raster(r, logo, 10, 10, width, height)
g <- grid_renderer_collect_grobs(r)
vdiffr::expect_doppelganger("Rendering raster data", draw_grob(g))
expect_doppelganger("Rendering raster data", draw_grob(g))
})


Expand Down
8 changes: 4 additions & 4 deletions tests/testthat/test-richtext-grob.R
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ test_that("visual tests", {
}
}

vdiffr::expect_doppelganger("Various text boxes", draw_labels())
expect_doppelganger("Various text boxes", draw_labels())

draw_labels_debug <- function() {
function() {
Expand Down Expand Up @@ -147,7 +147,7 @@ test_that("visual tests", {
}
}

vdiffr::expect_doppelganger("Various text boxes w/ debug", draw_labels_debug())
expect_doppelganger("Various text boxes w/ debug", draw_labels_debug())

draw_aligned_heights <- function() {
function() {
Expand Down Expand Up @@ -179,7 +179,7 @@ test_that("visual tests", {
}
}

vdiffr::expect_doppelganger("Aligned heights", draw_aligned_heights())
expect_doppelganger("Aligned heights", draw_aligned_heights())

draw_aligned_widths <- function() {
function() {
Expand Down Expand Up @@ -211,6 +211,6 @@ test_that("visual tests", {
}
}

vdiffr::expect_doppelganger("Aligned widths", draw_aligned_widths())
expect_doppelganger("Aligned widths", draw_aligned_widths())

})
12 changes: 6 additions & 6 deletions tests/testthat/test-textbox-grob.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ test_that("visual tests", {
}
}

vdiffr::expect_doppelganger("Box spanning entire viewport, with margins", draw_box())
expect_doppelganger("Box spanning entire viewport, with margins", draw_box())

draw_align_upright <- function() {
function() {
Expand Down Expand Up @@ -75,7 +75,7 @@ test_that("visual tests", {
}
}

vdiffr::expect_doppelganger("Multiple boxes, internal alignment", draw_align_upright())
expect_doppelganger("Multiple boxes, internal alignment", draw_align_upright())


draw_align_left_rotated <- function() {
Expand Down Expand Up @@ -124,7 +124,7 @@ test_that("visual tests", {
}
}

vdiffr::expect_doppelganger("Multiple boxes left rotated, internal alignment", draw_align_left_rotated())
expect_doppelganger("Multiple boxes left rotated, internal alignment", draw_align_left_rotated())


draw_align_right_rotated <- function() {
Expand Down Expand Up @@ -173,7 +173,7 @@ test_that("visual tests", {
}
}

vdiffr::expect_doppelganger("Multiple boxes right rotated, internal alignment", draw_align_right_rotated())
expect_doppelganger("Multiple boxes right rotated, internal alignment", draw_align_right_rotated())


draw_align_inverted <- function() {
Expand Down Expand Up @@ -221,7 +221,7 @@ test_that("visual tests", {
invisible()
}
}
vdiffr::expect_doppelganger("Multiple boxes inverted, internal alignment", draw_align_inverted())
expect_doppelganger("Multiple boxes inverted, internal alignment", draw_align_inverted())

draw_rotated_fixedpoint <- function() {
function() {
Expand Down Expand Up @@ -273,6 +273,6 @@ test_that("visual tests", {
invisible()
}
}
vdiffr::expect_doppelganger("Rotation around fixed point", draw_rotated_fixedpoint())
expect_doppelganger("Rotation around fixed point", draw_rotated_fixedpoint())

})

0 comments on commit 519eea2

Please sign in to comment.