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

ldiconfont

v0.2.8

Published

iconfont dedicated for loading.io

Downloads

14

Readme

ldIconFont

ldiconfont preview

Build icon font with SVGs, along with a pixel-perfect line icon set in 24x24 / 16x16 resolution, along with source Ai files and SVG files. Check our Live Demo for ldiconfont in action.

Usage

include ldif.min.css file and specify font url:

<link rel="stylesheet" type="text/css" href="ldif.min.css"/>
<style type="text/css">
  @font-face {
    font-family: 'ldi';
    font-weight: normal;
    font-style: normal;
    src: url('path/to/your/ldif.ttf') format('truetype');
  }
</style>

Then, use icon via classes:

<i class="i-plus"></i>

Tweak

You can make customized builds to tweak icon alignment, but even with the same font sometimes it doesn't align properly with different font size.

You can customize icon vertical position with following CSS:

i.ldif:before
  position: relative
  top: 0

replace ldif with your custom class and tweak top value to match your font.

Custom build

run ./bin/makefont.js to make a custom build. available parameters:

  • map ( -m ) - optional unicode / icon name mapping file. check src/unicode.json for format.
  • units-per-em ( -u ) - glyph size ( default 900 )
  • input ( -i ) - input directory of SVGs. file name of SVG will be its icon name.
  • ascent ( -a ) - ascent for tweaking icon vertical alignment. default 700
  • offset-y ( -y ) - adjust glyph vertical position. negative toward down, positive toward up. default -130
  • dir ( -d ) - output directory. dist if omitted.

Additionally, you can add a config.json under your input directory, makefont will parse and use it to config build automatically. Check src/vector-files/line/svg/config.json as an example.

You can also use ldiconfont to build your own iconfont by installing ldiconfont then run:

npm install --save ldiconfont
npx ldif  ... ( parameters ) ...

sample command for 800 x 800 SVGs:

npx ldif -u 800 -i ~/path/to/svg -a 700.5 -y -90.5 -d out

We suggest using units-per-em greater than 800 to prevent precision loss when converting to ttf.

Verify Your Build

use npx ldif-server -d <your-font-dist-folder> to start up a test server for viewing the result of your customized build.

Challenges

  • Correctly align vertically - https://christopheraue.net/design/vertical-align

SVG Font

Basic construct of SVG Font:

svg: defs: font
  font-face
  glyph
  ...
  missing-glyph

Structure

ldiconfont provides different variants and favors. You can find all of them in dist/<favor>, with source counterparts under src/vector-files/<favor>, including source illustrator file ( raw paths and merged composite shape ) and generated SVG files.

Currently we only provide 3 favors:

  • Line 24 x 24 bold ( default font after 0.1.0 )
  • Line 16 x 16 light
  • Legacy ( icons used in 0.0.1 )

TODO

  • refine the list of icon that we should make including following scenario:
    • Generic Set
    • Text Editor
    • Source Control
    • Media Player
  • refine icons to make them more consistent and pixel-perfect, in 12px ~ 18px.
  • support (light, regular, bold) x (solid, line) = 6 different styles.
  • support SVG fragment and SVG embed with proper document and even API.
  • refine icon development process
  • add additional preview scenario such as a sample view when using in GitHub.

Reference

License

MIT