0.3.7 • Published 8 years ago

font-fit v0.3.7

Weekly downloads
125
License
-
Repository
github
Last release
8 years ago

font-fit npm.io

A fast, lightweight library for sizing text-content to fit.

Demo

Installation

$ npm install font-fit

Usage

var result = fontFit({
  text: 'hello world',
  font: 'italic 24px arial',
  space: myElement.clientWidth, // space for text,
  min: 16, // min font-size (optional)
  max: 24 // max font-size (optional)
});

myElement.style.fontSize = result.fontSize + 'px';

Tests

  1. Ensure Firefox Nightly is installed on your machine.
  2. $ npm install
  3. $ npm test

If your would like tests to run on file change use:

$ npm run test-dev

0.3.7

8 years ago

0.3.6

8 years ago

0.3.5

8 years ago

0.3.4

8 years ago

0.3.3

8 years ago