app/tools/opentype.js
// Parse the coordinate data for a glyph.
Parse the coordinate data for a glyph.
Parse the coordinate data for a glyph .
function parseGlyphCoordinate(p, flag, previousValue, shortVectorBit, sameBit) {
        var v;
        if (isBitSet(flag, shortVectorBit)) {
            v = p.parseByte();
            if (!isBitSet(flag, sameBit)) {
                v = -v;
            }
            v = previousValue + v;
        } else {
            if (isBitSet(flag, sameBit)) {
                v = previousValue;
            } else {
                v = previousValue + p.parseShort();
            }
        }
        return v;
    }
function parseGlyphCoordinate ( p , flag , previousValue , shortVectorBit , sameBit ) { var v ; if ( isBitSet ( flag , shortVectorBit ) ) { v = p . parseByte ( ) ; if ( ! isBitSet ( flag , sameBit ) ) { v = - v ; } v = previousValue + v ; } else { if ( isBitSet ( flag , sameBit ) ) { v = previousValue ; } else { v = previousValue + p . parseShort ( ) ; } } return v ; }
Parse the coordinate data for a glyph.
Parse the coordinate data for a glyph .
// The coordinate is 1 byte long. // The `same` bit is re-used for short values to signify the sign of the value. //  The coordinate is 2 bytes long. // If the `same` bit is set, the coordinate is the same as the previous coordinate. // Parse the coordinate as a signed 16-bit delta value.