Metropolitan-Council / councilR

A curated collection of commonly used templates, color palettes, functions, and more!
Other
6 stars 1 forks source link

theme_council() error with fonts #37

Closed velicknd closed 2 years ago

velicknd commented 2 years ago

Kept getting this error Error in check_font_path(regular, "regular"): font file not found for 'regular' type when calling theme_council(). @eroten

library(councilR)
library(sysfonts)
library(showtext)
#> Loading required package: showtextdb
font_add(regular="HelveticaNeueLTStd", "HelveticaNeueLTStd-Lt.otf")
#> Error in check_font_path(regular, "regular"): font file not found for 'regular' type
font_add("HELVETICANEUELTSTD-MDCN_1",
         "HELVETICANEUELTSTD-MDCN_1.otf")
#> Error in check_font_path(regular, "regular"): font file not found for 'regular' type
font_add("Arial Narrow", "ARIALN.ttf")
font_add("Arial Narrow Italic",
         regular = "ARIALN.ttf",
         italic = "ARIALNI.ttf")

plot3 <-
  plot2 +
  councilR::theme_council(use_showtext = T)

Created on 2022-06-15 by the reprex package (v2.0.1)

eroten commented 2 years ago

@svelick, could you give this a try, please?

library(remotes)

remotes::install_github("Metropolitan-Council/councilR@f1f19632596bb0e1f0d431f3c91827e54d2e3a13")
#> Skipping install of 'councilR' from a github remote, the SHA1 (f1f19632) has not changed since last install.
#>   Use `force = TRUE` to force installation

library(councilR)
library(ggplot2)

ggplot(datasets::airquality) + 
  aes(Solar.R, Wind, color = as.factor(Month)) +
  geom_point() +
  theme_council(use_showtext = T)
#> Warning: Removed 7 rows containing missing values (geom_point).

Created on 2022-07-21 by the reprex package (v2.0.1)

velicknd commented 2 years ago

@eroten this worked for me.