// Generated by CoffeeScript 1.7.1
(function() {
  var Data, MaxpTable, Table,
    __hasProp = {}.hasOwnProperty,
    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

  Table = require('../table');

  Data = require('../../data');

  MaxpTable = (function(_super) {
    __extends(MaxpTable, _super);

    function MaxpTable() {
      return MaxpTable.__super__.constructor.apply(this, arguments);
    }

    MaxpTable.prototype.tag = 'maxp';

    MaxpTable.prototype.parse = function(data) {
      data.pos = this.offset;
      this.version = data.readInt();
      this.numGlyphs = data.readUInt16();
      this.maxPoints = data.readUInt16();
      this.maxContours = data.readUInt16();
      this.maxCompositePoints = data.readUInt16();
      this.maxComponentContours = data.readUInt16();
      this.maxZones = data.readUInt16();
      this.maxTwilightPoints = data.readUInt16();
      this.maxStorage = data.readUInt16();
      this.maxFunctionDefs = data.readUInt16();
      this.maxInstructionDefs = data.readUInt16();
      this.maxStackElements = data.readUInt16();
      this.maxSizeOfInstructions = data.readUInt16();
      this.maxComponentElements = data.readUInt16();
      return this.maxComponentDepth = data.readUInt16();
    };

    MaxpTable.prototype.encode = function(ids) {
      var table;
      table = new Data;
      table.writeInt(this.version);
      table.writeUInt16(ids.length);
      table.writeUInt16(this.maxPoints);
      table.writeUInt16(this.maxContours);
      table.writeUInt16(this.maxCompositePoints);
      table.writeUInt16(this.maxComponentContours);
      table.writeUInt16(this.maxZones);
      table.writeUInt16(this.maxTwilightPoints);
      table.writeUInt16(this.maxStorage);
      table.writeUInt16(this.maxFunctionDefs);
      table.writeUInt16(this.maxInstructionDefs);
      table.writeUInt16(this.maxStackElements);
      table.writeUInt16(this.maxSizeOfInstructions);
      table.writeUInt16(this.maxComponentElements);
      table.writeUInt16(this.maxComponentDepth);
      return table.data;
    };

    return MaxpTable;

  })(Table);

  module.exports = MaxpTable;

}).call(this);
