Skip to content

Commit

Permalink
Fix bug - unpack fonts into supplied dir
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasp85 committed Jan 17, 2025
1 parent 61f8730 commit 65aab58
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/web_fonts.R
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ get_from_font_squirrel <- function(family, dir = "~/fonts") {
return(invisible(FALSE))
}

new_fonts <- unlist(mapply(utils::unzip, zipfile = download_name))
new_fonts <- unlist(mapply(utils::unzip, zipfile = download_name, MoreArgs = list(exdir = dir)))
is_font <- grepl("\\.(?:ttf|ttc|otf|otc|woff|woff2)$", tolower(new_fonts))
unlink(new_fonts[!is_font])
add_fonts(new_fonts[is_font])
Expand Down

0 comments on commit 65aab58

Please sign in to comment.