ccsfontparser
parse shorthand css font declarations into an object
install
npm install cssfontparser
use
var parse = ;var obj = ;console; /* outputs: { style: 'italic', variant: 'small-caps', weight: 'bolder', size: 200, lineHeight: 20, family: 'serif' } */ console; /* 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.