• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

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 is the imaginary line that the text rests on.

  • Descent is the distance below the baseline that a particular character extends. The letters g and j, for instance, extend below the baseline.

  • Ascent is the distance above the baseline that a particular character extends. For instance, the letter d has a higher ascent than the letter x.

  • Leading is 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.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint