1 |
/* Font.java -- Font object |
/* Font.java -- Font object |
2 |
Copyright (C) 1999 Free Software Foundation, Inc. |
Copyright (C) 1999, 2002 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
5 |
|
|
34 |
* This class represents a windowing system font. |
* This class represents a windowing system font. |
35 |
* |
* |
36 |
* @author Aaron M. Renn (arenn@urbanophile.com) |
* @author Aaron M. Renn (arenn@urbanophile.com) |
37 |
|
* @author Warren Levy <warrenl@cygnus.com> |
38 |
*/ |
*/ |
39 |
public class Font implements java.io.Serializable |
public class Font implements java.io.Serializable |
40 |
{ |
{ |
58 |
*/ |
*/ |
59 |
public static final int ITALIC = 2; |
public static final int ITALIC = 2; |
60 |
|
|
61 |
|
public static final int ROMAN_BASELINE = 0; |
62 |
|
public static final int CENTER_BASELINE = 1; |
63 |
|
public static final int HANGING_BASELINE = 2; |
64 |
|
|
65 |
// Serialization constant |
// Serialization constant |
66 |
private static final long serialVersionUID = -4206021311591459213L; |
private static final long serialVersionUID = -4206021311591459213L; |
67 |
|
|
87 |
*/ |
*/ |
88 |
protected int size; |
protected int size; |
89 |
|
|
90 |
|
protected float pointSize; |
91 |
|
|
92 |
// The native peer for this font |
// The native peer for this font |
93 |
private FontPeer peer; |
private FontPeer peer; |
94 |
|
|
211 |
* @param style The font style. |
* @param style The font style. |
212 |
* @param size The font point size. |
* @param size The font point size. |
213 |
*/ |
*/ |
214 |
public |
public |
215 |
Font(String name, int style, int size) |
Font(String name, int style, int size) |
216 |
{ |
{ |
217 |
this.name = name; |
this.name = name; |
218 |
this.style = style; |
this.style = style; |
219 |
this.size = size; |
this.size = size; |
220 |
|
this.pointSize = size; |
221 |
} |
} |
222 |
|
|
223 |
/*************************************************************************/ |
/*************************************************************************/ |
250 |
return(size); |
return(size); |
251 |
} |
} |
252 |
|
|
253 |
|
public float |
254 |
|
getSize2D() |
255 |
|
{ |
256 |
|
return pointSize; |
257 |
|
} |
258 |
|
|
259 |
/*************************************************************************/ |
/*************************************************************************/ |
260 |
|
|
261 |
/** |
/** |
322 |
return(name); |
return(name); |
323 |
} |
} |
324 |
|
|
325 |
|
public int |
326 |
|
getStyle() |
327 |
|
{ |
328 |
|
return style; |
329 |
|
} |
330 |
|
|
331 |
/*************************************************************************/ |
/*************************************************************************/ |
332 |
|
|
333 |
/** |
/** |