function getTextWidth(string) {
    var metrics = fontMetrics[this.cache.font] = fontMetrics[this.cache.font] || {};
    string += '';
    for (var i = 0, sum = 0, len = string.length; i < len; ++i) {
        var c = string[i];
        sum += metrics[c] = metrics[c] || this.measureText(c).width;
    }
    return sum;
}
Accumulates width of string in pixels, character by character, by chaching character widths and reusing those values when previously cached.

NOTE: There is a minor measuring error when taking the sum of the pixel widths of individual characters that make up a string vs. the pixel width of the string taken as a whole. This is possibly due to kerning or rounding. The error is typically about 0.1%.
@memberOf module:defaults
@param {CanvasRenderingContext2D} gc
@param {string} string - Text to measure.
@returns {nubmer} Width of string in pixels.