cssfontparser
parse shorthand css font strings"
Last updated 12 years ago by tmpvar .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm 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 (12 years ago)

6 Versions

  • 1.2.1                                ...           12 years ago
  • 1.2.0                                ...           12 years ago
  • 1.1.0                                ...           14 years ago
  • 1.0.2                                ...           14 years ago
  • 1.0.1                                ...           14 years ago
  • 1.0.0                                ...           14 years ago
Maintainers (1)
Downloads
Total 20
Today 0
This Week 10
This Month 11
Last Day 0
Last Week 0
Last Month 5
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE