0.2.2 • Published 9 years ago

scale-text v0.2.2

Weekly downloads
6
License
Eclipse Public Li...
Repository
github
Last release
9 years ago

Scale Text

A small library that scales text to the size (width and height) of the enclosing container, making the longest word take up a whole ine.

Currently it assumes that you use a monospaced font 13px in height, 6px in width, when judged at font-size 10px.

Installation

  npm install scale-text --save

Usage

  var ScaleText = require('scale-text')
  var idealSize = new ScaleText(['word word word'], 20, 100).ideal()

  console.log('ideal font size is ', idealSize);

Tests

  npm test

Contributing

If you would like to add a feature/fix a bug for us please create a pull request.