Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

font-fit

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

font-fit

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

  • 0.3.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10
decreased by-68.75%
Maintainers
1
Weekly downloads
 
Created
Source

font-fit

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

Demo

  • 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

FAQs

Package last updated on 16 Dec 2015

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc