Font (String name,int style,int size)
Creates a new Font based on the specified name, style, and point size.
The font name can be a font appearance name or a font family name. It is used with styles to find the right font appearance. If a font family name is specified, the style parameter is used to select the most appropriate appearance from the series. If you specify a font appearance name, merge the style and style parameters of the appearance to find the most matching font from the same series. For example, if you specify the skin name "Arial Bold" and the style font.italic, the font system looks in the Arial series for both bold and italic, and you can associate the font instance with the physical font appearance, "Arial Bold Italic." Merges a style parameter with the style of the specified skin, rather than performing an add or subtract operation. This means that specifying bold and bold styles does not double the bold font, and specifying bold and normal styles does not change the font.
If you cannot find the appearance of the required style, the font system can apply a style design algorithm to get the style you want. For example, if Italic is required, but there is no italic appearance available, you can skew the normal look by using an algorithm.
Font name lookup is case-sensitive, and you can use the capitalization conversion rules for the US locale. Parameters:
Name-font names. This can be the font skin name or font family name, and can represent the logical or physical font found in this graphicsenvironment. The series names for logical fonts are: Dialog, Dialoginput, monospaced, Serif, or Sansserif. If name is null, the logical font name for the new font (returned by GetName () is set to "Default").
The Style-font style constant. A style parameter is an integer bitmask that can be PLAIN, or a bitwise of BOLD and Italic, or (for example, italic or bold| Italic). If the style parameter does not conform to any one of the expected integer bitmask, the style is set to PLAIN.
Size-font point size//Get all fonts in the system
string[] FontNames = Graphicsenvironment.getlocalgraphicsenvironment (). Getavailablefontfamilynames ();
for (int i=0;i<fontnames.length;i++)
System.out.print (fontnames[i]+ "");