/** * Get a buffer from the data */ public ByteBuffer getData() { ByteBuffer buf = ByteBuffer.allocate(getLength()); buf.putInt(getVersion()); buf.putShort((short) getNumGlyphs()); buf.putShort((short) getMaxPoints()); buf.putShort((short) getMaxContours()); buf.putShort((short) getMaxComponentPoints()); buf.putShort((short) getMaxComponentContours()); buf.putShort((short) getMaxZones()); buf.putShort((short) getMaxTwilightPoints()); buf.putShort((short) getMaxStorage()); buf.putShort((short) getMaxFunctionDefs()); buf.putShort((short) getMaxInstructionDefs()); buf.putShort((short) getMaxStackElements()); buf.putShort((short) getMaxSizeOfInstructions()); buf.putShort((short) getMaxComponentElements()); buf.putShort((short) getMaxComponentDepth()); // reset the position to the beginning of the buffer buf.flip(); return buf; }
/** * Create a pretty String */ public String toString() { StringBuffer buf = new StringBuffer(); String indent = " "; buf.append(indent + "Version : " + Integer.toHexString(getVersion()) + "\n"); buf.append(indent + "NumGlyphs : " + getNumGlyphs() + "\n"); buf.append(indent + "MaxPoints : " + getMaxPoints() + "\n"); buf.append(indent + "MaxContours : " + getMaxContours() + "\n"); buf.append(indent + "MaxCompPoints : " + getMaxComponentPoints() + "\n"); buf.append(indent + "MaxCompContours : " + getMaxComponentContours() + "\n"); buf.append(indent + "MaxZones : " + getMaxZones() + "\n"); buf.append(indent + "MaxTwilightPoints: " + getMaxTwilightPoints() + "\n"); buf.append(indent + "MaxStorage : " + getMaxStorage() + "\n"); buf.append(indent + "MaxFuncDefs : " + getMaxFunctionDefs() + "\n"); buf.append(indent + "MaxInstDefs : " + getMaxInstructionDefs() + "\n"); buf.append(indent + "MaxStackElements : " + getMaxStackElements() + "\n"); buf.append(indent + "MaxSizeInst : " + getMaxSizeOfInstructions() + "\n"); buf.append(indent + "MaxCompElements : " + getMaxComponentElements() + "\n"); buf.append(indent + "MaxCompDepth : " + getMaxComponentDepth() + "\n"); return buf.toString(); } }
break; case MAXP_TABLE: // maxp table outTable = new MaxpTable(); break; case NAME_TABLE: // name table
break; case MAXP_TABLE: // maxp table outTable = new MaxpTable(); break; case NAME_TABLE: // name table
/** * Create a pretty String */ public String toString() { StringBuffer buf = new StringBuffer(); String indent = " "; buf.append(indent + "Version : " + Integer.toHexString(getVersion()) + "\n"); buf.append(indent + "NumGlyphs : " + getNumGlyphs() + "\n"); buf.append(indent + "MaxPoints : " + getMaxPoints() + "\n"); buf.append(indent + "MaxContours : " + getMaxContours() + "\n"); buf.append(indent + "MaxCompPoints : " + getMaxComponentPoints() + "\n"); buf.append(indent + "MaxCompContours : " + getMaxComponentContours() + "\n"); buf.append(indent + "MaxZones : " + getMaxZones() + "\n"); buf.append(indent + "MaxTwilightPoints: " + getMaxTwilightPoints() + "\n"); buf.append(indent + "MaxStorage : " + getMaxStorage() + "\n"); buf.append(indent + "MaxFuncDefs : " + getMaxFunctionDefs() + "\n"); buf.append(indent + "MaxInstDefs : " + getMaxInstructionDefs() + "\n"); buf.append(indent + "MaxStackElements : " + getMaxStackElements() + "\n"); buf.append(indent + "MaxSizeInst : " + getMaxSizeOfInstructions() + "\n"); buf.append(indent + "MaxCompElements : " + getMaxComponentElements() + "\n"); buf.append(indent + "MaxCompDepth : " + getMaxComponentDepth() + "\n"); return buf.toString(); } }
break; case MAXP_TABLE: // maxp table outTable = new MaxpTable(); break; case NAME_TABLE: // name table
/** * Get a buffer from the data */ public ByteBuffer getData() { ByteBuffer buf = ByteBuffer.allocate(getLength()); buf.putInt(getVersion()); buf.putShort((short) getNumGlyphs()); buf.putShort((short) getMaxPoints()); buf.putShort((short) getMaxContours()); buf.putShort((short) getMaxComponentPoints()); buf.putShort((short) getMaxComponentContours()); buf.putShort((short) getMaxZones()); buf.putShort((short) getMaxTwilightPoints()); buf.putShort((short) getMaxStorage()); buf.putShort((short) getMaxFunctionDefs()); buf.putShort((short) getMaxInstructionDefs()); buf.putShort((short) getMaxStackElements()); buf.putShort((short) getMaxSizeOfInstructions()); buf.putShort((short) getMaxComponentElements()); buf.putShort((short) getMaxComponentDepth()); // reset the position to the beginning of the buffer buf.flip(); return buf; }
/** * Get a buffer from the data */ public ByteBuffer getData() { ByteBuffer buf = ByteBuffer.allocate(getLength()); buf.putInt(getVersion()); buf.putShort((short) getNumGlyphs()); buf.putShort((short) getMaxPoints()); buf.putShort((short) getMaxContours()); buf.putShort((short) getMaxComponentPoints()); buf.putShort((short) getMaxComponentContours()); buf.putShort((short) getMaxZones()); buf.putShort((short) getMaxTwilightPoints()); buf.putShort((short) getMaxStorage()); buf.putShort((short) getMaxFunctionDefs()); buf.putShort((short) getMaxInstructionDefs()); buf.putShort((short) getMaxStackElements()); buf.putShort((short) getMaxSizeOfInstructions()); buf.putShort((short) getMaxComponentElements()); buf.putShort((short) getMaxComponentDepth()); // reset the position to the beginning of the buffer buf.flip(); return buf; }
/** * Create a pretty String */ public String toString() { StringBuffer buf = new StringBuffer(); String indent = " "; buf.append(indent + "Version : " + Integer.toHexString(getVersion()) + "\n"); buf.append(indent + "NumGlyphs : " + getNumGlyphs() + "\n"); buf.append(indent + "MaxPoints : " + getMaxPoints() + "\n"); buf.append(indent + "MaxContours : " + getMaxContours() + "\n"); buf.append(indent + "MaxCompPoints : " + getMaxComponentPoints() + "\n"); buf.append(indent + "MaxCompContours : " + getMaxComponentContours() + "\n"); buf.append(indent + "MaxZones : " + getMaxZones() + "\n"); buf.append(indent + "MaxTwilightPoints: " + getMaxTwilightPoints() + "\n"); buf.append(indent + "MaxStorage : " + getMaxStorage() + "\n"); buf.append(indent + "MaxFuncDefs : " + getMaxFunctionDefs() + "\n"); buf.append(indent + "MaxInstDefs : " + getMaxInstructionDefs() + "\n"); buf.append(indent + "MaxStackElements : " + getMaxStackElements() + "\n"); buf.append(indent + "MaxSizeInst : " + getMaxSizeOfInstructions() + "\n"); buf.append(indent + "MaxCompElements : " + getMaxComponentElements() + "\n"); buf.append(indent + "MaxCompDepth : " + getMaxComponentDepth() + "\n"); return buf.toString(); } }