npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@itsib/icon-font

v0.3.1

Published

CLI utilities for icon-font generation, automation and presentation. Includes preview web server.

Downloads

1,938

Readme

Simple utilities for icon-font generation, automation and presentation. Includes preview web server.

Version Release


Features

  • Formatting of svg icons. The contour will be adjusted to the size of 512px and placed in the center.
  • Optimization. Extra points that do not affect the contour curves will be removed.
  • Configuration support as in package.json, and in a separate file. It can also be transmitted via the command line interface.
  • The input file format is svg.
  • The output file format is TTF, EOT, SVG, WOFF, WOFF2
  • A web server to demonstrate the result. The server will watch the changes in the input files and instantly display the result.

Demo Interface


Usage

Install:

npm install --save-dev @itsib/icon-font

Or global installation:

npm install -g @itsib/icon-font

Show help:

icon-font --help

Run demo server:

icon-font demo --input icons/dir

Generate fonts files:

icon-font generate --input icons/dir --output fonts/dir

Configuration

You need to create an icon-font.json file with json format in the root of your project. Or add field icon-font in package.json file.

{
  "input": "svg-icons",
  "output": "dist/fonts",
  "name": "IconFont",
  "prefix": "icon",
  "types": [ "woff2", "woff", "ttf", "eot"],
  "port": 9000,
  "fontUrl": "./",
  "fontUrlHash": false
}

Options description

Configuration parameters passed through the CLI have a higher priority than the configuration file.

| Option | Type | Required | Description | |:--------------|:--------------------------------:|:--------:|---------------------------------------------------------------------------------------------------------------------------------------------------------------------| | input | string | ✔ | The directory containing the SVG icon files that will be included in the font being created | | output | string | ✔ | The directory where the generated files will be placed, if it does not exist, it will be created. | | name | string | | The name of the new font, by default IconFont | | prefix | string | | Class name prefix. Default icon | | types | string[] | | Output font types, to be generated. Default: [ "woff2", "woff", "ttf", "eot"] | | port | number | | Demo server port. Default 9000 (http://localhost:9000). | | fontUrl | string | | The URL where the font files will be available. Used in the css file @font-fase. Default / | | fontUrlHash | string | false | "random" | | Adds the GET parameter 'hash=${HASH}' at the end of the URL to reset the browser cache. Set to 'random' for random number. Or use yur own value. False is disabled. |

References

  • ots-sanitize - is a program which validates and/or transcodes a font file using the OTS library.. Installation:

    sudo apt install opentype-sanitizer

    Usage:

    ots-sanitize dist/fonts/icon-font.ttf
  • ttfdump - dumps the contents of a TrueType font file in ASCII form. A TrueType font file is consist of various tables. Installation:

    sudo apt install texlive-binaries

    Usage

    ttfdump -t head dist/fonts/icon-font.ttf
    ttfdump -t OS/2 dist/fonts/icon-font.ttf