The font class is located in Java. AWT
The font type is determined by three attributes:
1) font name (family name)
The name can be divided into two categories:
Chinese fonts:,, and;
English Font: Arial, Times New Roman, etc;
TIPS:
There are two terms for English fonts: "equal width font" and "widening font". An equal width font indicates the width of each English letter. Otherwise, the width of M and L is different.
2) Size)
The same as the font name, the size can be measured in two ways: Number 5 and number 6, the smaller the number, the larger the number, and the pound value (this is a general unit in the printing industry ), for example, 11 or 12 lbs. The larger the value, the larger the word. HoweverJavaOnly the latter, that is, point ).
3) style)
JavaThere are four typesFont Style,FontClass static value.
○Font.Plain(Normal)
○Font.Bold(Bold)
○Font.Italic(Italic)
○Font.Bold+Font.Italic(Bold and italic)
That is to say, inJavaThe language does not support the underline style.
The font class constructor constructs a font object:
PublicFont(String familyname, int style, int size)
Then, call the setfont method of the object to set the font:
Public void setfont (Font Font)