Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Awesome Font Name and Family #71

Open
gibran-ali opened this issue Oct 4, 2019 · 3 comments
Open

Awesome Font Name and Family #71

gibran-ali opened this issue Oct 4, 2019 · 3 comments

Comments

@gibran-ali
Copy link

gibran-ali commented Oct 4, 2019

Hi,

Thanks for making this awesome package. I am still a beginner so I may be missing something obvious. On Windows 10, I am unable to create any of the carts that Font Awesome glyphs. I did some digging and in the extrafontsdb/fontmap/fonttable.csv, the font name and font table for the Font Awesome fonts do not match what has been specified in the waffle.R file.

glyph_font = "Font Awesome 5 Free Solid",glyph_font_family = "FontAwesome5Free-Solid"

Are you sure this is correct? In the fonttable.csv, it seems to be flipped. I want to understand if there is something wrong with the way I installed these font.

Thanks.

@StatsRhian
Copy link

Try setting family = "Font Awesome 5 Free Solid" inside geom_pictogram()

@brienna
Copy link

brienna commented Oct 8, 2020

I have the same problem, and I have struggled for weeks on it. I have looked at all Stack Overflow answers, all issues on this, and nothing works. There is something wrong with the package itself. There should not be so many people having this problem with the same font.

Error: Font [Font Awesome 5 Free Solid] not found. Please install it and use extrafont to make it available to R

@rempsyc
Copy link

rempsyc commented Jun 10, 2023

Duplicate of #67, probably.

Here is an actual reprex for posteriority, including the suggested family = "Font Awesome 5 Free Solid" inside geom_pictogram() solution:

library(extrafont)
#> Registering fonts with R
grep("Awesome", fonts(), value = TRUE)
#> [1] "Font Awesome 5 Brands Regular" "Font Awesome 5 Free Solid"

library(ggplot2)
library(waffle)
suppressMessages(library(dplyr))

data.frame(
  parts = factor(rep(month.abb[1:3], 3), levels=month.abb[1:3]),
  vals = c(10, 20, 30, 6, 14, 40, 30, 20, 10),
  col = rep(c("blue", "black", "red"), 3),
  fct = c(rep("Thing 1", 3),
          rep("Thing 2", 3),
          rep("Thing 3", 3))
) -> xdf

xdf %>%
  count(parts, wt = vals) %>%
  ggplot(aes(label = parts, values = n)) +
  geom_pictogram(n_rows = 10, aes(colour = parts), flip = TRUE, make_proportional = TRUE,
                 family = "Font Awesome 5 Free Solid") +
  scale_color_manual(
    name = NULL,
    values = c("#a40000", "#c68958", "#ae6056"),
    labels = c("Fruit", "Sammich", "Pizza")
  ) +
  scale_label_pictogram(
    name = NULL,
    values = c("apple-alt", "bread-slice", "pizza-slice"),
    labels = c("Fruit", "Sammich", "Pizza"))

Created on 2023-06-10 with reprex v2.0.2

