Skip to content

Commit 5c4c161

Browse files
authored
update README and font size guide (#10)
1 parent 1e7c00c commit 5c4c161

File tree

11 files changed

+15
-10
lines changed

11 files changed

+15
-10
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# gridify 0.7.6.9000
22

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

57
# gridify 0.7.6

R/layout_issues.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
#' unit pixels (`px`), whilst the `grid` package, on which `gridify` is built,
7272
#' assumes points (`pt`). As a result, even if you set the font sizes in both
7373
#' `gt` and `gridify` (using `grid::gpar()`) to the same number, they may
74-
#' still appear different. To convert point size to pixel size, multiply the point size by 4/3.
74+
#' still appear different. To convert point size to pixel size, multiply the point size by `96 / 72`.
7575
#'
7676
#' @name layout_issue
7777
NULL

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,10 @@ tab <- gt::gt(head(mtcars, n = 10)) |>
7575
table.width = gt::pct(100),
7676
data_row.padding = gt::px(10),
7777
table_body.hlines.color = "white",
78-
table.font.size = 12
78+
# gt font size is in pixels
79+
# Multiply points by 96/72 to get pixels
80+
table.font.size = 10 * 96 / 72,
81+
table.font.names = "sans"
7982
)
8083

8184
# Use `gridify()` to create a `gridify` object
@@ -84,7 +87,7 @@ gridify_object <- gridify(
8487
# Choose a layout (predefined or custom)
8588
layout = pharma_layout_base(
8689
margin = grid::unit(c(0.5, 0.5, 0.5, 0.5), "inches"),
87-
global_gpar = grid::gpar(fontfamily = "serif", fontsize = 10)
90+
global_gpar = grid::gpar(fontfamily = "sans", fontsize = 10)
8891
)
8992
)
9093
# Print the `gridify` object to see empty cells

man/complex_layout.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/figures/README-example-1.png

35.9 KB
Loading

man/layout_issue.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/pharma_layout.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/pharma_layout_A4.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/pharma_layout_base.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/pharma_layout_letter.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)