Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# gridify 0.7.6.9000

* Updated `README.md` file.
* Updated description how to convert points to pixels, example in `README.md` file.
* Removed `rtables` examples as installation of `rtables.officer` requires R >= 4.4.0.

# gridify 0.7.6
Expand Down
2 changes: 1 addition & 1 deletion R/layout_issues.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
#' unit pixels (`px`), whilst the `grid` package, on which `gridify` is built,
#' assumes points (`pt`). As a result, even if you set the font sizes in both
#' `gt` and `gridify` (using `grid::gpar()`) to the same number, they may
#' still appear different. To convert point size to pixel size, multiply the point size by 4/3.
#' still appear different. To convert point size to pixel size, multiply the point size by `96 / 72`.
#'
#' @name layout_issue
NULL
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ tab <- gt::gt(head(mtcars, n = 10)) |>
table.width = gt::pct(100),
data_row.padding = gt::px(10),
table_body.hlines.color = "white",
table.font.size = 12
# gt font size is in pixels
# Multiply points by 96/72 to get pixels
table.font.size = 10 * 96 / 72,
table.font.names = "sans"
)

# Use `gridify()` to create a `gridify` object
Expand All @@ -84,7 +87,7 @@ gridify_object <- gridify(
# Choose a layout (predefined or custom)
layout = pharma_layout_base(
margin = grid::unit(c(0.5, 0.5, 0.5, 0.5), "inches"),
global_gpar = grid::gpar(fontfamily = "serif", fontsize = 10)
global_gpar = grid::gpar(fontfamily = "sans", fontsize = 10)
)
)
# Print the `gridify` object to see empty cells
Expand Down
2 changes: 1 addition & 1 deletion man/complex_layout.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified man/figures/README-example-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion man/layout_issue.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/pharma_layout.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/pharma_layout_A4.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/pharma_layout_base.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/pharma_layout_letter.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/simple_layout.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.