Session info
sessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value
#>  version  R version 4.3.0 (2023-04-21 ucrt)
#>  os       Windows 10 x64 (build 19045)
#>  system   x86_64, mingw32
#>  ui       RTerm
#>  language (EN)
#>  collate  English_Canada.utf8
#>  ctype    English_Canada.utf8
#>  tz       America/Toronto
#>  date     2023-06-10
#>  pandoc   3.1.1 @ C:/Program Files/RStudio/resources/app/bin/quarto/bin/tools/ (via rmarkdown)
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  package      * version date (UTC) lib source
#>  cli            3.6.1   2023-03-23 [1] CRAN (R 4.3.0)
#>  colorspace     2.1-0   2023-01-23 [1] CRAN (R 4.3.0)
#>  curl           5.0.0   2023-01-12 [1] CRAN (R 4.3.0)
#>  digest         0.6.31  2022-12-11 [1] CRAN (R 4.3.0)
#>  dplyr        * 1.1.2   2023-04-20 [1] CRAN (R 4.3.0)
#>  DT             0.28    2023-05-18 [1] CRAN (R 4.3.0)
#>  evaluate       0.21    2023-05-05 [1] CRAN (R 4.3.0)
#>  extrafont    * 0.19    2023-01-18 [1] CRAN (R 4.3.0)
#>  extrafontdb    1.0     2012-06-11 [1] CRAN (R 4.3.0)
#>  fansi          1.0.4   2023-01-22 [1] CRAN (R 4.3.0)
#>  farver         2.1.1   2022-07-06 [1] CRAN (R 4.3.0)
#>  fastmap        1.1.1   2023-02-24 [1] CRAN (R 4.3.0)
#>  fs             1.6.2   2023-04-25 [1] CRAN (R 4.3.0)
#>  generics       0.1.3   2022-07-05 [1] CRAN (R 4.3.0)
#>  ggplot2      * 3.4.2   2023-04-03 [1] CRAN (R 4.3.0)
#>  glue           1.6.2   2022-02-24 [1] CRAN (R 4.3.0)
#>  gridExtra      2.3     2017-09-09 [1] CRAN (R 4.3.0)
#>  gtable         0.3.3   2023-03-21 [1] CRAN (R 4.3.0)
#>  highr          0.10    2022-12-22 [1] CRAN (R 4.3.0)
#>  htmltools      0.5.5   2023-03-23 [1] CRAN (R 4.3.0)
#>  htmlwidgets    1.6.2   2023-03-17 [1] CRAN (R 4.3.0)
#>  knitr          1.43    2023-05-25 [1] CRAN (R 4.3.0)
#>  labeling       0.4.2   2020-10-20 [1] CRAN (R 4.3.0)
#>  lifecycle      1.0.3   2022-10-07 [1] CRAN (R 4.3.0)
#>  magrittr       2.0.3   2022-03-30 [1] CRAN (R 4.3.0)
#>  munsell        0.5.0   2018-06-12 [1] CRAN (R 4.3.0)
#>  pillar         1.9.0   2023-03-22 [1] CRAN (R 4.3.0)
#>  pkgconfig      2.0.3   2019-09-22 [1] CRAN (R 4.3.0)
#>  plyr           1.8.8   2022-11-11 [1] CRAN (R 4.3.0)
#>  purrr          1.0.1   2023-01-10 [1] CRAN (R 4.3.0)
#>  R.cache        0.16.0  2022-07-21 [1] CRAN (R 4.3.0)
#>  R.methodsS3    1.8.2   2022-06-13 [1] CRAN (R 4.3.0)
#>  R.oo           1.25.0  2022-06-12 [1] CRAN (R 4.3.0)
#>  R.utils        2.12.2  2022-11-11 [1] CRAN (R 4.3.0)
#>  R6             2.5.1   2021-08-19 [1] CRAN (R 4.3.0)
#>  RColorBrewer   1.1-3   2022-04-03 [1] CRAN (R 4.3.0)
#>  Rcpp           1.0.10  2023-01-22 [1] CRAN (R 4.3.0)
#>  reprex         2.0.2   2022-08-17 [1] CRAN (R 4.3.0)
#>  rlang          1.1.1   2023-04-28 [1] CRAN (R 4.3.0)
#>  rmarkdown      2.22    2023-06-01 [1] CRAN (R 4.3.0)
#>  rstudioapi     0.14    2022-08-22 [1] CRAN (R 4.3.0)
#>  Rttf2pt1       1.3.12  2023-01-22 [1] CRAN (R 4.3.0)
#>  scales         1.2.1   2022-08-20 [1] CRAN (R 4.3.0)
#>  sessioninfo    1.2.2   2021-12-06 [1] CRAN (R 4.3.0)
#>  stringi        1.7.12  2023-01-11 [1] CRAN (R 4.3.0)
#>  stringr        1.5.0   2022-12-02 [1] CRAN (R 4.3.0)
#>  styler         1.9.1   2023-03-04 [1] CRAN (R 4.3.0)
#>  tibble         3.2.1   2023-03-20 [1] CRAN (R 4.3.0)
#>  tidyselect     1.2.0   2022-10-10 [1] CRAN (R 4.3.0)
#>  utf8           1.2.3   2023-01-31 [1] CRAN (R 4.3.0)
#>  vctrs          0.6.2   2023-04-19 [1] CRAN (R 4.3.0)
#>  waffle       * 1.0.1   2023-06-04 [1] Github (hrbrmstr/waffle@3f61463)
#>  withr          2.5.0   2022-03-03 [1] CRAN (R 4.3.0)
#>  xfun           0.39    2023-04-20 [1] CRAN (R 4.3.0)
#>  xml2           1.3.4   2023-04-27 [1] CRAN (R 4.3.0)
#>  yaml           2.3.7   2023-01-23 [1] CRAN (R 4.3.0)
#> 
#>  [1] C:/Users/there/AppData/Local/R/win-library/4.3
#>  [2] C:/Program Files/R/R-4.3.0/library
#> 
#> ──────────────────────────────────────────────────────────────────────────────

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants