This section illustrates you how to outline the font.
By outlining the font , we make the characters more stylish and impressive. We are providing you an example which outlines the text. The Font class represents fonts to render text in a visible way. The class FontRenderContext measures the text specified.
Following code defines the font:
| Font font = new Font("Monotype Corsiva", 2, 50); |
To give the graphical representation of styled character data, we have used the class TextLayout. The class AffineTransform provides the properties like translation, shearing, scaling, and rotation. The getBounds() method provides the boundaries displayed on the design surface. The method setClip(shape) sets the clipping of text specified as shape.
Following code outlines the string specified:
| Shape shape = text.getOutline(null); |
Here is the code of FontOutline.java
import java.awt.*;
|
Output will be displayed as:

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.
Ask Questions? Discuss: Outlining the font
Post your Comment