Decide whether loading the package should turn on showtext #29

Closed
opened 2026-10-15 15:34:05 -04:00 by jared · 0 comments
Owner

.onLoad calls civilytics_load_fonts(), which calls showtext::showtext_auto(). That makes every graphics device draw text through showtext, which assumes 96 dpi. On a device at 300 dpi (ragg, res = 300) text renders at about a third of its requested size. Correct rendering with ragg and systemfonts then becomes opt-out: callers have to run showtext_auto(FALSE). This is what hid the logo layout bugs in #20.

Options:

  1. Stop calling showtext_auto() on load. Attaching the package changes nothing, and civilytics_load_fonts() turns it on when asked.
  2. Keep it, and document the ragg opt-out in the README and the civilytics_load_fonts() help page.
  3. Turn it on only for devices that need it.

Cost to weigh: option 1 changes how existing reports render on non-ragg devices, which is a breaking change for published reports. Needs a decision before anyone writes code, and a NEWS.md entry whichever way it goes.

`.onLoad` calls `civilytics_load_fonts()`, which calls `showtext::showtext_auto()`. That makes every graphics device draw text through showtext, which assumes 96 dpi. On a device at 300 dpi (ragg, `res = 300`) text renders at about a third of its requested size. Correct rendering with ragg and systemfonts then becomes opt-out: callers have to run `showtext_auto(FALSE)`. This is what hid the logo layout bugs in #20. **Options:** 1. Stop calling `showtext_auto()` on load. Attaching the package changes nothing, and `civilytics_load_fonts()` turns it on when asked. 2. Keep it, and document the ragg opt-out in the README and the `civilytics_load_fonts()` help page. 3. Turn it on only for devices that need it. **Cost to weigh:** option 1 changes how existing reports render on non-ragg devices, which is a breaking change for published reports. Needs a decision before anyone writes code, and a `NEWS.md` entry whichever way it goes.
jared added the
ws
theme
type
decision
labels 2026-10-15 15:34:05 -04:00
jared closed this issue 2026-10-15 15:45:49 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Civilytics/civilyticsR#29