A polyfill for the enhanced context.measureText in Canvas 2D Context Level 2. Based on https://github.com/Pomax/fontmetrics.js