|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sibvisions.rad.ui.awt.impl.AwtResource<Font>
com.sibvisions.rad.ui.awt.impl.AwtFont
public class AwtFont
The AwtFont
class represents fonts, which are used to
render text in a visible way.
Field Summary |
---|
Fields inherited from class com.sibvisions.rad.ui.awt.impl.AwtResource |
---|
resource |
Fields inherited from interface javax.rad.ui.IFont |
---|
BOLD, DIALOG, DIALOG_INPUT, ITALIC, MONOSPACED, PLAIN, SANS_SERIF, SERIF |
Constructor Summary | |
---|---|
AwtFont(Font pFont)
Creates an instance of AwtFont based on
a java.awt.Font . |
|
AwtFont(String pName,
int pStyle,
int pSize)
Creates an instance of AwtFont from the specified name,
style and point size. |
Method Summary | |
---|---|
String |
getFamily()
Returns the family name of this IFont . |
String |
getFontName()
Returns the font face name of this IFont . |
String |
getName()
Returns the logical name of this IFont . |
int |
getSize()
Returns the point size of this IFont , rounded to
an integer. |
int |
getStyle()
Returns the style of this IFont . |
Methods inherited from class com.sibvisions.rad.ui.awt.impl.AwtResource |
---|
equals, getResource, hashCode, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface javax.rad.ui.IResource |
---|
getResource |
Constructor Detail |
---|
public AwtFont(Font pFont)
AwtFont
based on
a java.awt.Font
.
pFont
- java.awt.FontFont
public AwtFont(String pName, int pStyle, int pSize)
AwtFont
from the specified name,
style and point size.
pName
- name the font name. This can be a font face name or a font
family name, and may represent either a logical font or a physical
font found in this GraphicsEnvironment
.
The family names for logical fonts are: Dialog, DialogInput,
Monospaced, Serif, or SansSerif. If name
is
null
, the logical font name of the new
AwtFont
as returned by getName()
is set to
the name "Default".pStyle
- the style constant for the AwtFont
The style argument is an integer bitmask that may
be PLAIN, or a bitwise union of BOLD and/or ITALIC
(for example, ITALIC or BOLD|ITALIC).
If the style argument does not conform to one of the expected
integer bitmasks then the style is set to PLAIN.pSize
- the point size of the AwtFont
Method Detail |
---|
public String getFamily()
IFont
.
The family name of a font is font specific. Two fonts such as
Helvetica Italic and Helvetica Bold have the same family name,
Helvetica, whereas their font face names are
Helvetica Bold and Helvetica Italic. The list of
available family names may be obtained by using the
GraphicsEnvironment.getAvailableFontFamilyNames()
method.
Use getName
to get the logical name of the font.
Use getFontName
to get the font face name of the font.
getFamily
in interface IFont
String
that is the family name of this
IFont
.IFont.getName()
,
IFont.getFontName()
public String getFontName()
IFont
. For example,
Helvetica Bold could be returned as a font face name.
Use getFamily
to get the family name of the font.
Use getName
to get the logical name of the font.
getFontName
in interface IFont
String
representing the font face name of
this IFont
.IFont.getFamily()
,
IFont.getName()
public String getName()
IFont
.
Use getFamily
to get the family name of the font.
Use getFontName
to get the font face name of the font.
getName
in interface IFont
String
representing the logical name of
this IFont
.IFont.getFamily()
,
IFont.getFontName()
public int getSize()
IFont
, rounded to
an integer.
Most users are familiar with the idea of using point size to
specify the size of glyphs in a font. This point size defines a
measurement between the baseline of one line to the baseline of the
following line in a single spaced text document. The point size is
based on typographic points, approximately 1/72 of an inch.
The Java(tm)2D API adopts the convention that one point is equivalent to one unit in user coordinates. When using a normalized transform for converting user space coordinates to device space coordinates 72 user space units equal 1 inch in device space. In this case one point is 1/72 of an inch.
getSize
in interface IFont
IFont
in 1/72 of an
inch units.public int getStyle()
IFont
. The style can be
PLAIN, BOLD, ITALIC, or BOLD+ITALIC.
getStyle
in interface IFont
IFont
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |