KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2
3    Copyright 2001,2003 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  *
25  * @author <a HREF="mailto:david@steadystate.co.uk">David Schweinsberg</a>
26  * @version $Id: Coverage.java,v 1.5 2005/03/27 08:58:36 cam Exp $
27  */

28 public abstract class Coverage {
29
30     public abstract int getFormat();
31
32     /**
33      * @param glyphId The ID of the glyph to find.
34      * @return The index of the glyph within the coverage, or -1 if the glyph
35      * can't be found.
36      */

37     public abstract int findGlyph(int glyphId);
38     
39     protected static Coverage read(RandomAccessFile JavaDoc raf) throws IOException JavaDoc {
40         Coverage c = null;
41         int format = raf.readUnsignedShort();
42         if (format == 1) {
43             c = new CoverageFormat1(raf);
44         } else if (format == 2) {
45             c = new CoverageFormat2(raf);
46         }
47         return c;
48     }
49
50 }
51
Popular Tags