📄 font.html
字号:
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="../../../javax/microedition/lcdui/Font.html">Font</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/lcdui/Font.html#getFont(int)">getFont</A></B>(int fontSpecifier)</CODE>
<BR>
Gets the <code>Font</code> used by the high level user interface for the <code>fontSpecifier</code> passed in.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static <A HREF="../../../javax/microedition/lcdui/Font.html">Font</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/microedition/lcdui/Font.html#getFont(int, int, int)">getFont</A></B>(int face, int style, int size)</CODE>
<BR>
Obtains an object representing a font having the specified face, style, and size.</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="../../../javax/microedition/lcdui/Font.html#getHeight()">getHeight</A></B>()</CODE>
<BR>
Gets the standard height of a line of text in this font.</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="../../../javax/microedition/lcdui/Font.html#getSize()">getSize</A></B>()</CODE>
<BR>
Gets the size of the font.</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="../../../javax/microedition/lcdui/Font.html#getStyle()">getStyle</A></B>()</CODE>
<BR>
Gets the style of the 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="../../../javax/microedition/lcdui/Font.html#isBold()">isBold</A></B>()</CODE>
<BR>
Returns <code>true</code> if the font is bold.</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="../../../javax/microedition/lcdui/Font.html#isItalic()">isItalic</A></B>()</CODE>
<BR>
Returns <code>true</code> if the font is italic.</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="../../../javax/microedition/lcdui/Font.html#isPlain()">isPlain</A></B>()</CODE>
<BR>
Returns <code>true</code> if the font is plain.</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="../../../javax/microedition/lcdui/Font.html#isUnderlined()">isUnderlined</A></B>()</CODE>
<BR>
Returns <code>true</code> if the font is underlined.</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="../../../javax/microedition/lcdui/Font.html#stringWidth(java.lang.String)">stringWidth</A></B>(<A HREF="../../../java/lang/String.html">String</A> str)</CODE>
<BR>
Gets the total advance width for showing the specified <code>String</code> in this <code>Font</code>.</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="../../../javax/microedition/lcdui/Font.html#substringWidth(java.lang.String, int, int)">substringWidth</A></B>(<A HREF="../../../java/lang/String.html">String</A> str, int offset, int len)</CODE>
<BR>
Gets the total advance width for showing the specified substring in this <code>Font</code>.</TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.<A HREF="../../../java/lang/Object.html">Object</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../java/lang/Object.html#equals(java.lang.Object)">equals</A>, <A HREF="../../../java/lang/Object.html#getClass()">getClass</A>, <A HREF="../../../java/lang/Object.html#hashCode()">hashCode</A>, <A HREF="../../../java/lang/Object.html#notify()">notify</A>, <A HREF="../../../java/lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../../java/lang/Object.html#toString()">toString</A>, <A HREF="../../../java/lang/Object.html#wait()">wait</A>, <A HREF="../../../java/lang/Object.html#wait(long)">wait</A>, <A HREF="../../../java/lang/Object.html#wait(long, int)">wait</A></CODE></TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<A NAME="field_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Field Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="STYLE_PLAIN"><!-- --></A><H3>
STYLE_PLAIN</H3>
<PRE>
public static final int <B>STYLE_PLAIN</B></PRE>
<DL>
<DD>The plain style constant. This may be combined with the other style constants for mixed styles. <P>Value <code>0</code> is assigned to <code>STYLE_PLAIN</code>.</P></DL>
<HR>
<A NAME="STYLE_BOLD"><!-- --></A><H3>
STYLE_BOLD</H3>
<PRE>
public static final int <B>STYLE_BOLD</B></PRE>
<DL>
<DD>The bold style constant. This may be combined with the other style constants for mixed styles. <P>Value <code>1</code> is assigned to <code>STYLE_BOLD</code>.</P></DL>
<HR>
<A NAME="STYLE_ITALIC"><!-- --></A><H3>
STYLE_ITALIC</H3>
<PRE>
public static final int <B>STYLE_ITALIC</B></PRE>
<DL>
<DD>The italicized style constant. This may be combined with the other style constants for mixed styles. <P>Value <code>2</code> is assigned to <code>STYLE_ITALIC</code>.</P></DL>
<HR>
<A NAME="STYLE_UNDERLINED"><!-- --></A><H3>
STYLE_UNDERLINED</H3>
<PRE>
public static final int <B>STYLE_UNDERLINED</B></PRE>
<DL>
<DD>The underlined style constant. This may be combined with the other style constants for mixed styles. <P>Value <code>4</code> is assigned to <code>STYLE_UNDERLINED</code>.</P></DL>
<HR>
<A NAME="SIZE_SMALL"><!-- --></A><H3>
SIZE_SMALL</H3>
<PRE>
public static final int <B>SIZE_SMALL</B></PRE>
<DL>
<DD>The "small" system-dependent font size. <P>Value <code>8</code> is assigned to <code>STYLE_SMALL</code>.</P></DL>
<HR>
<A NAME="SIZE_MEDIUM"><!-- --></A><H3>
SIZE_MEDIUM</H3>
<PRE>
public static final int <B>SIZE_MEDIUM</B></PRE>
<DL>
<DD>The "medium" system-dependent font size. <P>Value <code>0</code> is assigned to <code>STYLE_MEDIUM</code>.</P></DL>
<HR>
<A NAME="SIZE_LARGE"><!-- --></A><H3>
SIZE_LARGE</H3>
<PRE>
public static final int <B>SIZE_LARGE</B></PRE>
<DL>
<DD>The "large" system-dependent font size. <P>Value <code>16</code> is assigned to <code>SIZE_LARGE</code>.</P></DL>
<HR>
<A NAME="FACE_SYSTEM"><!-- --></A><H3>
FACE_SYSTEM</H3>
<PRE>
public static final int <B>FACE_SYSTEM</B></PRE>
<DL>
<DD>The "system" font face. <P>Value <code>0</code> is assigned to <code>FACE_SYSTEM</code>.</P></DL>
<HR>
<A NAME="FACE_MONOSPACE"><!-- --></A><H3>
FACE_MONOSPACE</H3>
<PRE>
public static final int <B>FACE_MONOSPACE</B></PRE>
<DL>
<DD>The "monospace" font face. <P>Value <code>32</code> is assigned to <code>FACE_MONOSPACE</code>.</P></DL>
<HR>
<A NAME="FACE_PROPORTIONAL"><!-- --></A><H3>
FACE_PROPORTIONAL</H3>
<PRE>
public static final int <B>FACE_PROPORTIONAL</B></PRE>
<DL>
<DD>The "proportional" font face. <P>Value <code>64</code> is assigned to <code>FACE_PROPORTIONAL</code>.</P></DL>
<HR>
<A NAME="FONT_STATIC_TEXT"><!-- --></A><H3>
FONT_STATIC_TEXT</H3>
<PRE>
public static final int <B>FONT_STATIC_TEXT</B></PRE>
<DL>
<DD>Default font specifier used to draw Item and Screen contents. <code>FONT_STATIC_TEXT</code> has the value <code>0</code>.<DD><DL>
<DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/Font.html#getFont(int)"><CODE>getFont(int fontSpecifier)</CODE></A><DT><B>Since: </B><DD>MIDP 2.0</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="FONT_INPUT_TEXT"><!-- --></A><H3>
FONT_INPUT_TEXT</H3>
<PRE>
public static final int <B>FONT_INPUT_TEXT</B></PRE>
<DL>
<DD>Font specifier used by the implementation to draw text input by a user. <code>FONT_INPUT_TEXT</code> has the value <code>1</code>.<DD><DL>
<DT><B>See Also: </B><DD><A HREF="../../../javax/microedition/lcdui/Font.html#getFont(int)"><CODE>getFont(int fontSpecifier)</CODE></A><DT><B>Since: </B><DD>MIDP 2.0</DD>
</DL>
</DD>
</DL>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="getFont(int)"><!-- --></A><H3>
getFont</H3>
<PRE>
public static <A HREF="../../../javax/microedition/lcdui/Font.html">Font</A> <B>getFont</B>(int fontSpecifier)</PRE>
<DL>
<DD>Gets the <code>Font</code> used by the high level user interface for the <code>fontSpecifier</code> passed in. It should be used by subclasses of <code>CustomItem</code> and <code>Canvas</code> to match user interface on the device.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>fontSpecifier</CODE> - one of <code>FONT_INPUT_TEXT</code>, or <code>FONT_STATIC_TEXT</code><DT><B>Returns:</B><DD>font that corresponds to the passed in font specifier<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/IllegalArgumentException.html">IllegalArgumentException</A></CODE> - if <code>fontSpecifier</code> is not a valid fontSpecifier<DT><B>Since: </B><DD>MIDP 2.0</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="getDefaultFont()"><!-- --></A><H3>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -