fix: bump base font_size to 16pt and drop fig.retina for readable README
R-CMD-check / R CMD check (push) Successful in 3m33s
The old fig.retina=2 at 150 DPI rendered PNGs at 2x resolution that GitHub markdown can't use, making text appear half its intended size. Switching to 96 DPI without retina produces images at their natural display size. Combined with the base font bump (14 → 16pt), titles and labels now render with proper editorial presence.
@@ -13,7 +13,7 @@
|
|||||||
#' automatically via [showtext] when the package is attached. Call
|
#' automatically via [showtext] when the package is attached. Call
|
||||||
#' [civilytics_load_fonts()] to reload them if needed.
|
#' [civilytics_load_fonts()] to reload them if needed.
|
||||||
#'
|
#'
|
||||||
#' @param font_size Numeric. Base font size in points. Default `14`.
|
#' @param font_size Numeric. Base font size in points. Default `16`.
|
||||||
#' @param font_family Character. Font family for body/axis text. Default
|
#' @param font_family Character. Font family for body/axis text. Default
|
||||||
#' `"Inter"` (loaded via showtext).
|
#' `"Inter"` (loaded via showtext).
|
||||||
#' @param title_family Character. Font family for plot titles and strip labels.
|
#' @param title_family Character. Font family for plot titles and strip labels.
|
||||||
@@ -47,14 +47,14 @@
|
|||||||
#'
|
#'
|
||||||
#' | Element | Scale factor | Default size |
|
#' | Element | Scale factor | Default size |
|
||||||
#' |:--------|:-------------|:-------------|
|
#' |:--------|:-------------|:-------------|
|
||||||
#' | Plot title | `rel_large` (1.43x) | ~20 pt |
|
#' | Plot title | `rel_large` (1.43x) | ~23 pt |
|
||||||
#' | Subtitle | 1.0x | 14 pt |
|
#' | Subtitle | 1.0x | 16 pt |
|
||||||
#' | Axis text (tick labels) | `rel_small` (0.86x) | ~12 pt |
|
#' | Axis text (tick labels) | `rel_small` (0.86x) | ~14 pt |
|
||||||
#' | Axis titles | `rel_small` (0.86x) | ~12 pt |
|
#' | Axis titles | `rel_small` (0.86x) | ~14 pt |
|
||||||
#' | Legend text | `rel_small` (0.86x) | ~12 pt |
|
#' | Legend text | `rel_small` (0.86x) | ~14 pt |
|
||||||
#' | Caption | `rel_tiny` (0.79x) | ~11 pt |
|
#' | Caption | `rel_tiny` (0.79x) | ~13 pt |
|
||||||
#' | Legend title | `rel_tiny` (0.79x) | ~11 pt |
|
#' | Legend title | `rel_tiny` (0.79x) | ~13 pt |
|
||||||
#' | Strip text (facets) | `rel_small` (0.86x) | ~12 pt |
|
#' | Strip text (facets) | `rel_small` (0.86x) | ~14 pt |
|
||||||
#'
|
#'
|
||||||
#' To uniformly scale all text, change `font_size`. To adjust only the title
|
#' To uniformly scale all text, change `font_size`. To adjust only the title
|
||||||
#' prominence, change `rel_large`. When using [civilytics_logo()] to add a
|
#' prominence, change `rel_large`. When using [civilytics_logo()] to add a
|
||||||
@@ -90,7 +90,7 @@
|
|||||||
#' theme_civilytics(font_size = 18)
|
#' theme_civilytics(font_size = 18)
|
||||||
#' }
|
#' }
|
||||||
theme_civilytics <- function(
|
theme_civilytics <- function(
|
||||||
font_size = 14,
|
font_size = 16,
|
||||||
font_family = CV_FONT_SANS,
|
font_family = CV_FONT_SANS,
|
||||||
title_family = CV_FONT_DISPLAY,
|
title_family = CV_FONT_DISPLAY,
|
||||||
line_size = 0.5,
|
line_size = 0.5,
|
||||||
@@ -327,7 +327,7 @@ theme_civilytics <- function(
|
|||||||
#' theme_civilytics_dark()
|
#' theme_civilytics_dark()
|
||||||
#' }
|
#' }
|
||||||
theme_civilytics_dark <- function(
|
theme_civilytics_dark <- function(
|
||||||
font_size = 14,
|
font_size = 16,
|
||||||
font_family = CV_FONT_SANS,
|
font_family = CV_FONT_SANS,
|
||||||
title_family = CV_FONT_DISPLAY,
|
title_family = CV_FONT_DISPLAY,
|
||||||
line_size = 0.5,
|
line_size = 0.5,
|
||||||
|
|||||||
@@ -7,8 +7,7 @@ knitr::opts_chunk$set(
|
|||||||
collapse = TRUE,
|
collapse = TRUE,
|
||||||
comment = "#>",
|
comment = "#>",
|
||||||
fig.path = "man/figures/README-",
|
fig.path = "man/figures/README-",
|
||||||
fig.retina = 2,
|
dpi = 96,
|
||||||
dpi = 150,
|
|
||||||
out.width = "100%"
|
out.width = "100%"
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 148 KiB After Width: | Height: | Size: 45 KiB |
|
Before Width: | Height: | Size: 165 KiB After Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 166 KiB After Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 91 KiB After Width: | Height: | Size: 8.0 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 109 KiB After Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 39 KiB |
|
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 41 KiB |
|
Before Width: | Height: | Size: 161 KiB After Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 97 KiB After Width: | Height: | Size: 42 KiB |
@@ -5,7 +5,7 @@
|
|||||||
\title{Civilytics ggplot2 theme}
|
\title{Civilytics ggplot2 theme}
|
||||||
\usage{
|
\usage{
|
||||||
theme_civilytics(
|
theme_civilytics(
|
||||||
font_size = 14,
|
font_size = 16,
|
||||||
font_family = CV_FONT_SANS,
|
font_family = CV_FONT_SANS,
|
||||||
title_family = CV_FONT_DISPLAY,
|
title_family = CV_FONT_DISPLAY,
|
||||||
line_size = 0.5,
|
line_size = 0.5,
|
||||||
@@ -21,7 +21,7 @@ theme_civilytics(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
\arguments{
|
\arguments{
|
||||||
\item{font_size}{Numeric. Base font size in points. Default `14`.}
|
\item{font_size}{Numeric. Base font size in points. Default `16`.}
|
||||||
|
|
||||||
\item{font_family}{Character. Font family for body/axis text. Default
|
\item{font_family}{Character. Font family for body/axis text. Default
|
||||||
`"Inter"` (loaded via showtext).}
|
`"Inter"` (loaded via showtext).}
|
||||||
@@ -86,14 +86,14 @@ At the default `font_size = 14`:
|
|||||||
|
|
||||||
| Element | Scale factor | Default size |
|
| Element | Scale factor | Default size |
|
||||||
|:--------|:-------------|:-------------|
|
|:--------|:-------------|:-------------|
|
||||||
| Plot title | `rel_large` (1.43x) | ~20 pt |
|
| Plot title | `rel_large` (1.43x) | ~23 pt |
|
||||||
| Subtitle | 1.0x | 14 pt |
|
| Subtitle | 1.0x | 16 pt |
|
||||||
| Axis text (tick labels) | `rel_small` (0.86x) | ~12 pt |
|
| Axis text (tick labels) | `rel_small` (0.86x) | ~14 pt |
|
||||||
| Axis titles | `rel_small` (0.86x) | ~12 pt |
|
| Axis titles | `rel_small` (0.86x) | ~14 pt |
|
||||||
| Legend text | `rel_small` (0.86x) | ~12 pt |
|
| Legend text | `rel_small` (0.86x) | ~14 pt |
|
||||||
| Caption | `rel_tiny` (0.79x) | ~11 pt |
|
| Caption | `rel_tiny` (0.79x) | ~13 pt |
|
||||||
| Legend title | `rel_tiny` (0.79x) | ~11 pt |
|
| Legend title | `rel_tiny` (0.79x) | ~13 pt |
|
||||||
| Strip text (facets) | `rel_small` (0.86x) | ~12 pt |
|
| Strip text (facets) | `rel_small` (0.86x) | ~14 pt |
|
||||||
|
|
||||||
To uniformly scale all text, change `font_size`. To adjust only the title
|
To uniformly scale all text, change `font_size`. To adjust only the title
|
||||||
prominence, change `rel_large`. When using [civilytics_logo()] to add a
|
prominence, change `rel_large`. When using [civilytics_logo()] to add a
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
\title{Dark variant of the Civilytics ggplot2 theme}
|
\title{Dark variant of the Civilytics ggplot2 theme}
|
||||||
\usage{
|
\usage{
|
||||||
theme_civilytics_dark(
|
theme_civilytics_dark(
|
||||||
font_size = 14,
|
font_size = 16,
|
||||||
font_family = CV_FONT_SANS,
|
font_family = CV_FONT_SANS,
|
||||||
title_family = CV_FONT_DISPLAY,
|
title_family = CV_FONT_DISPLAY,
|
||||||
line_size = 0.5,
|
line_size = 0.5,
|
||||||
@@ -21,7 +21,7 @@ theme_civilytics_dark(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
\arguments{
|
\arguments{
|
||||||
\item{font_size}{Numeric. Base font size in points. Default `14`.}
|
\item{font_size}{Numeric. Base font size in points. Default `16`.}
|
||||||
|
|
||||||
\item{font_family}{Character. Font family for body/axis text. Default
|
\item{font_family}{Character. Font family for body/axis text. Default
|
||||||
`"Inter"` (loaded via showtext).}
|
`"Inter"` (loaded via showtext).}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ theme_civilytics_slide(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
\arguments{
|
\arguments{
|
||||||
\item{font_size}{Numeric. Base font size in points. Default `14`.}
|
\item{font_size}{Numeric. Base font size in points. Default `16`.}
|
||||||
|
|
||||||
\item{font_family}{Character. Font family for body/axis text. Default
|
\item{font_family}{Character. Font family for body/axis text. Default
|
||||||
`"Inter"` (loaded via showtext).}
|
`"Inter"` (loaded via showtext).}
|
||||||
|
|||||||