Displaying Text
Java's Graphics class provides seven methods related to displaying text. Before plunging into the various aspects of drawing text, however, you should be familiar with the following common terms for fonts and text:
Baseline— The imaginary line that the text rests on.
Descent— The distance below the baseline that a particular character extends. The letters g and j, for example, extend below the baseline.
Ascent— The distance above the baseline that a particular character extends. For example, the letter d has a higher ascent than the letter x.
Leading— The space between a line of text's lowest descent and the following line of text's highest ascent. Without leading, the letters g and j would touch the letters M and h on the next line. ...
Get Platinum Edition Using XHTML™, XML, and Java™ 2 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.