FileDocCategorySizeDatePackage
Glyph.javaAPI DocAndroid 1.5 API5981Wed May 06 22:41:54 BST 2009org.apache.harmony.awt.gl.font

Glyph

public abstract class Glyph extends Object
author
Ilya S. Okomin
version
$Revision$

Fields Summary
char
glChar
GlyphMetrics
glMetrics
GlyphMetrics
glPointMetrics
int
glCode
GlyphJustificationInfo
glJustInfo
long
pFont
int
fontSize
byte[]
bitmap
BufferedImage
image
Shape
glOutline
public int
bmp_top
image bitmap parameters
public int
bmp_left
public int
bmp_pitch
public int
bmp_rows
public int
bmp_width
Constructors Summary
Methods Summary
public booleanequals(java.lang.Object obj)
Returns true if this Glyph and specified object are equal.

         if (obj == this) {
            return true;
        }

        if (obj != null) {
          try {
            Glyph gl = (Glyph)obj;

            return  ((this.getChar() == gl.getChar())
              && (this.getGlyphMetrics().equals(gl.getGlyphMetrics()))
              && (this.getGlyphCode() == gl.getGlyphCode()));
          } catch (ClassCastException e) {
          }
        }

        return false;
    
public int[]getABC()
Returns an int array of 3 elements, so-called ABC structure that contains the width of the character: 1st element = left side bearing of the glyph 2nd element = width of the glyph 3d element = right side bearing of the glyph

        int[] abc = new int[3];
        abc[0] = (int)glMetrics.getLSB();
        abc[1] = (int)glMetrics.getBounds2D().getWidth();
        abc[2] = (int)glMetrics.getRSB();

        return abc;
    
public abstract byte[]getBitmap()
Returns array of bytes, representing image of this glyph

public chargetChar()
Retruns char value of this glyph object

        return glChar;
    
public intgetGlyphCode()
Retruns glyph code of this glyph object

        return glCode;
    
public java.awt.font.GlyphJustificationInfogetGlyphJustificationInfo()
Retruns GlyphJustificationInfo of this glyph object

        return glJustInfo;
    
public java.awt.font.GlyphMetricsgetGlyphMetrics()
Retruns GlyphMetrics of this glyph object with precise metrics.

        return glMetrics;
    
public java.awt.font.GlyphMetricsgetGlyphPointMetrics()
Retruns GlyphMetrics of this glyph object in pixels.

        return glPointMetrics;
    
public intgetHeight()
Retruns precise height of this glyph object

        return Math.round((float)glMetrics.getBounds2D().getHeight());
    
public java.awt.image.BufferedImagegetImage()
Sets BufferedImage representation of this glyph.

        //!! Implementation classes must override this method
        return null;
    
public longgetPFont()
Retruns handle to Native Font object


                
      
        return this.pFont;
    
public intgetPointHeight()
Returns height of the glyph in points.

        return (int)glPointMetrics.getBounds2D().getHeight();
    
public intgetPointWidth()
Returns width of the glyph in points.

        return (int)glPointMetrics.getBounds2D().getWidth();
    
public java.awt.ShapegetShape()

        if (glOutline == null){
            glOutline = initOutline(this.glChar);
        }
        return glOutline;
    
public intgetWidth()
Retruns precise width of this glyph object

        return Math.round((float)glMetrics.getBounds2D().getWidth());
    
public abstract java.awt.ShapeinitOutline(char c)
Returns shape that represents outline of the specified character.

param
c specified character

public voidsetGlyphJustificationInfo(java.awt.font.GlyphJustificationInfo newJustInfo)
Sets JustificationInfo of this glyph object

param
newJustInfo GlyphJustificationInfo object to set to the Glyph object

        this.glJustInfo = newJustInfo;
    
public voidsetImage(java.awt.image.BufferedImage newImage)
Sets BufferedImage representation of this glyph to the specified parameter.

param
newImage new BufferedImage object to be set as BufferedImage representation.

        this.image = newImage;