KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > swingwt > awt > font > LineMetrics


1 /*
2    SwingWT
3    Copyright(c)2003-2004, R. Rawson-Tetley
4
5    For more information on distributing and using this program, please
6    see the accompanying "COPYING" file.
7
8    Contact me by electronic mail: bobintetley@users.sourceforge.net
9
10    $Log: LineMetrics.java,v $
11    Revision 1.1 2004/01/15 15:20:29 bobintetley
12    Java2D work
13
14
15 */

16
17 package swingwt.awt.font;
18     
19 public class LineMetrics {
20
21     private int numChars = 0;
22     private float ascent = 0;
23     private float descent = 0;
24     private float leading = 0;
25     private float height = 0;
26     private int baselineindex = 0;
27     private float[] baselineoffsets = null;
28     private float strikethroughoffset = 0;
29     private float strikethroughthickness = 1;
30     private float underlineoffset = 1;
31     private float underlinethickness = 1;
32     
33     public LineMetrics(int numChars, int height) { this.numChars = numChars; this.height = height; strikethroughoffset = height / 2; }
34     
35     public int getNumChars() { return numChars; }
36     public float getAscent() { return ascent; }
37     public float getDescent() { return descent; }
38     public float getLeading() { return leading; }
39     public float getHeight() { return height; }
40     public int getBaselineIndex() { return baselineindex; }
41     public float[] getBaselineOffsets() { return baselineoffsets; }
42     public float getStrikethroughOffset() { return strikethroughoffset; }
43     public float getStrikethroughThickness() { return strikethroughthickness; }
44     public float getUnderlineOffset() { return underlineoffset; }
45     public float getUnderlineThickness() { return underlinethickness; }
46 }
47
Popular Tags