KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > batik > svggen > font > table > Os2Table


1 /*
2
3    Copyright 2001 The Apache Software Foundation
4
5    Licensed under the Apache License, Version 2.0 (the "License");
6    you may not use this file except in compliance with the License.
7    You may obtain a copy of the License at
8
9        http://www.apache.org/licenses/LICENSE-2.0
10
11    Unless required by applicable law or agreed to in writing, software
12    distributed under the License is distributed on an "AS IS" BASIS,
13    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14    See the License for the specific language governing permissions and
15    limitations under the License.
16
17  */

18 package org.apache.batik.svggen.font.table;
19
20 import java.io.IOException JavaDoc;
21 import java.io.RandomAccessFile JavaDoc;
22
23 /**
24  * @version $Id: Os2Table.java,v 1.3 2004/08/18 07:15:22 vhardy Exp $
25  * @author <a HREF="mailto:david@steadystate.co.uk">David Schweinsberg</a>
26  */

27 public class Os2Table implements Table {
28
29     private int version;
30     private short xAvgCharWidth;
31     private int usWeightClass;
32     private int usWidthClass;
33     private short fsType;
34     private short ySubscriptXSize;
35     private short ySubscriptYSize;
36     private short ySubscriptXOffset;
37     private short ySubscriptYOffset;
38     private short ySuperscriptXSize;
39     private short ySuperscriptYSize;
40     private short ySuperscriptXOffset;
41     private short ySuperscriptYOffset;
42     private short yStrikeoutSize;
43     private short yStrikeoutPosition;
44     private short sFamilyClass;
45     private Panose panose;
46     private int ulUnicodeRange1;
47     private int ulUnicodeRange2;
48     private int ulUnicodeRange3;
49     private int ulUnicodeRange4;
50     private int achVendorID;
51     private short fsSelection;
52     private int usFirstCharIndex;
53     private int usLastCharIndex;
54     private short sTypoAscender;
55     private short sTypoDescender;
56     private short sTypoLineGap;
57     private int usWinAscent;
58     private int usWinDescent;
59     private int ulCodePageRange1;
60     private int ulCodePageRange2;
61
62     protected Os2Table(DirectoryEntry de,RandomAccessFile JavaDoc raf) throws IOException JavaDoc {
63         raf.seek(de.getOffset());
64         version = raf.readUnsignedShort();
65         xAvgCharWidth = raf.readShort();
66         usWeightClass = raf.readUnsignedShort();
67         usWidthClass = raf.readUnsignedShort();
68         fsType = raf.readShort();
69         ySubscriptXSize = raf.readShort();
70         ySubscriptYSize = raf.readShort();
71         ySubscriptXOffset = raf.readShort();
72         ySubscriptYOffset = raf.readShort();
73         ySuperscriptXSize = raf.readShort();
74         ySuperscriptYSize = raf.readShort();
75         ySuperscriptXOffset = raf.readShort();
76         ySuperscriptYOffset = raf.readShort();
77         yStrikeoutSize = raf.readShort();
78         yStrikeoutPosition = raf.readShort();
79         sFamilyClass = raf.readShort();
80         byte[] buf = new byte[10];
81         raf.read(buf);
82         panose = new Panose(buf);
83         ulUnicodeRange1 = raf.readInt();
84         ulUnicodeRange2 = raf.readInt();
85         ulUnicodeRange3 = raf.readInt();
86         ulUnicodeRange4 = raf.readInt();
87         achVendorID = raf.readInt();
88         fsSelection = raf.readShort();
89         usFirstCharIndex = raf.readUnsignedShort();
90         usLastCharIndex = raf.readUnsignedShort();
91         sTypoAscender = raf.readShort();
92         sTypoDescender = raf.readShort();
93         sTypoLineGap = raf.readShort();
94         usWinAscent = raf.readUnsignedShort();
95         usWinDescent = raf.readUnsignedShort();
96         ulCodePageRange1 = raf.readInt();
97         ulCodePageRange2 = raf.readInt();
98     }
99
100     public int getVersion() {
101         return version;
102     }
103
104     public short getAvgCharWidth() {
105         return xAvgCharWidth;
106     }
107
108     public int getWeightClass() {
109         return usWeightClass;
110     }
111
112     public int getWidthClass() {
113         return usWidthClass;
114     }
115
116     public short getLicenseType() {
117         return fsType;
118     }
119
120     public short getSubscriptXSize() {
121         return ySubscriptXSize;
122     }
123
124     public short getSubscriptYSize() {
125         return ySubscriptYSize;
126     }
127
128     public short getSubscriptXOffset() {
129         return ySubscriptXOffset;
130     }
131
132     public short getSubscriptYOffset() {
133         return ySubscriptYOffset;
134     }
135
136     public short getSuperscriptXSize() {
137         return ySuperscriptXSize;
138     }
139
140     public short getSuperscriptYSize() {
141         return ySuperscriptYSize;
142     }
143
144     public short getSuperscriptXOffset() {
145         return ySuperscriptXOffset;
146     }
147
148     public short getSuperscriptYOffset() {
149         return ySuperscriptYOffset;
150     }
151
152     public short getStrikeoutSize() {
153         return yStrikeoutSize;
154     }
155
156     public short getStrikeoutPosition() {
157         return yStrikeoutPosition;
158     }
159
160     public short getFamilyClass() {
161         return sFamilyClass;
162     }
163
164     public Panose getPanose() {
165         return panose;
166     }
167
168     public int getUnicodeRange1() {
169         return ulUnicodeRange1;
170     }
171
172     public int getUnicodeRange2() {
173         return ulUnicodeRange2;
174     }
175
176     public int getUnicodeRange3() {
177         return ulUnicodeRange3;
178     }
179
180     public int getUnicodeRange4() {
181         return ulUnicodeRange4;
182     }
183
184     public int getVendorID() {
185         return achVendorID;
186     }
187
188     public short getSelection() {
189         return fsSelection;
190     }
191
192     public int getFirstCharIndex() {
193         return usFirstCharIndex;
194     }
195
196     public int getLastCharIndex() {
197         return usLastCharIndex;
198     }
199
200     public short getTypoAscender() {
201         return sTypoAscender;
202     }
203
204     public short getTypoDescender() {
205         return sTypoDescender;
206     }
207
208     public short getTypoLineGap() {
209         return sTypoLineGap;
210     }
211
212     public int getWinAscent() {
213         return usWinAscent;
214     }
215
216     public int getWinDescent() {
217         return usWinDescent;
218     }
219
220     public int getCodePageRange1() {
221         return ulCodePageRange1;
222     }
223
224     public int getCodePageRange2() {
225         return ulCodePageRange2;
226     }
227
228     public int getType() {
229         return OS_2;
230     }
231 }
232
Popular Tags