cssfontparser
parse shorthand css font strings"
Last updated 11 years ago by tmpvar .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install cssfontparser 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.2.1                                ...           latest (11 years ago)

6 Versions

  • 1.2.1                                ...           11 years ago
  • 1.2.0                                ...           11 years ago
  • 1.1.0                                ...           13 years ago
  • 1.0.2                                ...           13 years ago
  • 1.0.1                                ...           13 years ago
  • 1.0.0                                ...           13 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |