Pomax/Font.js — Issue #9: Support for measuring any font already available to the browser.
Author: benogle
Created: 2012-02-01 02:16:46+00:00
State: open

It seems Font.js only supports remote fonts. The browser's built in font metrics capabilities for already-available fonts is terrible (canvas' `measureText()` only returns the width). It would be amazing if I could set `font.src = '18pt bold helvetica'` and then get accurate metrics back.

It looks like this could work pretty easily as you are already using canvas to measure the font rather than some data embedded in the font file itself.

One thing missing is leading. I've found easiest and most accurate measure is `.offsetHeight/2` of a 2 line div with `line-height: 1`.