Socket
Socket
Sign inDemoInstall

cssfontparser

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cssfontparser

parse shorthand css font strings"


Version published
Weekly downloads
1.8M
increased by1.72%
Maintainers
1
Install size
9.08 kB
Created
Weekly downloads
 

Readme

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

Last updated on 08 May 2015

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc