fontawesome-free-pack

Crates.iofontawesome-free-pack
lib.rsfontawesome-free-pack
version7.0.1
created_at2025-09-01 12:33:26.574476+00
updated_at2025-09-04 13:18:57.294642+00
descriptionA redistribution of @fortawesome/fontawesome-free npm package's SVG and metadata.
homepage
repositoryhttps://github.com/2bndy5/redist-icons
max_upload_size
id1819547
size2,486,271
Brendan (2bndy5)

documentation

README

fontawesome-free-pack

Crates.io Version MSRV PyPI - Version Min Py

A redistribution of SVG assets and some metadata from the @fortawesome/fontawesome-free npm package.

Optimized SVG data

The SVG data is embedded as strings after it is optimized with SVGO. This package is intended to easily inject SVG data into HTML documents. Thus, we have stripped any width and height fields from the <svg> element, while retaining any viewBox field in the <svg> element.

Usage

All icons are instantiated as constants using the Icon data structure. There is a convenient get_icon() function to fetch an icon using it's slug name.

Note the family of icon is expected to prefix the slug like a relative path: <family>/<slug>

In Python

from fontawesome_free_pack import get_icon, BRANDS_GITHUB

fetched = get_icon("brands/github")
assert fetched is not None
assert BRANDS_GITHUB.svg == fetched.svg

In Rust

use fontawesome_free_pack::{get_icon, BRANDS_GITHUB};

assert_eq!(BRANDS_GITHUB.svg, get_icon("brands/github").unwrap().svg);

Rust Features

This crate has the following features:

  • brands: Includes all icons under the fontawesome brands family.
  • solid: Includes all icons under the fontawesome solid family.
  • regular: Includes all icons under the fontawesome regular family.

All the above features are enabled by default.

The python binding does not support conditionally compiling certain icon families.

Commit count: 18

cargo fmt