home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &n…he Search for Life DVD 2 / DVD-ROM.iso / install / jre1_3 / lib / rt.jar / java / awt / font / GlyphMetrics.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  1.3 KB  |  62 lines

  1. package java.awt.font;
  2.  
  3. import java.awt.geom.Rectangle2D;
  4.  
  5. public final class GlyphMetrics {
  6.    private float advance;
  7.    private Rectangle2D.Float bounds;
  8.    private byte glyphType;
  9.    public static final byte STANDARD = 0;
  10.    public static final byte LIGATURE = 1;
  11.    public static final byte COMBINING = 2;
  12.    public static final byte COMPONENT = 3;
  13.    public static final byte WHITESPACE = 4;
  14.  
  15.    public GlyphMetrics(float var1, Rectangle2D var2, byte var3) {
  16.       this.advance = var1;
  17.       this.bounds = new Rectangle2D.Float();
  18.       this.bounds.setRect(var2);
  19.       this.glyphType = var3;
  20.    }
  21.  
  22.    public float getAdvance() {
  23.       return this.advance;
  24.    }
  25.  
  26.    public Rectangle2D getBounds2D() {
  27.       return new Rectangle2D.Float(this.bounds.x, this.bounds.y, this.bounds.width, this.bounds.height);
  28.    }
  29.  
  30.    public float getLSB() {
  31.       return this.bounds.x;
  32.    }
  33.  
  34.    public float getRSB() {
  35.       return this.advance - this.bounds.x - this.bounds.width;
  36.    }
  37.  
  38.    public int getType() {
  39.       return this.glyphType;
  40.    }
  41.  
  42.    public boolean isStandard() {
  43.       return (this.glyphType & 3) == 0;
  44.    }
  45.  
  46.    public boolean isLigature() {
  47.       return (this.glyphType & 3) == 1;
  48.    }
  49.  
  50.    public boolean isCombining() {
  51.       return (this.glyphType & 3) == 2;
  52.    }
  53.  
  54.    public boolean isComponent() {
  55.       return (this.glyphType & 3) == 3;
  56.    }
  57.  
  58.    public boolean isWhitespace() {
  59.       return (this.glyphType & 4) == 4;
  60.    }
  61. }
  62.