fontawesome/ 0000755 0001762 0000144 00000000000 14470045230 012600 5 ustar ligges users fontawesome/NAMESPACE 0000644 0001762 0000144 00000000262 14467775557 014053 0 ustar ligges users # Generated by roxygen2: do not edit by hand
S3method(print,fontawesome)
export(fa)
export(fa_html_dependency)
export(fa_i)
export(fa_metadata)
export(fa_png)
import(htmltools)
fontawesome/LICENSE 0000644 0001762 0000144 00000000066 14467775557 013643 0 ustar ligges users YEAR: 2018-2023
COPYRIGHT HOLDER: fontawesome authors
fontawesome/README.md 0000644 0001762 0000144 00000015727 14467775557 014127 0 ustar ligges users
The **fontawesome** R package makes it very easy to insert **Font Awesome** icons into **R Markdown** documents and **Shiny** apps (or, anywhere else you need to put them).
## Examples
The `fa()` function can be used to insert an FA icon. For example, we
can get the *r-project* icon in `steelblue`:
``` r
fa(name = "r-project", fill = "steelblue")
#>
```
As can be seen, what we really get from the function is an SVG object that represents the icon. This can be directly used within **R Markdown** with:
``` r
{text} `r fa(...)` {text}
```
Font Awesome SVG icons are great to use instead of `` tags + font files for a few reasons:
- There is less overhead in a **Shiny** app or **R Markdown** document since an `` tag requires computation to obtain the icon (`` tags represent the actual icon)
- Using `` tags has a 'being online' requirement since network activity is necessary for resolving these tags (SVGs in **fontawesome** are stored in the package, so, no Internet connectivity is necessary for that)
- There are styling options available for SVG that aren't there for icon fonts
### R Markdown
Here is an example **R Markdown** document that includes Font Awesome icons:
---
title: "Font Awesome in R Markdown"
output: html_document
---
```{r load_packages, message=FALSE, warning=FALSE, include=FALSE}
library(fontawesome)
```
# Just a few tests with `r fa("font-awesome-logo-full", fill = "forestgreen")`
It works well in headings...
# `r fa("r-project", fill = "steelblue")` H1 Heading
## `r fa("r-project", fill = "steelblue")` H2 Heading
### `r fa("r-project", fill = "steelblue")` H3 Heading
#### `r fa("r-project", fill = "steelblue")` H4 Heading
##### `r fa("r-project", fill = "steelblue")` H5 Heading
...and works equally well within inline text: `r fa("r-project", fill = "steelblue")`.
This will appear, when knit, as:
### Shiny
Here’s a **Shiny** app (from the [Shiny Gallery](https://shiny.rstudio.com/gallery/basic-datatable.html)) that’s been slightly modified to incorporate Font Awesome icons in the text above the three search fields:
``` r
library(shiny)
library(DT)
library(ggplot2)
library(fontawesome)
ui <- fluidPage(
titlePanel("Basic DataTable"),
# Create a new Row in the UI for selectInputs
fluidRow(
column(
width = 4,
selectInput(
inputId = "man",
label = tags$p(fa("car", fill = "purple"), "Manufacturer:"),
choices = c(
"All",
unique(as.character(mpg$manufacturer))))
),
column(
width = 4,
selectInput(
inputId = "trans",
label = tags$p(fa("car", fill = "forestgreen"), "Transmission:"),
choices = c(
"All",
unique(as.character(mpg$trans))))
),
column(
width = 4,
selectInput(
inputId = "cyl",
label = tags$p(fa("car", fill = "steelblue"), "Cylinders:"),
choices = c(
"All",
unique(as.character(mpg$cyl))))
)
),
# Create a new row for the table.
fluidRow(
dataTableOutput("table")
)
)
server <- function(input, output) {
# Filter data based on selections
output$table <- renderDataTable({
data <- mpg
if (input$man != "All") {
data <- data[data$manufacturer == input$man,]
}
if (input$cyl != "All") {
data <- data[data$cyl == input$cyl,]
}
if (input$trans != "All") {
data <- data[data$trans == input$trans,]
}
data
})
}
shinyApp(ui = ui, server = server)
```
The **Shiny** app will look something like this:
Please note that using `shiny::icon()` in place of `fontawesome::fa()` will still work. Internally, the `icon()` function will call `fontawesome`'s `fa_i()` function, which generates an old-school `` tag for the icon.
### Installation
Want to try this out? The **fontawesome** package can be installed from CRAN:
``` r
install.packages("fontawesome")
```
Also, you can install the development version of **fontawesome** from **GitHub**:
``` r
devtools::install_github("rstudio/fontawesome")
```
If you encounter a bug, have usage questions, or want to share ideas to make this package better, feel free to file an [issue](https://github.com/rstudio/fontawesome/issues).
##### Code of Conduct
Please note that the `rstudio/fontawesome` project is released with a [contributor code of conduct](https://www.contributor-covenant.org/version/2/1/code_of_conduct.html). By participating in this project you agree to abide by its terms.
##### 🏛️ Governance
This project is primarily maintained by [Rich Iannone](https://github.com/rich-iannone). Other authors may occasionally assist with some of these duties.
fontawesome/man/ 0000755 0001762 0000144 00000000000 14467775557 013407 5 ustar ligges users fontawesome/man/fa_metadata.Rd 0000644 0001762 0000144 00000002434 14467775557 016127 0 ustar ligges users % Generated by roxygen2: do not edit by hand
% Please edit documentation in R/fa_metadata.R
\name{fa_metadata}
\alias{fa_metadata}
\title{Get metadata on the included Font Awesome assets}
\usage{
fa_metadata()
}
\value{
A list with metadata for the included Font Awesome assets.
}
\description{
This function provide some metadata about the included Font Awesome assets
in the \strong{fontawesome} package. The list that is returned has the following
components:
\itemize{
\item \code{version}: The released version number for the Font Awesome icons
\item \code{icon_count}: The total count of unique Font Awesome icons
\item \code{icon_names}: A vector of short names (e.g., \code{"npm"}, \code{"drum"}, etc.) for
all included icons
\item \code{icon_names_full}: A vector containing the full names (e.g., \code{"fab fa-npm"}, \code{"fas fa-drum"}, etc.) for all included icons
\item \code{icon_names_fa(r|s|b)}: Vectors of short names within the regular (\code{"r"}),
solid (\code{"s"}), and brand (\code{"b"}) groups
\item \code{icon_names_full_fa(r|s|b)}: Vectors with the full names of icons within
the regular (\code{"r"}), solid (\code{"s"}), and brand (\code{"b"}) groups
}
}
\examples{
if (interactive()) {
# Get information on the Font Awesome
# assets included in this package
fa_metadata()
}
}
fontawesome/man/figures/ 0000755 0001762 0000144 00000000000 14467775557 015053 5 ustar ligges users fontawesome/man/figures/fontawesome_rmd.png 0000644 0001762 0000144 00000103633 14467775557 020760 0 ustar ligges users PNG
IHDR T G# PLTE 333 +ꛛfff]\]H&XFFF```cVVV999Ա`$@@@v/1yyyۢ454VQRRccc31c765MMMɌ9ÓIII33Butu===Ԅ(N$ <_ݱ??MG23B돏J ḱ124ե@33fa01(nooYh鮭ݚjjj31Ucx0>Lڮ̘ǎϘTC2v33pu~}|XM@/Io/k3V T41H-bP^fc\=KTBQ>e]T=a4GܹH1.?}-GW_UJ{>.V)é`i.<۵֕K2kqă{T
ű̋VM{iǵԬ.0Y+Oퟶacvf8V~/SyjF0wkJZDT]|WDR^gv]TGjhZih{kF=3|xĀweabrAe5x+
tRNS P$r
@IDATx=N1Q݄e" :RуDC9'
ixLᴳ2N6 MκUTGm 6f-
[HQ Pk֣앥 UkQlc 6ppjj~ڗp}
Wꨄ llvW+m~l} NE ?GIQuJO_jjJ8 @utQ| @nDjiQļ @iv1 6+! l4jڈ* * * * * * * * 1 1R݊3
1"U * H
-R @T@ "U * H
-R @T@p3sٹƁ8?L1c1