New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

scale-text

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scale-text

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

latest
Source
npmnpm
Version
0.2.2
Version published
Maintainers
1
Created
Source

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.

FAQs

Package last updated on 01 Dec 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts