KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > batik > gvt > font > GVTFont


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.gvt.font;
19
20 import java.awt.font.FontRenderContext JavaDoc;
21 import java.text.CharacterIterator JavaDoc;
22
23 /**
24  * An interface for all GVT font classes.
25  *
26  * @author <a HREF="mailto:bella.robinson@cmis.csiro.au">Bella Robinson</a>
27  * @version $Id: GVTFont.java,v 1.9 2004/08/18 07:14:35 vhardy Exp $
28  */

29 public interface GVTFont {
30
31     /**
32      * Checks if this Font has a glyph for the specified character.
33      */

34     public boolean canDisplay(char c);
35
36     /**
37      * Indicates whether or not this Font can display the characters in the
38      * specified text starting at start and ending at limit.
39      */

40     public int canDisplayUpTo(char[] text, int start, int limit);
41
42     /**
43      * Indicates whether or not this Font can display the the characters in
44      * the specified CharacterIterator starting at start and ending at limit.
45      */

46     public int canDisplayUpTo(CharacterIterator JavaDoc iter, int start, int limit);
47
48     /**
49      * Indicates whether or not this Font can display a specified String.
50      */

51     public int canDisplayUpTo(String JavaDoc str);
52
53     /**
54      * Returns a new GlyphVector object created with the specified array of
55      * characters and the specified FontRenderContext.
56      */

57     public GVTGlyphVector createGlyphVector(FontRenderContext JavaDoc frc,
58                                             char[] chars);
59     /**
60      * Returns a new GlyphVector object created with the specified
61      * CharacterIterator and the specified FontRenderContext.
62      */

63     public GVTGlyphVector createGlyphVector(FontRenderContext JavaDoc frc,
64                                             CharacterIterator JavaDoc ci);
65     /**
66      * Returns a new GlyphVector object created with the specified integer
67      * array and the specified FontRenderContext.
68      */

69     public GVTGlyphVector createGlyphVector(FontRenderContext JavaDoc frc,
70                                             int[] glyphCodes,
71                                             CharacterIterator JavaDoc ci);
72     /**
73      * Returns a new GlyphVector object created with the specified String and
74      * the specified FontRenderContext.
75      */

76     public GVTGlyphVector createGlyphVector(FontRenderContext JavaDoc frc,
77                                             String JavaDoc str);
78
79     /**
80      * Creates a new Font object by replicating the current Font object and
81      * applying a new size to it.
82      */

83     public GVTFont deriveFont(float size);
84
85     /**
86      * Returns a GVTLineMetrics object created with the specified arguments.
87      */

88     public GVTLineMetrics getLineMetrics(char[] chars, int beginIndex,
89                                          int limit, FontRenderContext JavaDoc frc);
90
91     /**
92      * Returns a GVTLineMetrics object created with the specified arguments.
93      */

94     public GVTLineMetrics getLineMetrics(CharacterIterator JavaDoc ci, int beginIndex,
95                                          int limit, FontRenderContext JavaDoc frc);
96
97     /**
98      * Returns a GVTLineMetrics object created with the specified String and
99      * FontRenderContext.
100      */

101     public GVTLineMetrics getLineMetrics(String JavaDoc str, FontRenderContext JavaDoc frc);
102
103     /**
104      * Returns a GVTLineMetrics object created with the specified arguments.
105      */

106     public GVTLineMetrics getLineMetrics(String JavaDoc str, int beginIndex, int limit,
107                                          FontRenderContext JavaDoc frc);
108
109     /**
110      * Returns the size of this font.
111      */

112     public float getSize();
113
114     /**
115      * Returns the horizontal kerning value of this glyph pair.
116      */

117     public float getVKern(int glyphCode1, int glyphCode2);
118
119     /**
120      * Returns the vertical kerning value of this glyph pair.
121      */

122     public float getHKern(int glyphCode1, int glyphCode2);
123
124     public String JavaDoc toString();
125 }
126
Popular Tags