KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > awt > font > GlyphVector


1 /*
2  * @(#)GlyphVector.java 1.32 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 /*
9  * @author Charlton Innovations, Inc.
10  */

11
12 package java.awt.font;
13
14 import java.awt.Graphics2D JavaDoc;
15 import java.awt.Font JavaDoc;
16 import java.awt.Polygon JavaDoc; // remind - need a floating point version
17
import java.awt.Rectangle JavaDoc;
18 import java.awt.geom.Point2D JavaDoc;
19 import java.awt.geom.Rectangle2D JavaDoc;
20 import java.awt.geom.AffineTransform JavaDoc;
21 import java.awt.Shape JavaDoc;
22 import java.awt.font.GlyphMetrics JavaDoc;
23 import java.awt.font.GlyphJustificationInfo JavaDoc;
24
25 /**
26  * A <code>GlyphVector</code> object is a collection of glyphs
27  * containing geometric information for the placement of each glyph
28  * in a transformed coordinate space which corresponds to the
29  * device on which the <code>GlyphVector</code> is ultimately
30  * displayed.
31  * <p>
32  * The <code>GlyphVector</code> does not attempt any interpretation of
33  * the sequence of glyphs it contains. Relationships between adjacent
34  * glyphs in sequence are solely used to determine the placement of
35  * the glyphs in the visual coordinate space.
36  * <p>
37  * Instances of <code>GlyphVector</code> are created by a {@link Font}.
38  * <p>
39  * In a text processing application that can cache intermediate
40  * representations of text, creation and subsequent caching of a
41  * <code>GlyphVector</code> for use during rendering is the fastest
42  * method to present the visual representation of characters to a user.
43  * <p>
44  * A <code>GlyphVector</code> is associated with exactly one
45  * <code>Font</code>, and can provide data useful only in relation to
46  * this <code>Font</code>. In addition, metrics obtained from a
47  * <code>GlyphVector</code> are not generally geometrically scaleable
48  * since the pixelization and spacing are dependent on grid-fitting
49  * algorithms within a <code>Font</code>. To facilitate accurate
50  * measurement of a <code>GlyphVector</code> and its component
51  * glyphs, you must specify a scaling transform, anti-alias mode, and
52  * fractional metrics mode when creating the <code>GlyphVector</code>.
53  * These characteristics can be derived from the destination device.
54  * <p>
55  * For each glyph in the <code>GlyphVector</code>, you can obtain:
56  * <ul>
57  * <li>the position of the glyph
58  * <li>the transform associated with the glyph
59  * <li>the metrics of the glyph in the context of the
60  * <code>GlyphVector</code>. The metrics of the glyph may be
61  * different under different transforms, application specified
62  * rendering hints, and the specific instance of the glyph within
63  * the <code>GlyphVector</code>.
64  * </ul>
65  * <p>
66  * Altering the data used to create the <code>GlyphVector</code> does not
67  * alter the state of the <code>GlyphVector</code>.
68  * <p>
69  * Methods are provided to adjust the positions of the glyphs
70  * within the <code>GlyphVector</code>. These methods are most
71  * appropriate for applications that are performing justification
72  * operations for the presentation of the glyphs.
73  * <p>
74  * Methods are provided to transform individual glyphs within the
75  * <code>GlyphVector</code>. These methods are primarily useful for
76  * special effects.
77  * <p>
78  * Methods are provided to return both the visual, logical, and pixel bounds
79  * of the entire <code>GlyphVector</code> or of individual glyphs within
80  * the <code>GlyphVector</code>.
81  * <p>
82  * Methods are provided to return a {@link Shape} for the
83  * <code>GlyphVector</code>, and for individual glyphs within the
84  * <code>GlyphVector</code>.
85  * @see Font
86  * @see GlyphMetrics
87  * @see TextLayout
88  * @version 19 Mar 1998
89  * @author Charlton Innovations, Inc.
90  */

