The Java Tutorials have been written for JDK 8.Java教程是为JDK 8编写的。Examples and practices described in this page don't take advantage of improvements introduced in later releases and might use technology no longer available.本页中描述的示例和实践没有利用后续版本中引入的改进,并且可能使用不再可用的技术。See Java Language Changes for a summary of updated language features in Java SE 9 and subsequent releases.有关Java SE 9及其后续版本中更新的语言特性的摘要,请参阅Java语言更改。
See JDK Release Notes for information about new features, enhancements, and removed or deprecated options for all JDK releases.有关所有JDK版本的新功能、增强功能以及已删除或不推荐的选项的信息,请参阅JDK发行说明。
This lesson introduces you to the concept of working with text API's to apply text rendering capabilities.本课程向您介绍使用文本API应用文本呈现功能的概念。Already in this trail, you have used basic Java 2D text APIs and know how to set a font and position, and how to draw text.在本教程中,您已经使用了基本的Java2D文本API,并且知道如何设置字体和位置,以及如何绘制文本。
This lesson expands on that material to help you develop an understanding of how to use those APIs and moves further into the capabilities of Java 2D text display.本课程将对这些内容进行扩展,以帮助您了解如何使用这些API,并进一步了解Java 2D文本显示的功能。
These topics are discussed in the following sections.以下各节将讨论这些主题。
Font
class to determine which fonts are available on your system, to create a Font
object, and obtain information about a font family.Font
类的方法来确定系统上可用的字体、创建Font
对象以及获取有关字体系列的信息。FontMetrics
class.FontMetrics
类的实例正确测量文本。