Skip to content

Commit

Permalink
Fixing startup font processing
Browse files Browse the repository at this point in the history
  • Loading branch information
sambtalcott committed Feb 23, 2024
1 parent 738c9bf commit fc576b6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ utils::globalVariables(c("vec", "vec.factor", "n", "group.vec", "group.factor",
#' @param libname library name
#' @param pkgname package name
#'
#' @export
.onAttach <- function(libname, pkgname) {
# adapted from hrbrthemes

Expand All @@ -24,7 +23,13 @@ utils::globalVariables(c("vec", "vec.factor", "n", "group.vec", "group.factor",
}

fnt <- extrafont::fonttable()
if (!any(grepl("Segoe", fnt$FamilyName))) {
extrafont::ttf_import(file.path(system.file("fonts", package = "tntpr")))
if (!any(grepl("Halyard Display", fnt$FamilyName))) {
packageStartupMessage("NOTE: The Halyard Display font is the default font for the tntp_style() theme.")
packageStartupMessage(" This font is not currently installed on your system. ")
packageStartupMessage("")
packageStartupMessage(" To install the Halyard Display fonts, follow the directions in the TNTP")
packageStartupMessage(" Visualization Cookbook at the following link:")
packageStartupMessage("")
packageStartupMessage(" https://tntp.github.io/tntpr/articles/visualization-cookbook.html#setting-font-family-and-font-sizes")
} # nocov end
}
Binary file removed inst/fonts/segoe-ui/Segoe_UI.ttf
Binary file not shown.
Binary file removed inst/fonts/segoe-ui/Segoe_UI_Bold.ttf
Binary file not shown.
Binary file removed inst/fonts/segoe-ui/Segoe_UI_Bold_Italic.ttf
Binary file not shown.
Binary file removed inst/fonts/segoe-ui/Segoe_UI_Italic.ttf
Binary file not shown.

0 comments on commit fc576b6

Please sign in to comment.