The JavaTM Tutorial

| Start of Tutorial > Start of Trail | Search Feedback Form

Trail: 2D Graphics

## Lesson: Working with Text and Fonts

> This lesson shows you how to determine what fonts are available on your system, create fonts with particular attributes, derive new fonts by modifying the attributes of an existing font, and position multi-line text within a component.

> These topics are discussed in the following sections:

### Creating and Deriving Fonts

> This section illustrates how to use the `GraphicsEnvironment` to determine what fonts are available on your system, how to create a `Font` object and to how to change the font attributes of a text string.

### Drawing Multiple Lines of Text

> This section shows you how to position and render a paragraph of styled text using `TextLayout` and `LineBreakMeasurer`.

| Start of Tutorial > Start of Trail | Search Feedback Form

Copyright 1995-2004 Sun Microsystems, Inc. All rights reserved.