org.apache.batik.gvt.font
Class AWTGVTFont

java.lang.Object
  |
  +--org.apache.batik.gvt.font.AWTGVTFont
All Implemented Interfaces:
GVTFont

public final class AWTGVTFont
extends java.lang.Object
implements GVTFont

This is a wrapper class for a java.awt.Font instance.


Constructor Summary
AWTGVTFont(java.awt.Font font)
          Creates a new AWTGVTFont that wraps the given Font.
AWTGVTFont(java.util.Map attributes)
          Creates a new AWTGVTFont with the specified attributes.
AWTGVTFont(java.lang.String name, int style, int size)
          Creates a new AWTGVTFont from the specified name, style and point size.
 
Method Summary
 boolean canDisplay(char c)
          Checks if this Font has a glyph for the specified character.
 int canDisplayUpTo(char[] text, int start, int limit)
          Indicates whether or not this Font can display the characters in the specified text starting at start and ending at limit.
 int canDisplayUpTo(java.text.CharacterIterator iter, int start, int limit)
          Indicates whether or not this Font can display the the characters in the specified CharacterIterator starting at start and ending at limit.
 int canDisplayUpTo(java.lang.String str)
          Indicates whether or not this Font can display a specified String.
 GVTGlyphVector createGlyphVector(java.awt.font.FontRenderContext frc, char[] chars)
          Returns a new GlyphVector object created with the specified array of characters and the specified FontRenderContext.
 GVTGlyphVector createGlyphVector(java.awt.font.FontRenderContext frc, java.text.CharacterIterator ci)
          Returns a new GlyphVector object created with the specified CharacterIterator and the specified FontRenderContext.
 GVTGlyphVector createGlyphVector(java.awt.font.FontRenderContext frc, int[] glyphCodes)
          Returns a new GlyphVector object created with the specified integer array and the specified FontRenderContext.
 GVTGlyphVector createGlyphVector(java.awt.font.FontRenderContext frc, java.lang.String str)
          Returns a new GlyphVector object created with the specified String and the specified FontRenderContext.
 GVTFont deriveFont(float size)
          Creates a new Font object by replicating the current Font object and applying a new size to it.
 float getKerning(java.lang.String unicode1, java.lang.String unicode2)
          Returns the kerning value of this character pair.
 GVTLineMetrics getLineMetrics(char[] chars, int beginIndex, int limit, java.awt.font.FontRenderContext frc)
          Returns a LineMetrics object created with the specified arguments.
 GVTLineMetrics getLineMetrics(java.text.CharacterIterator ci, int beginIndex, int limit, java.awt.font.FontRenderContext frc)
          Returns a GVTLineMetrics object created with the specified arguments.
 GVTLineMetrics getLineMetrics(java.lang.String str, java.awt.font.FontRenderContext frc)
          Returns a GVTLineMetrics object created with the specified String and FontRenderContext.
 GVTLineMetrics getLineMetrics(java.lang.String str, int beginIndex, int limit, java.awt.font.FontRenderContext frc)
          Returns a GVTLineMetrics object created with the specified arguments.
 float getSize()
          Returns the size of this font.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AWTGVTFont

public AWTGVTFont(java.awt.Font font)
Creates a new AWTGVTFont that wraps the given Font.

AWTGVTFont

public AWTGVTFont(java.util.Map attributes)
Creates a new AWTGVTFont with the specified attributes.

AWTGVTFont

public AWTGVTFont(java.lang.String name,
                  int style,
                  int size)
Creates a new AWTGVTFont from the specified name, style and point size.
Method Detail

canDisplay

public boolean canDisplay(char c)
Checks if this Font has a glyph for the specified character.
Specified by:
canDisplay in interface GVTFont

canDisplayUpTo

public int canDisplayUpTo(char[] text,
                          int start,
                          int limit)
Indicates whether or not this Font can display the characters in the specified text starting at start and ending at limit.
Specified by:
canDisplayUpTo in interface GVTFont

canDisplayUpTo

public int canDisplayUpTo(java.text.CharacterIterator iter,
                          int start,
                          int limit)
Indicates whether or not this Font can display the the characters in the specified CharacterIterator starting at start and ending at limit.
Specified by:
canDisplayUpTo in interface GVTFont

canDisplayUpTo

public int canDisplayUpTo(java.lang.String str)
Indicates whether or not this Font can display a specified String.
Specified by:
canDisplayUpTo in interface GVTFont

createGlyphVector

public GVTGlyphVector createGlyphVector(java.awt.font.FontRenderContext frc,
                                        char[] chars)
Returns a new GlyphVector object created with the specified array of characters and the specified FontRenderContext.
Specified by:
createGlyphVector in interface GVTFont

createGlyphVector

public GVTGlyphVector createGlyphVector(java.awt.font.FontRenderContext frc,
                                        java.text.CharacterIterator ci)
Returns a new GlyphVector object created with the specified CharacterIterator and the specified FontRenderContext.
Specified by:
createGlyphVector in interface GVTFont

createGlyphVector

public GVTGlyphVector createGlyphVector(java.awt.font.FontRenderContext frc,
                                        int[] glyphCodes)
Returns a new GlyphVector object created with the specified integer array and the specified FontRenderContext.
Specified by:
createGlyphVector in interface GVTFont

createGlyphVector

public GVTGlyphVector createGlyphVector(java.awt.font.FontRenderContext frc,
                                        java.lang.String str)
Returns a new GlyphVector object created with the specified String and the specified FontRenderContext.
Specified by:
createGlyphVector in interface GVTFont

deriveFont

public GVTFont deriveFont(float size)
Creates a new Font object by replicating the current Font object and applying a new size to it.
Specified by:
deriveFont in interface GVTFont

getLineMetrics

public GVTLineMetrics getLineMetrics(char[] chars,
                                     int beginIndex,
                                     int limit,
                                     java.awt.font.FontRenderContext frc)
Returns a LineMetrics object created with the specified arguments.
Specified by:
getLineMetrics in interface GVTFont

getLineMetrics

public GVTLineMetrics getLineMetrics(java.text.CharacterIterator ci,
                                     int beginIndex,
                                     int limit,
                                     java.awt.font.FontRenderContext frc)
Returns a GVTLineMetrics object created with the specified arguments.
Specified by:
getLineMetrics in interface GVTFont

getLineMetrics

public GVTLineMetrics getLineMetrics(java.lang.String str,
                                     java.awt.font.FontRenderContext frc)
Returns a GVTLineMetrics object created with the specified String and FontRenderContext.
Specified by:
getLineMetrics in interface GVTFont

getLineMetrics

public GVTLineMetrics getLineMetrics(java.lang.String str,
                                     int beginIndex,
                                     int limit,
                                     java.awt.font.FontRenderContext frc)
Returns a GVTLineMetrics object created with the specified arguments.
Specified by:
getLineMetrics in interface GVTFont

getSize

public float getSize()
Returns the size of this font.
Specified by:
getSize in interface GVTFont

getKerning

public float getKerning(java.lang.String unicode1,
                        java.lang.String unicode2)
Returns the kerning value of this character pair.
Specified by:
getKerning in interface GVTFont

toString

public java.lang.String toString()
Specified by:
toString in interface GVTFont
Overrides:
toString in class java.lang.Object


Copyright © 2001 Apache Software Foundation. All Rights Reserved.