Skip to content
This repository has been archived by the owner on May 20, 2018. It is now read-only.
/ scale-text Public archive

🔤 Scales text to the size (width and height) of the enclosing container

License

Notifications You must be signed in to change notification settings

build-canaries/scale-text

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This library is no longer maintained

This library has been deprecated as its functionality has been added directly to the Nevergreen codebase.

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.

About

🔤 Scales text to the size (width and height) of the enclosing container

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published