parseClassDef method

dynamic parseClassDef()

Implementation

parseClassDef() {
  var startOffset = this.offset + this.relativeOffset;
  var format = this.parseUShort();
  if (format == 1) {
    return {
      "format": 1,
      "startGlyph": this.parseUShort(),
      "classes": this.parseUShortList(null)
    };
  } else if (format == 2) {
    return {
      "format": 2,
      "ranges": this.parseRecordList({
        "start": Parser.uShort,
        "end": Parser.uShort,
        "classId": Parser.uShort
      }, null)
    };
  }
  throw('0x' + startOffset.toString(16) + ': ClassDef format must be 1 or 2.');
}