font.html
来自「API資料大全」· HTML 代码 · 共 1,479 行 · 第 1/5 页
HTML
1,479 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc on Thu Apr 27 23:32:33 PDT 2000 --><TITLE>Java 2 Platform SE v1.3: Class Font</TITLE><LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style"></HEAD><BODY BGCOLOR="white"><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Font.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup> 2 Platform<br>Std. Ed. v1.3</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../java/awt/FlowLayout.html"><B>PREV CLASS</B></A> <A HREF="../../java/awt/FontMetrics.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="Font.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">java.awt</FONT><BR>Class Font</H2><PRE><A HREF="../../java/lang/Object.html">java.lang.Object</A> | +--<B>java.awt.Font</B></PRE><DL><DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../java/io/Serializable.html">Serializable</A></DD></DL><DL><DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../javax/swing/plaf/FontUIResource.html">FontUIResource</A></DD></DL><HR><DL><DT>public class <B>Font</B><DT>extends <A HREF="../../java/lang/Object.html">Object</A><DT>implements <A HREF="../../java/io/Serializable.html">Serializable</A></DL><P>The <code>Font</code> class represents fonts. The capabilities of this class have been extended over the java.awt.Font class in JDK(tm) 1.1 and earlier releases to provide for developers the ability to utilize more sophisticated typographic features. <p> It is important to present the concepts behind using the words character and glyph separately. A <b>character</b> is a symbol that represents items like letters and numbers in a particular writing system. For example, <i>lowercase-g</i> is a character. When a particular character has been rendered, a shape now represents this character. This shape is called a <b>glyph</b>. <p> Chararcter encoding is a conversion table that maps character codes to glyph codes in the font. The character encoding used in the Java 2D(tm) API is Unicode. For more information on Unicode you can visit the site <a href="http://www.unicode.org">http://www.unicode.org</a>. <p> Characters and glyphs do not have one-to-one correspondence. For example, <i>lowercase-a acute</i> can be represented by two glyphs: <i>lowercase-a</i> and <i>acute</i>. Another example is ligatures such as <i>ligature -fi</i> which is a single glyph representing two characters, <i>f</i> and <i>i</i>. <p> A <code>Font</code> is a collection of glyphs. A <code>Font</code> can have many faces, such as heavy, medium, oblique, gothic and regular. All of these faces have similar typographic design. <p> There are three different names that you can get from a <code>Font</code> object. The <i>logical font name</i> is the same as that used by java.awt.Font in JDK 1.1 and earlier releases. The <i>font face name</i>, or just <i>font name</i> for short, is the name of a particular font face, like Helvetica Bold. The <i>family name</i> is the name of the font family that determines the typographic design across several faces, like Helvetica. The font face name is the one that should be used to specify fonts. This name signifies actual fonts in the host system, and does not identify font names with the shape of font characters as the logical font name does. <p> The <code>Font</code> class represents an instance of a font face from a collection of font faces that are present in the system resources of the host system. As examples, Arial Bold and Courier Bold Italic are font faces. There can be several <code>Font</code> objects associated with a font face, each differing in size, style, transform and font features. The <A HREF="../../java/awt/GraphicsEnvironment.html#getAllFonts()"><CODE>getAllFonts</CODE></A> method of the <code>GraphicsEnvironment</code> class returns an array of all font faces available in the system. These font faces are returned as <code>Font</code> objects with a size of 1, identity transform and default font features. These base fonts can then be used to derive new <code>Font</code> objects with varying sizes, styles, transforms and font features via the <code>deriveFont</code> methods in this class.<P><DL><DT><B>See Also: </B><DD><A HREF="../../java/awt/GraphicsEnvironment.html#getAllFonts()"><CODE>GraphicsEnvironment.getAllFonts()</CODE></A>, <A HREF="../../serialized-form.html#java.awt.Font">Serialized Form</A></DL><HR><P><!-- ======== INNER CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><A NAME="field_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Field Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Font.html#BOLD">BOLD</A></B></CODE><BR> The bold style constant.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Font.html#CENTER_BASELINE">CENTER_BASELINE</A></B></CODE><BR> The baseline used in ideographic scripts like Chinese, Japanese, and Korean when laying out text</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Font.html#HANGING_BASELINE">HANGING_BASELINE</A></B></CODE><BR> The baseline used in Devanigiri and similar scripts when laying out text</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Font.html#ITALIC">ITALIC</A></B></CODE><BR> The italicized style constant.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected <A HREF="../../java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Font.html#name">name</A></B></CODE><BR> The logical name of this <code>Font</code>, as passed to the constructor.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Font.html#PLAIN">PLAIN</A></B></CODE><BR> The plain style constant.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected float</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Font.html#pointSize">pointSize</A></B></CODE><BR> The point size of this <code>Font</code> in <code>float</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Font.html#ROMAN_BASELINE">ROMAN_BASELINE</A></B></CODE><BR> The baseline used in most Roman scripts when laying out text</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Font.html#size">size</A></B></CODE><BR> The point size of this <code>Font</code>, rounded to integer.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Font.html#style">style</A></B></CODE><BR> The style of this <code>Font</code>, as passed to the constructor.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Font.html#TRUETYPE_FONT">TRUETYPE_FONT</A></B></CODE><BR> Create a Font of type TRUETYPE.</TD></TR></TABLE> <!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Constructor Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../java/awt/Font.html#Font(java.util.Map)">Font</A></B>(<A HREF="../../java/util/Map.html">Map</A> attributes)</CODE><BR> Creates a new <code>Font</code> with the specified attributes.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../java/awt/Font.html#Font(java.lang.String, int, int)">Font</A></B>(<A HREF="../../java/lang/String.html">String</A> name, int style, int size)</CODE><BR> Creates a new <code>Font</code> from the specified name, style and point size.</TD></TR></TABLE> <!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Font.html#canDisplay(char)">canDisplay</A></B>(char c)</CODE><BR> Checks if this <code>Font</code> has a glyph for the specified character.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/Font.html#canDisplayUpTo(char[], int, int)">canDisplayUpTo</A></B>(char[] text, int start, int limit)</CODE><BR> Indicates whether or not this <code>Font</code> can display the characters in the specified <code>text</code> starting at <code>start</code> and ending at <code>limit</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?