KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > pdfbox > ttf > MaximumProfileTable


1 /**
2  * Copyright (c) 2004, www.pdfbox.org
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright notice,
9  * this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright notice,
11  * this list of conditions and the following disclaimer in the documentation
12  * and/or other materials provided with the distribution.
13  * 3. Neither the name of pdfbox; nor the names of its
14  * contributors may be used to endorse or promote products derived from this
15  * software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20  * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
21  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
24  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  *
28  * http://www.pdfbox.org
29  *
30  */

31 package org.pdfbox.ttf;
32
33 import java.io.IOException JavaDoc;
34
35 /**
36  * A table in a true type font.
37  *
38  * @author Ben Litchfield (ben@csh.rit.edu)
39  * @version $Revision: 1.1 $
40  */

41 public class MaximumProfileTable extends TTFTable
42 {
43     /**
44      * A tag that identifies this table type.
45      */

46     public static final String JavaDoc TAG = "maxp";
47     
48     private float version;
49     private int numGlyphs;
50     private int maxPoints;
51     private int maxContours;
52     private int maxCompositePoints;
53     private int maxCompositeContours;
54     private int maxZones;
55     private int maxTwilightPoints;
56     private int maxStorage;
57     private int maxFunctionDefs;
58     private int maxInstructionDefs;
59     private int maxStackElements;
60     private int maxSizeOfInstructions;
61     private int maxComponentElements;
62     private int maxComponentDepth;
63     
64     /**
65      * @return Returns the maxComponentDepth.
66      */

67     public int getMaxComponentDepth()
68     {
69         return maxComponentDepth;
70     }
71     /**
72      * @param maxComponentDepthValue The maxComponentDepth to set.
73      */

74     public void setMaxComponentDepth(int maxComponentDepthValue)
75     {
76         this.maxComponentDepth = maxComponentDepthValue;
77     }
78     /**
79      * @return Returns the maxComponentElements.
80      */

81     public int getMaxComponentElements()
82     {
83         return maxComponentElements;
84     }
85     /**
86      * @param maxComponentElementsValue The maxComponentElements to set.
87      */

88     public void setMaxComponentElements(int maxComponentElementsValue)
89     {
90         this.maxComponentElements = maxComponentElementsValue;
91     }
92     /**
93      * @return Returns the maxCompositeContours.
94      */

95     public int getMaxCompositeContours()
96     {
97         return maxCompositeContours;
98     }
99     /**
100      * @param maxCompositeContoursValue The maxCompositeContours to set.
101      */

102     public void setMaxCompositeContours(int maxCompositeContoursValue)
103     {
104         this.maxCompositeContours = maxCompositeContoursValue;
105     }
106     /**
107      * @return Returns the maxCompositePoints.
108      */

109     public int getMaxCompositePoints()
110     {
111         return maxCompositePoints;
112     }
113     /**
114      * @param maxCompositePointsValue The maxCompositePoints to set.
115      */

116     public void setMaxCompositePoints(int maxCompositePointsValue)
117     {
118         this.maxCompositePoints = maxCompositePointsValue;
119     }
120     /**
121      * @return Returns the maxContours.
122      */

123     public int getMaxContours()
124     {
125         return maxContours;
126     }
127     /**
128      * @param maxContoursValue The maxContours to set.
129      */

130     public void setMaxContours(int maxContoursValue)
131     {
132         this.maxContours = maxContoursValue;
133     }
134     /**
135      * @return Returns the maxFunctionDefs.
136      */

137     public int getMaxFunctionDefs()
138     {
139         return maxFunctionDefs;
140     }
141     /**
142      * @param maxFunctionDefsValue The maxFunctionDefs to set.
143      */

144     public void setMaxFunctionDefs(int maxFunctionDefsValue)
145     {
146         this.maxFunctionDefs = maxFunctionDefsValue;
147     }
148     /**
149      * @return Returns the maxInstructionDefs.
150      */

151     public int getMaxInstructionDefs()
152     {
153         return maxInstructionDefs;
154     }
155     /**
156      * @param maxInstructionDefsValue The maxInstructionDefs to set.
157      */

158     public void setMaxInstructionDefs(int maxInstructionDefsValue)
159     {
160         this.maxInstructionDefs = maxInstructionDefsValue;
161     }
162     /**
163      * @return Returns the maxPoints.
164      */

165     public int getMaxPoints()
166     {
167         return maxPoints;
168     }
169     /**
170      * @param maxPointsValue The maxPoints to set.
171      */

172     public void setMaxPoints(int maxPointsValue)
173     {
174         this.maxPoints = maxPointsValue;
175     }
176     /**
177      * @return Returns the maxSizeOfInstructions.
178      */

179     public int getMaxSizeOfInstructions()
180     {
181         return maxSizeOfInstructions;
182     }
183     /**
184      * @param maxSizeOfInstructionsValue The maxSizeOfInstructions to set.
185      */

186     public void setMaxSizeOfInstructions(int maxSizeOfInstructionsValue)
187     {
188         this.maxSizeOfInstructions = maxSizeOfInstructionsValue;
189     }
190     /**
191      * @return Returns the maxStackElements.
192      */

193     public int getMaxStackElements()
194     {
195         return maxStackElements;
196     }
197     /**
198      * @param maxStackElementsValue The maxStackElements to set.
199      */

200     public void setMaxStackElements(int maxStackElementsValue)
201     {
202         this.maxStackElements = maxStackElementsValue;
203     }
204     /**
205      * @return Returns the maxStorage.
206      */

207     public int getMaxStorage()
208     {
209         return maxStorage;
210     }
211     /**
212      * @param maxStorageValue The maxStorage to set.
213      */

214     public void setMaxStorage(int maxStorageValue)
215     {
216         this.maxStorage = maxStorageValue;
217     }
218     /**
219      * @return Returns the maxTwilightPoints.
220      */

221     public int getMaxTwilightPoints()
222     {
223         return maxTwilightPoints;
224     }
225     /**
226      * @param maxTwilightPointsValue The maxTwilightPoints to set.
227      */

228     public void setMaxTwilightPoints(int maxTwilightPointsValue)
229     {
230         this.maxTwilightPoints = maxTwilightPointsValue;
231     }
232     /**
233      * @return Returns the maxZones.
234      */

235     public int getMaxZones()
236     {
237         return maxZones;
238     }
239     /**
240      * @param maxZonesValue The maxZones to set.
241      */

242     public void setMaxZones(int maxZonesValue)
243     {
244         this.maxZones = maxZonesValue;
245     }
246     /**
247      * @return Returns the numGlyphs.
248      */

249     public int getNumGlyphs()
250     {
251         return numGlyphs;
252     }
253     /**
254      * @param numGlyphsValue The numGlyphs to set.
255      */

256     public void setNumGlyphs(int numGlyphsValue)
257     {
258         this.numGlyphs = numGlyphsValue;
259     }
260     /**
261      * @return Returns the version.
262      */

263     public float getVersion()
264     {
265         return version;
266     }
267     /**
268      * @param versionValue The version to set.
269      */

270     public void setVersion(float versionValue)
271     {
272         this.version = versionValue;
273     }
274
275     /**
276      * This will read the required data from the stream.
277      *
278      * @param ttf The font that is being read.
279      * @param data The stream to read the data from.
280      * @throws IOException If there is an error reading the data.
281      */

282     public void initData( TrueTypeFont ttf, TTFDataStream data ) throws IOException JavaDoc
283     {
284         version = data.read32Fixed();
285         numGlyphs = data.readUnsignedShort();
286         maxPoints = data.readUnsignedShort();
287         maxContours = data.readUnsignedShort();
288         maxCompositePoints = data.readUnsignedShort();
289         maxCompositeContours = data.readUnsignedShort();
290         maxZones = data.readUnsignedShort();
291         maxTwilightPoints = data.readUnsignedShort();
292         maxStorage = data.readUnsignedShort();
293         maxFunctionDefs = data.readUnsignedShort();
294         maxInstructionDefs = data.readUnsignedShort();
295         maxStackElements = data.readUnsignedShort();
296         maxSizeOfInstructions = data.readUnsignedShort();
297         maxComponentElements = data.readUnsignedShort();
298         maxComponentDepth = data.readUnsignedShort();
299     }
300 }
301
Popular Tags