Skip to content

Commit

Permalink
chore: Add {tools} and {utils} to Suggests
Browse files Browse the repository at this point in the history
  • Loading branch information
gadenbuie committed Dec 11, 2024
1 parent 9b522f9 commit ab1816b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ Suggests:
shiny (> 1.8.1),
testthat,
thematic,
tools,
utils,
withr,
yaml
Config/Needs/deploy:
Expand Down
10 changes: 9 additions & 1 deletion R/bs-theme-preset-brand.R
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,10 @@ brand_font_bunny <- function(
style = NULL,
display = NULL
) {
if (!is_installed("utils")) {
abort("The {utils} package is required.")
}

weight <- brand_remap_font_weight(weight) %||% seq(100, 900, 100)

style <- style %||% c("normal", "italic")
Expand Down Expand Up @@ -319,6 +323,10 @@ brand_font_bunny <- function(
}

brand_font_file <- function(family, files, brand_root = getwd()) {
if (!is_installed("tools")) {
abort("The {tools} package is required.")
}

if (!(is.list(files) && length(files) > 0)) {
abort(
c(
Expand All @@ -345,7 +353,7 @@ brand_font_file <- function(family, files, brand_root = getwd()) {
)
}
font_type <- switch(
sub(".+[.]([a-z0-9]+)$", "\\1", tolower(font_path)),
tools::file_ext(tolower(font_path)),
# otc = "collection",
# ttc = "collection",
# eot = "embedded-opentype",
Expand Down

0 comments on commit ab1816b

Please sign in to comment.