All Projects → omacranger → fontawesome-subset

omacranger / fontawesome-subset

Licence: GPL-3.0 license
Creates subsets of FontAwesome fonts for optimized use on the web.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to fontawesome-subset

react-native-fontawesome-pro
Easily use your FontAwesome Pro icons in React-Native
Stars: ✭ 44 (+7.32%)
Mutual labels:  fontawesome, icons, fontawesome-icons, fontawesome5
glyphhanger
Your web font utility belt. It can subset web fonts. It can find unicode-ranges for you automatically. It makes julienne fries.
Stars: ✭ 422 (+929.27%)
Mutual labels:  webfonts, glyphs, subset
beatrix
A tool to chop off useless fonts glyphs and convert TTF/OTF into WOFF & WOFF2
Stars: ✭ 22 (-46.34%)
Mutual labels:  webfonts, glyphs, subset
fa5pro-downloader
A tool that allows you to download Font Awesome 5 Pro for free
Stars: ✭ 34 (-17.07%)
Mutual labels:  fontawesome, fontawesome-icons, fontawesome5
Angular Fontawesome
Official Angular component for Font Awesome 5
Stars: ✭ 1,056 (+2475.61%)
Mutual labels:  fontawesome, icons
Font Awesome Php
A PHP library for Font Awesome 4.7.
Stars: ✭ 47 (+14.63%)
Mutual labels:  fontawesome, icons
Font Awesome Stylus
Stylus port for font-awesome 4.7.0
Stars: ✭ 77 (+87.8%)
Mutual labels:  fontawesome, icons
React Native Fontawesome
React Native Font Awesome Icons
Stars: ✭ 173 (+321.95%)
Mutual labels:  fontawesome, icons
Radialmenu
A highly customizable radial menu that's very easy to setup.
Stars: ✭ 371 (+804.88%)
Mutual labels:  fontawesome, icons
Fontawesome Module
Module to use Font Awesome icons in Nuxt.js
Stars: ✭ 79 (+92.68%)
Mutual labels:  fontawesome, icons
Font Awesome
The iconic SVG, font, and CSS toolkit
Stars: ✭ 66,937 (+163160.98%)
Mutual labels:  fontawesome, icons
Swifticons
🎢Swift Library for Font Icons - ★ this library
Stars: ✭ 747 (+1721.95%)
Mutual labels:  fontawesome, icons
Alfred Font Awesome Workflow
🎩 Font Awesome workflow for Alfred
Stars: ✭ 714 (+1641.46%)
Mutual labels:  fontawesome, icons
Mahapps.metro.iconpacks
Awesome icon packs for WPF and UWP in one library
Stars: ✭ 1,157 (+2721.95%)
Mutual labels:  fontawesome, icons
Iconfontcppheaders
C, C++ headers and C# classes for icon fonts: Font Awesome, Fork Awesome, Material Design, Kenney game icons and Fontaudio
Stars: ✭ 509 (+1141.46%)
Mutual labels:  fontawesome, icons
Yii2 Fontawesome
Asset Bundle for Yii2 with Font Awesome http://fortawesome.github.io/Font-Awesome/
Stars: ✭ 149 (+263.41%)
Mutual labels:  fontawesome, icons
Urbanist
Urbanist is a low-contrast, geometric sans-serif inspired by Modernist design and typography.
Stars: ✭ 374 (+812.2%)
Mutual labels:  webfonts, glyphs
fa-svelte
Font Awesome 5 for svelte.js
Stars: ✭ 72 (+75.61%)
Mutual labels:  fontawesome, fontawesome5
React Icons Kit
React Svg Icons
Stars: ✭ 352 (+758.54%)
Mutual labels:  fontawesome, icons
AwesomeBadge
a view class as Like a badge using fontawesome 5.
Stars: ✭ 17 (-58.54%)
Mutual labels:  fontawesome, fontawesome5

FontAwesome Subset