91
92 public abstract class GlyphVector implements Cloneable JavaDoc {
93
94     //
95
// methods associated with creation-time state
96
//
97

98     /**
99      * Returns the <code>Font</code> associated with this
100      * <code>GlyphVector</code>.
101      * @return <code>Font</code> used to create this
102      * <code>GlyphVector</code>.
103      * @see Font
104      */

105     public abstract Font JavaDoc getFont();
106
107     /**
108      * Returns the {@link FontRenderContext} associated with this
109      * <code>GlyphVector</code>.
110      * @return <code>FontRenderContext</code> used to create this
111      * <code>GlyphVector</code>.
112      * @see FontRenderContext
113      * @see Font
114      */

115     public abstract FontRenderContext JavaDoc getFontRenderContext();
116
117     //
118
// methods associated with the GlyphVector as a whole
119
//
120

121     /**
122      * Assigns default positions to each glyph in this
123      * <code>GlyphVector</code>. This can destroy information
124      * generated during initial layout of this <code>GlyphVector</code>.
125      */

126     public abstract void performDefaultLayout();
127
128     /**
129      * Returns the number of glyphs in this <code>GlyphVector</code>.
130      * @return number of glyphs in this <code>GlyphVector</code>.
131      */

132     public abstract int getNumGlyphs();
133
134     /**
135      * Returns the glyphcode of the specified glyph.
136      * This return value is meaningless to anything other
137      * than the <code>Font</code> object that created this
138      * <code>GlyphVector</code>.
139      * @param glyphIndex the index into this <code>GlyphVector</code>
140      * that corresponds to the glyph from which to retrieve the
141      * glyphcode.
142      * @return the glyphcode of the glyph at the specified
143      * <code>glyphIndex</code>.
144      * @throws IndexOutOfBoundsException if <code>glyphIndex</code>
145      * is less than 0 or greater than or equal to the
146      * number of glyphs in this <code>GlyphVector</code>
147      */

148     public abstract int getGlyphCode(int glyphIndex);
149
150     /**
151      * Returns an array of glyphcodes for the specified glyphs.
152      * The contents of this return value are meaningless to anything other
153      * than the <code>Font</code> used to create this
154      * <code>GlyphVector</code>. This method is used
155      * for convenience and performance when processing glyphcodes.
156      * If no array is passed in, a new array is created.
157      * @param beginGlyphIndex the index into this
158      * <code>GlyphVector</code> at which to start retrieving glyphcodes
159      * @param numEntries the number of glyphcodes to retrieve
160      * @param codeReturn the array that receives the glyphcodes and is
161      * then returned
162      * @return an array of glyphcodes for the specified glyphs.
163      * @throws IllegalArgumentException if <code>numEntries</code> is
164      * less than 0
165      * @throws IndexOutOfBoundsException if <code>beginGlyphIndex</code>
166      * is less than 0
167      * @throws IndexOutOfBoundsException if the sum of
168      * <code>beginGlyphIndex</code> and <code>numEntries</code> is
169      * greater than the number of glyphs in this
170      * <code>GlyphVector</code>
171      */

172     public abstract int[] getGlyphCodes(int beginGlyphIndex, int numEntries,
173                                         int[] codeReturn);
174
175     /**
176      * Returns the character index of the specified glyph.
177      * The character index is the index of the first logical
178      * character represented by the glyph. The default
179      * implementation assumes a one-to-one, left-to-right mapping
180      * of glyphs to characters.
181      * @param glyphIndex the index of the glyph
182      * @return the index of the first character represented by the glyph
183      * @since 1.4
184      */

185     public int getGlyphCharIndex(int glyphIndex) {
186         return glyphIndex;
187     }
188
189     /**
190      * Returns the character indices of the specified glyphs.
191      * The character index is the index of the first logical
192      * character represented by the glyph. Indices are returned
193      * in glyph order. The default implementation invokes
194      * getGlyphCharIndex for each glyph, and subclassers will probably
195      * want to override this implementation for performance reasons.
196      * Use this method for convenience and performance
197      * in processing of glyphcodes. If no array is passed in,
198      * a new array is created.
199      * @param beginGlyphIndex the index of the first glyph
200      * @param numEntries the number of glyph indices
201      * @param codeReturn the array into which to return the character indices
202      * @return an array of character indices, one per glyph.
203      * @since 1.4
204      */

205     public int[] getGlyphCharIndices(int beginGlyphIndex, int numEntries,
206                                      int[] codeReturn) {
207     if (codeReturn == null) {
208             codeReturn = new int[numEntries];
209     }
210     for (int i = 0, j = beginGlyphIndex; i < numEntries; ++i, ++j) {
211         codeReturn[i] = getGlyphCharIndex(j);
212     }
213     return codeReturn;
214      }
215
216     /**
217      * Returns the logical bounds of this <code>GlyphVector</code>.
218      * This method is used when positioning this <code>GlyphVector</code>
219      * in relation to visually adjacent <code>GlyphVector</code> objects.
220      * @return a {@link Rectangle2D} that is the logical bounds of this
221      * <code>GlyphVector</code>.
222      */

223     public abstract Rectangle2D JavaDoc getLogicalBounds();
224
225     /**
226      * Returns the visual bounds of this <code>GlyphVector</code>
227      * The visual bounds is the bounding box of the outline of this
228      * <code>GlyphVector</code>. Because of rasterization and
229      * alignment of pixels, it is possible that this box does not
230      * enclose all pixels affected by rendering this <code>GlyphVector</code>.
231      * @return a <code>Rectangle2D</code> that is the bounding box
232      * of this <code>GlyphVector</code>.
233      */

234     public abstract Rectangle2D JavaDoc getVisualBounds();
235
236     /**
237      * Returns the pixel bounds of this <code>GlyphVector</code> when
238      * rendered in a graphics with the given
239      * <code>FontRenderContext</code> at the given location. The
240      * renderFRC need not be the same as the
241      * <code>FontRenderContext</code> of this
242      * <code>GlyphVector</code>, and can be null. If it is null, the
243      * <code>FontRenderContext</code> of this <code>GlyphVector</code>
244      * is used. The default implementation returns the visual bounds,
245      * offset to x, y and rounded out to the next integer value (i.e. returns an
246      * integer rectangle which encloses the visual bounds) and
247      * ignores the FRC. Subclassers should override this method.
248      * @param renderFRC the <code>FontRenderContext</code> of the <code>Graphics</code>.
249      * @param x the x-coordinate at which to render this <code>GlyphVector</code>.
250      * @param y the y-coordinate at which to render this <code>GlyphVector</code>.
251      * @return a <code>Rectangle</code> bounding the pixels that would be affected.
252      * @since 1.4
253      */

254     public Rectangle JavaDoc getPixelBounds(FontRenderContext JavaDoc renderFRC, float x, float y) {
255         Rectangle2D JavaDoc rect = getVisualBounds();
256         int l = (int)Math.floor(rect.getX() + x);
257         int t = (int)Math.floor(rect.getY() + y);
258         int r = (int)Math.ceil(rect.getMaxX() + x);
259         int b = (int)Math.ceil(rect.getMaxY() + y);
260         return new Rectangle JavaDoc(l, t, r - l, b - t);
261     }
262         
263
264     /**
265      * Returns a <code>Shape</code> whose interior corresponds to the
266      * visual representation of this <code>GlyphVector</code>.
267      * @return a <code>Shape</code> that is the outline of this
268      * <code>GlyphVector</code>.
269      */

270     public abstract Shape JavaDoc getOutline();
271
272     /**
273      * Returns a <code>Shape</code> whose interior corresponds to the
274      * visual representation of this <code>GlyphVector</code> when
275      * rendered at x,&nbsp;y.
276      * @param x,&nbsp;y the coordinates of this <code>GlyphVector</code>.
277      * @return a <code>Shape</code> that is the outline of this
278      * <code>GlyphVector</code> when rendered at the specified
279      * coordinates.
280      */

281     public abstract Shape JavaDoc getOutline(float x, float y);
282
283     /**
284      * Returns a <code>Shape</code> whose interior corresponds to the
285      * visual representation of the specified glyph
286      * within this <code>GlyphVector</code>.
287      * The outline returned by this method is positioned around the
288      * origin of each individual glyph.
289      * @param glyphIndex the index into this <code>GlyphVector</code>
290      * @return a <code>Shape</code> that is the outline of the glyph
291      * at the specified <code>glyphIndex</code> of this
292      * <code>GlyphVector</code>.
293      * @throws IndexOutOfBoundsException if <code>glyphIndex</code>
294      * is less than 0 or greater than or equal to the number
295      * of glyphs in this <code>GlyphVector</code>
296      */

297     public abstract Shape JavaDoc getGlyphOutline(int glyphIndex);
298
299     /**
300      * Returns a <code>Shape</code> whose interior corresponds to the
301      * visual representation of the specified glyph
302      * within this <code>GlyphVector</code>, offset to x,&nbsp;y.
303      * The outline returned by this method is positioned around the
304      * origin of each individual glyph.
305      * @param glyphIndex the index into this <code>GlyphVector</code>
306      * @param x,&nbsp;y the coordinates of the location of this
307      * <code>GlyphVector</code>.
308      * @return a <code>Shape</code> that is the outline of the glyph
309      * at the specified <code>glyphIndex</code> of this
310      * <code>GlyphVector</code> when rendered at the specified
311      * coordinates.
312      * @throws IndexOutOfBoundsException if <code>glyphIndex</code>
313      * is less than 0 or greater than or equal to the number
314      * of glyphs in this <code>GlyphVector</code>
315      * @since 1.4
316      */

317     public Shape JavaDoc getGlyphOutline(int glyphIndex, float x, float y) {
318     Shape JavaDoc s = getGlyphOutline(glyphIndex);
319     AffineTransform JavaDoc at = AffineTransform.getTranslateInstance(x,y);
320     return at.createTransformedShape(s);
321     }
322
323     /**
324      * Returns the position of the specified glyph relative to the
325      * origin of this <code>GlyphVector</code>.
326      * If <code>glyphIndex</code> equals the number of of glyphs in
327      * this <code>GlyphVector</code>, this method returns the position after
328      * the last glyph. This position is used to define the advance of
329      * the entire <code>GlyphVector</code>.
330      * @param glyphIndex the index into this <code>GlyphVector</code>
331      * @return a {@link Point2D} object that is the position of the glyph
332      * at the specified <code>glyphIndex</code>.
333      * @throws IndexOutOfBoundsException if <code>glyphIndex</code>
334      * is less than 0 or greater than the number of glyphs
335      * in this <code>GlyphVector</code>
336      * @see #setGlyphPosition
337      */

338     public abstract Point2D JavaDoc getGlyphPosition(int glyphIndex);
339
340     /**
341      * Sets the position of the specified glyph within this
342      * <code>GlyphVector</code>.
343      * If <code>glyphIndex</code> equals the number of of glyphs in
344      * this <code>GlyphVector</code>, this method sets the position after
345      * the last glyph. This position is used to define the advance of
346      * the entire <code>GlyphVector</code>.
347      * @param glyphIndex the index into this <code>GlyphVector</code>
348      * @param newPos the <code>Point2D</code> at which to position the
349      * glyph at the specified <code>glyphIndex</code>
350      * @throws IndexOutOfBoundsException if <code>glyphIndex</code>
351      * is less than 0 or greater than the number of glyphs
352      * in this <code>GlyphVector</code>
353      * @see #getGlyphPosition
354      */

355     public abstract void setGlyphPosition(int glyphIndex, Point2D JavaDoc newPos);
356
357     /**
358      * Returns the transform of the specified glyph within this
359      * <code>GlyphVector</code>. The transform is relative to the
360      * glyph position. If no special transform has been applied,
361      * <code>null</code> can be returned. A null return indicates
362      * an identity transform.
363      * @param glyphIndex the index into this <code>GlyphVector</code>
364      * @return an {@link AffineTransform} that is the transform of
365      * the glyph at the specified <code>glyphIndex</code>.
366      * @throws IndexOutOfBoundsException if <code>glyphIndex</code>
367      * is less than 0 or greater than or equal to the number
368      * of glyphs in this <code>GlyphVector</code>
369      * @see #setGlyphTransform
370      */

371     public abstract AffineTransform JavaDoc getGlyphTransform(int glyphIndex);
372
373     /**
374      * Sets the transform of the specified glyph within this
375      * <code>GlyphVector</code>. The transform is relative to the glyph
376      * position. A <code>null</code> argument for <code>newTX</code>
377      * indicates that no special transform is applied for the specified
378      * glyph.
379      * This method can be used to rotate, mirror, translate and scale the
380      * glyph. Adding a transform can result in signifant performance changes.
381      * @param glyphIndex the index into this <code>GlyphVector</code>
382      * @param newTX the new transform of the glyph at <code>glyphIndex</code>
383      * @throws IndexOutOfBoundsException if <code>glyphIndex</code>
384      * is less than 0 or greater than or equal to the number
385      * of glyphs in this <code>GlyphVector</code>
386      * @see #getGlyphTransform
387      */

388     public abstract void setGlyphTransform(int glyphIndex, AffineTransform JavaDoc newTX);
389
390     /**
391      * Returns flags describing the global state of the GlyphVector.
392      * Flags not described below are reserved. The default
393      * implementation returns 0 (meaning false) for the position adjustments,
394      * transforms, rtl, and complex flags.
395      * Subclassers should override this method, and make sure
396      * it correctly describes the GlyphVector and corresponds
397      * to the results of related calls.
398      * @return an int containing the flags describing the state
399      * @see #FLAG_HAS_POSITION_ADJUSTMENTS
400      * @see #FLAG_HAS_TRANSFORMS
401      * @see #FLAG_RUN_RTL
402      * @see #FLAG_COMPLEX_GLYPHS
403      * @see #FLAG_MASK
404      * @since 1.4
405      */

406     public int getLayoutFlags() {
407         return 0;
408     }
409
410     /**
411      * A flag used with getLayoutFlags that indicates that this <code>GlyphVector</code> has
412      * per-glyph transforms.
413      * @since 1.4
414      */

415     public static final int FLAG_HAS_TRANSFORMS = 1;
416     
417     /**
418      * A flag used with getLayoutFlags that indicates that this <code>GlyphVector</code> has
419      * position adjustments. When this is true, the glyph positions don't match the
420      * accumulated default advances of the glyphs (for example, if kerning has been done).
421      * @since 1.4
422      */

423     public static final int FLAG_HAS_POSITION_ADJUSTMENTS = 2;
424     
425     /**
426      * A flag used with getLayoutFlags that indicates that this <code>GlyphVector</code> has
427      * a right-to-left run direction. This refers to the glyph-to-char mapping and does
428      * not imply that the visual locations of the glyphs are necessarily in this order,
429      * although generally they will be.
430      * @since 1.4
431      */

432     public static final int FLAG_RUN_RTL = 4;
433
434     /**
435      * A flag used with getLayoutFlags that indicates that this <code>GlyphVector</code> has
436      * a complex glyph-to-char mapping (one that does not map glyphs to chars one-to-one in
437      * strictly ascending or descending order matching the run direction).
438      * @since 1.4
439      */

440     public static final int FLAG_COMPLEX_GLYPHS = 8;
441
442     /**
443      * A mask for supported flags from getLayoutFlags. Only bits covered by the mask
444      * should be tested.
445      * @since 1.4
446      */

447     public static final int FLAG_MASK =
448     FLAG_HAS_TRANSFORMS |
449     FLAG_HAS_POSITION_ADJUSTMENTS |
450     FLAG_RUN_RTL |
451     FLAG_COMPLEX_GLYPHS;
452
453     /**
454      * Returns an array of glyph positions for the specified glyphs.
455      * This method is used for convenience and performance when
456      * processing glyph positions.
457      * If no array is passed in, a new array is created.
458      * Even numbered array entries beginning with position zero are the X
459      * coordinates of the glyph numbered <code>beginGlyphIndex + position/2</code>.
460      * Odd numbered array entries beginning with position one are the Y
461      * coordinates of the glyph numbered <code>beginGlyphIndex + (position-1)/2</code>.
462      * If <code>beginGlyphIndex</code> equals the number of of glyphs in
463      * this <code>GlyphVector</code>, this method gets the position after
464      * the last glyph and this position is used to define the advance of
465      * the entire <code>GlyphVector</code>.
466      * @param beginGlyphIndex the index at which to begin retrieving
467      * glyph positions
468      * @param numEntries the number of glyphs to retrieve
469      * @param positionReturn the array that receives the glyph positions
470      * and is then returned.
471      * @return an array of glyph positions specified by
472      * <code>beginGlyphIndex</code> and <code>numEntries</code>.
473      * @throws IllegalArgumentException if <code>numEntries</code> is
474      * less than 0
475      * @throws IndexOutOfBoundsException if <code>beginGlyphIndex</code>
476      * is less than 0
477      * @throws IndexOutOfBoundsException if the sum of
478      * <code>beginGlyphIndex</code> and <code>numEntries</code>
479      * is greater than the number of glyphs in this
480      * <code>GlyphVector</code> plus one
481      */

482     public abstract float[] getGlyphPositions(int beginGlyphIndex, int numEntries,
483                                               float[] positionReturn);
484
485     /**
486      * Returns the logical bounds of the specified glyph within this
487      * <code>GlyphVector</code>.
488      * These logical bounds have a total of four edges, with two edges
489      * parallel to the baseline under the glyph's transform and the other two
490      * edges are shared with adjacent glyphs if they are present. This
491      * method is useful for hit-testing of the specified glyph,
492      * positioning of a caret at the leading or trailing edge of a glyph,
493      * and for drawing a highlight region around the specified glyph.
494      * @param glyphIndex the index into this <code>GlyphVector</code>
495      * that corresponds to the glyph from which to retrieve its logical
496      * bounds
497      * @return a <code>Shape</code> that is the logical bounds of the
498      * glyph at the specified <code>glyphIndex</code>.
499      * @throws IndexOutOfBoundsException if <code>glyphIndex</code>
500      * is less than 0 or greater than or equal to the number
501      * of glyphs in this <code>GlyphVector</code>
502      * @see #getGlyphVisualBounds
503      */

504     public abstract Shape JavaDoc getGlyphLogicalBounds(int glyphIndex);
505
506     /**
507      * Returns the visual bounds of the specified glyph within the
508      * <code>GlyphVector</code>.
509      * The bounds returned by this method is positioned around the
510      * origin of each individual glyph.
511      * @param glyphIndex the index into this <code>GlyphVector</code>
512      * that corresponds to the glyph from which to retrieve its visual
513      * bounds
514      * @return a <code>Shape</code> that is the visual bounds of the
515      * glyph at the specified <code>glyphIndex</code>.
516      * @throws IndexOutOfBoundsException if <code>glyphIndex</code>
517      * is less than 0 or greater than or equal to the number
518      * of glyphs in this <code>GlyphVector</code>
519      * @see #getGlyphLogicalBounds
520      */

521     public abstract Shape JavaDoc getGlyphVisualBounds(int glyphIndex);
522
523     /**
524      * Returns the pixel bounds of the glyph at index when this
525      * <code>GlyphVector</code> is rendered in a <code>Graphics</code> with the
526      * given <code>FontRenderContext</code> at the given location. The
527      * renderFRC need not be the same as the
528      * <code>FontRenderContext</code> of this
529      * <code>GlyphVector</code>, and can be null. If it is null, the
530      * <code>FontRenderContext</code> of this <code>GlyphVector</code>
531      * is used. The default implementation returns the visual bounds of the glyph,
532      * offset to x, y and rounded out to the next integer value, and
533      * ignores the FRC. Subclassers should override this method.
534      * @param index the index of the glyph.
535      * @param renderFRC the <code>FontRenderContext</code> of the <code>Graphics</code>.
536      * @param x,&nbsp;y the position at which to render this <code>GlyphVector</code>.
537      * @return a <code>Rectangle</code> bounding the pixels that would be affected.
538      * @since 1.4
539      */

540     public Rectangle JavaDoc getGlyphPixelBounds(int index, FontRenderContext JavaDoc renderFRC, float x, float y) {
541         Rectangle2D JavaDoc rect = getGlyphVisualBounds(index).getBounds2D();
542         int l = (int)Math.floor(rect.getX() + x);
543         int t = (int)Math.floor(rect.getY() + y);
544         int r = (int)Math.ceil(rect.getMaxX() + x);
545         int b = (int)Math.ceil(rect.getMaxY() + y);
546         return new Rectangle JavaDoc(l, t, r - l, b - t);
547     }
548
549     /**
550      * Returns the metrics of the glyph at the specified index into
551      * this <code>GlyphVector</code>.
552      * @param glyphIndex the index into this <code>GlyphVector</code>
553      * that corresponds to the glyph from which to retrieve its metrics
554      * @return a {@link GlyphMetrics} object that represents the
555      * metrics of the glyph at the specified <code>glyphIndex</code>
556      * into this <code>GlyphVector</code>.
557      * @throws IndexOutOfBoundsException if <code>glyphIndex</code>
558      * is less than 0 or greater than or equal to the number
559      * of glyphs in this <code>GlyphVector</code>
560      */

561     public abstract GlyphMetrics JavaDoc getGlyphMetrics(int glyphIndex);
562
563     /**
564      * Returns the justification information for the glyph at
565      * the specified index into this <code>GlyphVector</code>.
566      * @param glyphIndex the index into this <code>GlyphVector</code>
567      * that corresponds to the glyph from which to retrieve its
568      * justification properties
569      * @return a {@link GlyphJustificationInfo} object that
570      * represents the justification properties of the glyph at the
571      * specified <code>glyphIndex</code> into this
572      * <code>GlyphVector</code>.
573      * @throws IndexOutOfBoundsException if <code>glyphIndex</code>
574      * is less than 0 or greater than or equal to the number
575      * of glyphs in this <code>GlyphVector</code>
576      */

577     public abstract GlyphJustificationInfo JavaDoc getGlyphJustificationInfo(int glyphIndex);
578
579     //
580
// general utility methods
581
//
582

583     /**
584      * Tests if the specified <code>GlyphVector</code> exactly
585      * equals this <code>GlyphVector</code>.
586      * @param set the specified <code>GlyphVector</code> to test
587      * @return <code>true</code> if the specified
588      * <code>GlyphVector</code> equals this <code>GlyphVector</code>;
589      * <code>false</code> otherwise.
590      */

591     public abstract boolean equals(GlyphVector JavaDoc set);
592 }
593
Popular Tags