KickJava   Java API By Example, From Geeks To Geeks.

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


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: HheaTable.java,v 1.3 2004/08/18 07:15:21 vhardy Exp $
25  * @author <a HREF="mailto:david@steadystate.co.uk">David Schweinsberg</a>
26  */

27 public class HheaTable implements Table {
28
29     private int version;
30     private short ascender;
31     private short descender;
32     private short lineGap;
33     private short advanceWidthMax;
34     private short minLeftSideBearing;
35     private short minRightSideBearing;
36     private short xMaxExtent;
37     private short caretSlopeRise;
38     private short caretSlopeRun;
39     private short metricDataFormat;
40     private short numberOfHMetrics;
41
42     protected HheaTable(DirectoryEntry de,RandomAccessFile JavaDoc raf) throws IOException JavaDoc {
43         raf.seek(de.getOffset());
44         version = raf.readInt();
45         ascender = raf.readShort();
46         descender = raf.readShort();
47         lineGap = raf.readShort();
48         advanceWidthMax = raf.readShort();
49         minLeftSideBearing = raf.readShort();
50         minRightSideBearing = raf.readShort();
51         xMaxExtent = raf.readShort();
52         caretSlopeRise = raf.readShort();
53         caretSlopeRun = raf.readShort();
54         for (int i = 0; i < 5; i++) {
55             raf.readShort();
56         }
57         metricDataFormat = raf.readShort();
58         numberOfHMetrics = raf.readShort();
59     }
60
61     public short getAdvanceWidthMax() {
62         return advanceWidthMax;
63     }
64
65     public short getAscender() {
66         return ascender;
67     }
68
69     public short getCaretSlopeRise() {
70         return caretSlopeRise;
71     }
72
73     public short getCaretSlopeRun() {
74         return caretSlopeRun;
75     }
76
77     public short getDescender() {
78         return descender;
79     }
80
81     public short getLineGap() {
82         return lineGap;
83     }
84
85     public short getMetricDataFormat() {
86         return metricDataFormat;
87     }
88
89     public short getMinLeftSideBearing() {
90         return minLeftSideBearing;
91     }
92
93     public short getMinRightSideBearing() {
94         return minRightSideBearing;
95     }
96
97     public short getNumberOfHMetrics() {
98         return numberOfHMetrics;
99     }
100
101     public int getType() {
102         return hhea;
103     }
104
105     public short getXMaxExtent() {
106         return xMaxExtent;
107     }
108 }
109
Popular Tags