|
Spec-Zone .ru
спецификации, руководства, описания, API
|
This section introduces you to the
Font class, which supports the specification of detailed font information and the use of sophisticated typographic features.
A object represents an instance of a font face from the collection of font faces available on the system. Examples of common font faces include Helvetica Bold and Courier Bold Italic. Three names are associated with a object: its logical name, family name, and font face name:
A
object's logical name is a name mapped onto a physical font, which is one of the specific fonts available on the system. When specifying a
in Java, use the font face name instead of the logical name. You can get the logical name from the Font by calling the
method. To get a list of the logical names that are mapped onto the specific fonts available on a system, call the
method.
See Physical and Logical Fonts for more information.
A object's family name is the name of the font family that determines the typographic design across several faces, such as Helvetica. Retrieve the family name through the method.
A object's font face name refers to an actual font installed on a system. This is the name you should use when specifying a font. It's often referred to as just the font name. Retrieve the font name by calling . To determine which font faces are available on the system, call the method.
You can access information about a through the method. A objects's attributes include its name, size, transform, and font features such as weight and posture.
A object encapsulates the measurement information associated with a , such as its ascent, descent, and leading:
The following figure shows the position of the ascender line, baseline, and descender line:

This information is used to properly position characters along a line, and to position lines relative to one another.
You can access these line metrics through the
,
, and
methods. You can also access information about a
objects's height, baseline, and underline and strikethrough characteristics through the LineMetrics class.