Love FontAwesome but don't need thousands of icons bundled on every page of the site? Me either. fontawesome-subset is a utility for creating subsets of FontAwesome for optimized use on the web. It works by taking glyph names that you've used (angle-left, caret-up, etc) and creating an optimized font with only the glyphs you need. Yes, SVG icons and fragments are fancier and more feature filled - but if you already have a website built using the webfont - why switch -- right?

Installation

First, install fontawesome-subset:

npm install --save-dev fontawesome-subset 

Second, install the edition of FontAwesome you plan on using. If you're using the Pro version, see below. For the free version, use the following:

npm install --save-dev @fortawesome/fontawesome-free

Usage

Run via your favorite task runner:

// Import fontawesome-subset
import { fontawesomeSubset } from "fontawesome-subset";

// Create or append a task to be ran with your configuration
fontawesomeSubset(['check','square','caret-up'], 'sass/webfonts');

Full Options

fontawesomeSubset(subset, output_dir, options)

  • subset - Array containing list of glyph names (icon names) that you want to limit the subset to. When using FontAwesome Pro (see below) you can supply an object with key->value pairs for different FA styles (solid, regular, light, brands, duotone).
  • output_dir - Directory that you want the webfonts to be generated in. Relative to current NPM process. Ex: sass/webfonts
  • options - Object of options to further customize the tool.
    • package - free or pro . Defaults to free version. See below for Pro instructions.

Using with FontAwesome Pro

FontAwesome (FA) Pro provides numerous additional icons, as well as different font weights (styles) that you can use. Obviously, you'll need to own the 'Pro' version of FA in order to use with this subsetting tool. If you've already purchased a license, follow the installation instructions for getting FontAwesome Pro up and running through NPM.

After installation, you can supply additional information to the subset parameter of fontawesomeSubset to create families for specific font styles. Make sure to include package: 'pro' inside the options parameter to generate from the Pro source instead and enable font creation for different weights / styles.

Example generating separate glyphs for 'regular' and 'solid' styles:

fontawesomeSubset({
    regular: ['check','square','caret-up'],
    solid: ['plus','minus']  
},
'sass/webfonts',
{
    package: 'pro'
});

You can use any of the weights / sets provided by FontAwesome Pro including solid, regular, light, brands, or duotone. You can mix and match and provide as many glyphs as you plan on using to trim it down.

The above example would output a directory with the following structure:

/sass/
    /webfonts/
        fa-regular-400.eot
        fa-regular-400.svg
        fa-regular-400.ttf
        fa-regular-400.woff
        fa-regular-400.woff2
        fa-solid-900.eot
        fa-solid-900.svg
        fa-solid-900.ttf
        fa-solid-900.woff
        fa-solid-900.woff2

It is still up to you to determine which glyphs you need and to pass them to the function to generate the webfonts. I recommend optimizing your CSS files as well to get the most from the tool.

Using with SCSS / SASS

If you already have FA installed on your server in relation to your NPM project, you can point the output_dir to the webfonts directory that you're already loading and the script will overwrite the current fonts with the newly minified / optimized versions. If you plan on getting a bit more granular you can always edit the _icons.scss file provided by the FA team and remove all glyphs that you're not using to save a few more KBs for your end user.

Here's an example of the _icons.scss file on a project I've worked on using a sass map for the glyph name -> variable provided in the _variables.scss file:

$icons: (
        shopping-cart: $fa-var-shopping-cart,
        chevron-right: $fa-var-chevron-right,
        chevron-left: $fa-var-chevron-left,
        chevron-down: $fa-var-chevron-down,
        check-square: $fa-var-check-square,
        square: $fa-var-square,
        caret-up: $fa-var-caret-up,
        plus: $fa-var-plus,
        minus: $fa-var-minus,
        times: $fa-var-times,
        search: $fa-var-search,
        check: $fa-var-check,
);

@each $key, $value in $icons {
    .#{$fa-css-prefix}-#{$key}:before {
        content: fa-content($value);
    }
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].