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

fontler

v1.6.1

Published

fontler is font subsetter using sfntly

Downloads

30

Readme

Fontler (en / ko)

Summary / 개요

NPM Fontler minimize the volume of TTF font by removing unnecessary glyphs, using Google's sfntly(Apache v2.0). You can programmatically use it./ Fontler는 TTF 글꼴의 필요 없는 글리프를 삭제해서 용량을 최소화 해줍니다. Google의 sfntly(Apache v2.0)를 사용합니다. 프로그램적으로(코드 상에서) 사용할 수 있습니다.

Feature / 기능

  • create lightweight font subset with specified string / 지정한 문자열만 남긴 경량 서브셋 폰트 생성
  • woff, eot format output / woff, eot 파일 포맷으로 출력

Installation / 설치

npm i fontler --save

Change Log / 바뀐 점

  • Callback doesn't pass outputPath any more / outputPath 옵션이 사라짐
  • add x, h, 2 option / x, h, 2 옵션 추가
  • new dependencies : isTTF, ttf2woff2 / 의존성 모듈 추가
  • default output option : eot, woff, woff2(new) / 기본 출력 포맷(woff2 추가)

API

Parameter / 인수

  • inputFile: String, the path and name of original font file / 원본 폰트 경로와 이름
  • outputFile: String, name of output file / 결과 파일 이름
  • subString: String, the string to leave / 남길 문자열
  • option : String, option including the following characters / 다음 문자를 포함한 옵션
    • w : output WOFF format / WOFF 파일 출력
    • 2 : output WOFF2 format / WOFF2 파일 출력
    • e : output EOT format / EOT 파일 출력
    • x : Enable Microtype Express compression for EOT format / EOT를 위한 MTX 압축 옵션
    • h : strip hints / 힌팅 제거
    • usage : "wexh", "hex", "yeah", "woff2", "woff and eot", "hardware"
  • callback : Function pass (error) / 에러 반환하는 콜백

Overloaded! / 과적됐어요!

5 parameter
fontler(inputFile, outputFile, subString, option, callback);

basic use case

4 parameter
fontler(inputFile, outputFile, subString, callback);

create eot, woff, woff2 in default option / 기본 옵션으로 .eot와 .woff 모두 생성

3 parameter
fontler(inputFile, subString, callback);

output file names have the same name but respective extensions / 결과 파일이 원본 파일과 이름이 같지만 다른 확장자를 가짐

Usage / 사용법

   var fontler = require('fontler');
   
   // 5 parameter
   fontler('originalFont.ttf', 'subset',
            '첩첩산 방방곡곡 굽굽이 찾아들어', 'woff,hints',
            function(err) {
            	if(err) console.log(err);
            	else console.log("hooray!");
   });
   
   // 4 parameter
   fontler('originalFont.ttf', 'twoFormatOutput', '첩첩산 방방곡곡 굽굽이 찾아들어',
            function(err) {
            	if(err) console.log(err);
            	else console.log("hooray!");
   });
   
   // 3 parameter
   fontler('originalFont.ttf', '첩첩산 방방곡곡 굽굽이 찾아들어', function(err) {
    	if(err) console.log(err);
    	else console.log("hooray!");
   });

:D

Example Demo Page / 예제 데모 페이지

License / 라이센스

THE BEER-WARE LICENSE (Revision 42)