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

cssfontparser

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cssfontparser

parse shorthand css font strings"

  • 1.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.9M
increased by6.25%
Maintainers
1
Weekly downloads
 
Created
Source

ccsfontparser

parse shorthand css font declarations into an object

install

npm install cssfontparser

use


var parse = require('cssfontparser');
var obj = parse('italic small-caps bolder 50%/20px serif', '1in san-serif', 400);
console.log(obj);

/* outputs:

{ style: 'italic',
  variant: 'small-caps',
  weight: 'bolder',
  size: 200,
  lineHeight: 20,
  family: 'serif' }

*/

console.log(obj.toString());

/* outputs:
  'italic small-caps bolder 200px/20px serif'
*/

#signature

cssfontparser("font string"[,"parent font string"[, dpi = 96.0]]);

note: a parent font string is required for em and % size calculations.

license

Keywords

FAQs

Package last updated on 08 May 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