001: /*
002:
003: Licensed to the Apache Software Foundation (ASF) under one or more
004: contributor license agreements. See the NOTICE file distributed with
005: this work for additional information regarding copyright ownership.
006: The ASF licenses this file to You under the Apache License, Version 2.0
007: (the "License"); you may not use this file except in compliance with
008: the License. You may obtain a copy of the License at
009:
010: http://www.apache.org/licenses/LICENSE-2.0
011:
012: Unless required by applicable law or agreed to in writing, software
013: distributed under the License is distributed on an "AS IS" BASIS,
014: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015: See the License for the specific language governing permissions and
016: limitations under the License.
017:
018: */
019: package org.apache.batik.svggen.font.table;
020:
021: import java.io.IOException;
022: import java.io.RandomAccessFile;
023:
024: /**
025: * @version $Id: MaxpTable.java 475477 2006-11-15 22:44:28Z cam $
026: * @author <a href="mailto:david@steadystate.co.uk">David Schweinsberg</a>
027: */
028: public class MaxpTable implements Table {
029:
030: private int versionNumber;
031: private int numGlyphs;
032: private int maxPoints;
033: private int maxContours;
034: private int maxCompositePoints;
035: private int maxCompositeContours;
036: private int maxZones;
037: private int maxTwilightPoints;
038: private int maxStorage;
039: private int maxFunctionDefs;
040: private int maxInstructionDefs;
041: private int maxStackElements;
042: private int maxSizeOfInstructions;
043: private int maxComponentElements;
044: private int maxComponentDepth;
045:
046: protected MaxpTable(DirectoryEntry de, RandomAccessFile raf)
047: throws IOException {
048: raf.seek(de.getOffset());
049: versionNumber = raf.readInt();
050: numGlyphs = raf.readUnsignedShort();
051: maxPoints = raf.readUnsignedShort();
052: maxContours = raf.readUnsignedShort();
053: maxCompositePoints = raf.readUnsignedShort();
054: maxCompositeContours = raf.readUnsignedShort();
055: maxZones = raf.readUnsignedShort();
056: maxTwilightPoints = raf.readUnsignedShort();
057: maxStorage = raf.readUnsignedShort();
058: maxFunctionDefs = raf.readUnsignedShort();
059: maxInstructionDefs = raf.readUnsignedShort();
060: maxStackElements = raf.readUnsignedShort();
061: maxSizeOfInstructions = raf.readUnsignedShort();
062: maxComponentElements = raf.readUnsignedShort();
063: maxComponentDepth = raf.readUnsignedShort();
064: }
065:
066: public int getMaxComponentDepth() {
067: return maxComponentDepth;
068: }
069:
070: public int getMaxComponentElements() {
071: return maxComponentElements;
072: }
073:
074: public int getMaxCompositeContours() {
075: return maxCompositeContours;
076: }
077:
078: public int getMaxCompositePoints() {
079: return maxCompositePoints;
080: }
081:
082: public int getMaxContours() {
083: return maxContours;
084: }
085:
086: public int getMaxFunctionDefs() {
087: return maxFunctionDefs;
088: }
089:
090: public int getMaxInstructionDefs() {
091: return maxInstructionDefs;
092: }
093:
094: public int getMaxPoints() {
095: return maxPoints;
096: }
097:
098: public int getMaxSizeOfInstructions() {
099: return maxSizeOfInstructions;
100: }
101:
102: public int getMaxStackElements() {
103: return maxStackElements;
104: }
105:
106: public int getMaxStorage() {
107: return maxStorage;
108: }
109:
110: public int getMaxTwilightPoints() {
111: return maxTwilightPoints;
112: }
113:
114: public int getMaxZones() {
115: return maxZones;
116: }
117:
118: public int getNumGlyphs() {
119: return numGlyphs;
120: }
121:
122: public int getType() {
123: return maxp;
124: }
125: }
|