lib/parse/hmtx.js
function parseHmtxTable(data, start, numMetrics, numGlyphs, glyphs) {
    var p, i, glyph, advanceWidth, leftSideBearing;
    p = new parse.Parser(data, start);
    for (i = 0; i < numGlyphs; i += 1) {
        // If the font is monospaced, only one entry is needed. This last entry applies to all subsequent glyphs.
        if (i < numMetrics) {
            advanceWidth = p.parseUShort();
            leftSideBearing = p.parseShort();
        }
        glyph = glyphs[i];
        glyph.advanceWidth = advanceWidth;
        glyph.leftSideBearing = leftSideBearing;
    }
}
function parseHmtxTable(data, start, numMetrics, numGlyphs, glyphs) {
    var p, i, glyph, advanceWidth, leftSideBearing;
    p = new parse.Parser(data, start);
    for (i = 0; i < numGlyphs; i += 1) {
        // If the font is monospaced, only one entry is needed. This last entry applies to all subsequent glyphs.
        if (i < numMetrics) {
            advanceWidth = p.parseUShort();
            leftSideBearing = p.parseShort();
        }
        glyph = glyphs[i];
        glyph.advanceWidth = advanceWidth;
        glyph.leftSideBearing = leftSideBearing;
    }
}
function parseHmtxTable ( data , start , numMetrics , numGlyphs , glyphs ) { var p , i , glyph , advanceWidth , leftSideBearing ; p = new parse . Parser ( data , start ) ; for ( i = 0 ; i < numGlyphs ; i += 1 ) { // If the font is monospaced, only one entry is needed. This last entry applies to all subsequent glyphs. if ( i < numMetrics ) { advanceWidth = p . parseUShort ( ) ; leftSideBearing = p . parseShort ( ) ; } glyph = glyphs [ i ] ; glyph . advanceWidth = advanceWidth ; glyph . leftSideBearing = leftSideBearing ; } }
Parse the `hmtx` table, which contains the horizontal metrics for all glyphs. This function augments the glyph array, adding the advanceWidth and leftSideBearing to each glyph.
Parse the hmtx table which contains the horizontal metrics for all glyphs . This function augments the glyph array adding the advanceWidth and leftSideBearing to each glyph .