PageRenderTime 53ms CodeModel.GetById 27ms RepoModel.GetById 0ms app.codeStats 0ms

/Win95NT/JDK 1.1.4/JDK 1.1.4 Documentation/api/java.awt.Font.html

https://github.com/rortian/oldjava
HTML | 442 lines | 440 code | 0 blank | 2 comment | 0 complexity | e02d66b0931f74aba0a681baa7c2fd08 MD5 | raw file
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
  2. <!--NewPage-->
  3. <html>
  4. <head>
  5. <!-- Generated by javadoc on Sat Aug 30 15:44:46 PDT 1997 -->
  6. <title>
  7. Class java.awt.Font
  8. </title>
  9. </head>
  10. <body>
  11. <a name="_top_"></a>
  12. <pre>
  13. <a href="packages.html">All Packages</a> <a href="tree.html">Class Hierarchy</a> <a href="Package-java.awt.html">This Package</a> <a href="java.awt.FlowLayout.html#_top_">Previous</a> <a href="java.awt.FontMetrics.html#_top_">Next</a> <a href="a-names.html">Index</a></pre>
  14. <hr>
  15. <h1>
  16. Class java.awt.Font
  17. </h1>
  18. <pre>
  19. <a href="java.lang.Object.html#_top_">java.lang.Object</a>
  20. |
  21. +----java.awt.Font
  22. </pre>
  23. <hr>
  24. <dl>
  25. <dt> public class <b>Font</b>
  26. <dt> extends <a href="java.lang.Object.html#_top_">Object</a>
  27. <dt> implements <a href="java.io.Serializable.html#_top_">Serializable</a>
  28. </dl>
  29. A class that produces font objects.
  30. <p>
  31. <hr>
  32. <a name="index"></a>
  33. <h2>
  34. <img src="images/variable-index.gif" width=207 height=38 alt="Variable Index">
  35. </h2>
  36. <dl>
  37. <dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
  38. <a href="#BOLD"><b>BOLD</b></a>
  39. <dd> The bold style constant.
  40. <dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
  41. <a href="#ITALIC"><b>ITALIC</b></a>
  42. <dd> The italicized style constant.
  43. <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o ">
  44. <a href="#name"><b>name</b></a>
  45. <dd>
  46. The logical name of this font.
  47. <dt> <img src="images/blue-ball-small.gif" width=6 height=6 alt=" o ">
  48. <a href="#PLAIN"><b>PLAIN</b></a>
  49. <dd> The plain style constant.
  50. <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o ">
  51. <a href="#size"><b>size</b></a>
  52. <dd>
  53. The point size of this font.
  54. <dt> <img src="images/magenta-ball-small.gif" width=6 height=6 alt=" o ">
  55. <a href="#style"><b>style</b></a>
  56. <dd>
  57. The style of the font.
  58. </dl>
  59. <h2>
  60. <img src="images/constructor-index.gif" width=275 height=38 alt="Constructor Index">
  61. </h2>
  62. <dl>
  63. <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
  64. <a href="#Font(java.lang.String, int, int)"><b>Font</b></a>(String, int, int)
  65. <dd> Creates a new font with the specified name, style and point size.
  66. </dl>
  67. <h2>
  68. <img src="images/method-index.gif" width=207 height=38 alt="Method Index">
  69. </h2>
  70. <dl>
  71. <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
  72. <a href="#decode(java.lang.String)"><b>decode</b></a>(String)
  73. <dd> Gets the specified font using the name passed in.
  74. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
  75. <a href="#equals(java.lang.Object)"><b>equals</b></a>(Object)
  76. <dd> Compares this object to the specifed object.
  77. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
  78. <a href="#getFamily()"><b>getFamily</b></a>()
  79. <dd> Gets the platform specific family name of the font.
  80. <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
  81. <a href="#getFont(java.lang.String)"><b>getFont</b></a>(String)
  82. <dd> Gets a font from the system properties list.
  83. <dt> <img src="images/green-ball-small.gif" width=6 height=6 alt=" o ">
  84. <a href="#getFont(java.lang.String, java.awt.Font)"><b>getFont</b></a>(String, Font)
  85. <dd> Gets the specified font from the system properties list.
  86. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
  87. <a href="#getName()"><b>getName</b></a>()
  88. <dd> Gets the logical name of the font.
  89. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
  90. <a href="#getPeer()"><b>getPeer</b></a>()
  91. <dd> Gets the peer of the font.
  92. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
  93. <a href="#getSize()"><b>getSize</b></a>()
  94. <dd> Gets the point size of the font.
  95. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
  96. <a href="#getStyle()"><b>getStyle</b></a>()
  97. <dd> Gets the style of the font.
  98. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
  99. <a href="#hashCode()"><b>hashCode</b></a>()
  100. <dd> Returns a hashcode for this font.
  101. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
  102. <a href="#isBold()"><b>isBold</b></a>()
  103. <dd> Indicates whether the font's style is bold.
  104. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
  105. <a href="#isItalic()"><b>isItalic</b></a>()
  106. <dd> Indicates whether the font's style is italic.
  107. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
  108. <a href="#isPlain()"><b>isPlain</b></a>()
  109. <dd> Indicates whether the font's style is plain.
  110. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
  111. <a href="#toString()"><b>toString</b></a>()
  112. <dd>
  113. Converts this object to a String representation.
  114. </dl>
  115. <a name="variables"></a>
  116. <h2>
  117. <img src="images/variables.gif" width=153 height=38 alt="Variables">
  118. </h2>
  119. <a name="PLAIN"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
  120. <b>PLAIN</b>
  121. <pre>
  122. public static final int PLAIN
  123. </pre>
  124. <dl>
  125. <dd> The plain style constant. This style can be combined with
  126. the other style constants for mixed styles.<p>
  127. </dl>
  128. <a name="BOLD"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
  129. <b>BOLD</b>
  130. <pre>
  131. public static final int BOLD
  132. </pre>
  133. <dl>
  134. <dd> The bold style constant. This style can be combined with the
  135. other style constants for mixed styles.<p>
  136. </dl>
  137. <a name="ITALIC"><img src="images/blue-ball.gif" width=12 height=12 alt=" o "></a>
  138. <b>ITALIC</b>
  139. <pre>
  140. public static final int ITALIC
  141. </pre>
  142. <dl>
  143. <dd> The italicized style constant. This style can be combined
  144. with the other style constants for mixed styles.<p>
  145. </dl>
  146. <a name="name"><img src="images/magenta-ball.gif" width=12 height=12 alt=" o "></a>
  147. <b>name</b>
  148. <pre>
  149. protected <a href="java.lang.String.html#_top_">String</a> name
  150. </pre>
  151. <dl>
  152. <dd> The logical name of this font.<p>
  153. </dl>
  154. <a name="style"><img src="images/magenta-ball.gif" width=12 height=12 alt=" o "></a>
  155. <b>style</b>
  156. <pre>
  157. protected int style
  158. </pre>
  159. <dl>
  160. <dd> The style of the font. This is the sum of the
  161. constants <code>PLAIN</code>, <code>BOLD</code>,
  162. or <code>ITALIC</code>.<p>
  163. </dl>
  164. <a name="size"><img src="images/magenta-ball.gif" width=12 height=12 alt=" o "></a>
  165. <b>size</b>
  166. <pre>
  167. protected int size
  168. </pre>
  169. <dl>
  170. <dd> The point size of this font.<p>
  171. </dl>
  172. <a name="constructors"></a>
  173. <h2>
  174. <img src="images/constructors.gif" width=231 height=38 alt="Constructors">
  175. </h2>
  176. <a name="Font"></a>
  177. <a name="Font(java.lang.String, int, int)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
  178. <b>Font</b>
  179. <pre>
  180. public Font(<a href="java.lang.String.html#_top_">String</a> name,
  181. int style,
  182. int size)
  183. </pre>
  184. <dl>
  185. <dd> Creates a new font with the specified name, style and point size.
  186. <p>
  187. <dd><dl>
  188. <dt> <b>Parameters:</b>
  189. <dd> name - the font name
  190. <dd> style - the constant style used
  191. <dd> size - the point size of the font
  192. <dt> <b>See Also:</b>
  193. <dd> <a href="java.awt.Toolkit.html#getFontList">getFontList</a>
  194. </dl></dd>
  195. </dl>
  196. <a name="methods"></a>
  197. <h2>
  198. <img src="images/methods.gif" width=151 height=38 alt="Methods">
  199. </h2>
  200. <a name="getPeer()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
  201. <a name="getPeer"><b>getPeer</b></a>
  202. <pre>
  203. public FontPeer getPeer()
  204. </pre>
  205. <dl>
  206. <dd> Gets the peer of the font.
  207. <p>
  208. <dd><dl>
  209. <dt> <b>Returns:</b>
  210. <dd> the peer of the font.
  211. </dl></dd>
  212. </dl>
  213. <a name="getFamily()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
  214. <a name="getFamily"><b>getFamily</b></a>
  215. <pre>
  216. public <a href="java.lang.String.html#_top_">String</a> getFamily()
  217. </pre>
  218. <dl>
  219. <dd> Gets the platform specific family name of the font. Use the
  220. <code>getName</code> method to get the logical name of the font.
  221. <p>
  222. <dd><dl>
  223. <dt> <b>Returns:</b>
  224. <dd> a string, the platform specific family name.
  225. <dt> <b>See Also:</b>
  226. <dd> <a href="#getName">getName</a>
  227. </dl></dd>
  228. </dl>
  229. <a name="getName()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
  230. <a name="getName"><b>getName</b></a>
  231. <pre>
  232. public <a href="java.lang.String.html#_top_">String</a> getName()
  233. </pre>
  234. <dl>
  235. <dd> Gets the logical name of the font.
  236. <p>
  237. <dd><dl>
  238. <dt> <b>Returns:</b>
  239. <dd> a string, the logical name of the font.
  240. <dt> <b>See Also:</b>
  241. <dd> <a href="#getFamily">getFamily</a>
  242. </dl></dd>
  243. </dl>
  244. <a name="getStyle()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
  245. <a name="getStyle"><b>getStyle</b></a>
  246. <pre>
  247. public int getStyle()
  248. </pre>
  249. <dl>
  250. <dd> Gets the style of the font.
  251. <p>
  252. <dd><dl>
  253. <dt> <b>Returns:</b>
  254. <dd> the style of this font.
  255. <dt> <b>See Also:</b>
  256. <dd> <a href="#isPlain">isPlain</a>, <a href="#isBold">isBold</a>, <a href="#isItalic">isItalic</a>
  257. </dl></dd>
  258. </dl>
  259. <a name="getSize()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
  260. <a name="getSize"><b>getSize</b></a>
  261. <pre>
  262. public int getSize()
  263. </pre>
  264. <dl>
  265. <dd> Gets the point size of the font.
  266. <p>
  267. <dd><dl>
  268. <dt> <b>Returns:</b>
  269. <dd> the point size of this font.
  270. </dl></dd>
  271. </dl>
  272. <a name="isPlain()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
  273. <a name="isPlain"><b>isPlain</b></a>
  274. <pre>
  275. public boolean isPlain()
  276. </pre>
  277. <dl>
  278. <dd> Indicates whether the font's style is plain.
  279. <p>
  280. <dd><dl>
  281. <dt> <b>Returns:</b>
  282. <dd> <code>true</code> if the font is neither
  283. bold nor italic; <code>false</code> otherwise.
  284. <dt> <b>See Also:</b>
  285. <dd> <a href="#getStyle">getStyle</a>
  286. </dl></dd>
  287. </dl>
  288. <a name="isBold()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
  289. <a name="isBold"><b>isBold</b></a>
  290. <pre>
  291. public boolean isBold()
  292. </pre>
  293. <dl>
  294. <dd> Indicates whether the font's style is bold.
  295. <p>
  296. <dd><dl>
  297. <dt> <b>Returns:</b>
  298. <dd> <code>true</code> if the font is bold;
  299. <code>false</code> otherwise.
  300. <dt> <b>See Also:</b>
  301. <dd> <a href="#getStyle">getStyle</a>
  302. </dl></dd>
  303. </dl>
  304. <a name="isItalic()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
  305. <a name="isItalic"><b>isItalic</b></a>
  306. <pre>
  307. public boolean isItalic()
  308. </pre>
  309. <dl>
  310. <dd> Indicates whether the font's style is italic.
  311. <p>
  312. <dd><dl>
  313. <dt> <b>Returns:</b>
  314. <dd> <code>true</code> if the font is italic;
  315. <code>false</code> otherwise.
  316. <dt> <b>See Also:</b>
  317. <dd> <a href="#getStyle">getStyle</a>
  318. </dl></dd>
  319. </dl>
  320. <a name="getFont(java.lang.String)"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
  321. <a name="getFont"><b>getFont</b></a>
  322. <pre>
  323. public static <a href="#_top_">Font</a> getFont(<a href="java.lang.String.html#_top_">String</a> nm)
  324. </pre>
  325. <dl>
  326. <dd> Gets a font from the system properties list.
  327. <p>
  328. <dd><dl>
  329. <dt> <b>Parameters:</b>
  330. <dd> nm - the property name
  331. <dt> <b>See Also:</b>
  332. <dd> <a href="#getFont(java.lang.String, java.awt.Font)">getFont</a>
  333. </dl></dd>
  334. </dl>
  335. <a name="decode(java.lang.String)"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
  336. <a name="decode"><b>decode</b></a>
  337. <pre>
  338. public static <a href="#_top_">Font</a> decode(<a href="java.lang.String.html#_top_">String</a> str)
  339. </pre>
  340. <dl>
  341. <dd> Gets the specified font using the name passed in.
  342. <p>
  343. <dd><dl>
  344. <dt> <b>Parameters:</b>
  345. <dd> str - the name
  346. </dl></dd>
  347. </dl>
  348. <a name="getFont(java.lang.String, java.awt.Font)"><img src="images/green-ball.gif" width=12 height=12 alt=" o "></a>
  349. <a name="getFont"><b>getFont</b></a>
  350. <pre>
  351. public static <a href="#_top_">Font</a> getFont(<a href="java.lang.String.html#_top_">String</a> nm,
  352. <a href="#_top_">Font</a> font)
  353. </pre>
  354. <dl>
  355. <dd> Gets the specified font from the system properties list.
  356. The first argument is treated as the name of a system property to
  357. be obtained as if by the method <code>System.getProperty</code>.
  358. The string value of this property is then interpreted as a font.
  359. <p>
  360. The property value should be one of the following forms:
  361. <ul>
  362. <li><em>fontname-style-pointsize</em>
  363. <li><em>fontname-pointsize</em>
  364. <li><em>fontname-style</em>
  365. <li><em>fontname</em>
  366. </ul>
  367. where <i>style</i> is one of the three strings
  368. <code>"BOLD"</code>, <code>"BOLDITALIC"</code>, or
  369. <code>"ITALIC"</code>, and point size is a decimal
  370. representation of the point size.
  371. <p>
  372. The default style is <code>PLAIN</code>. The default point size
  373. is 12.
  374. <p>
  375. If the specified property is not found, the <code>font</code>
  376. argument is returned instead.
  377. <p>
  378. <dd><dl>
  379. <dt> <b>Parameters:</b>
  380. <dd> nm - the property name
  381. <dd> font - a default font to return if property <code>nm</code>
  382. is not defined
  383. <dt> <b>Returns:</b>
  384. <dd> the <code>Font</code> value of the property.
  385. </dl></dd>
  386. </dl>
  387. <a name="hashCode()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
  388. <a name="hashCode"><b>hashCode</b></a>
  389. <pre>
  390. public int hashCode()
  391. </pre>
  392. <dl>
  393. <dd> Returns a hashcode for this font.
  394. <p>
  395. <dd><dl>
  396. <dt> <b>Returns:</b>
  397. <dd> a hashcode value for this font.
  398. <dt> <b>Overrides:</b>
  399. <dd> <a href="java.lang.Object.html#hashCode()">hashCode</a> in class <a href="java.lang.Object.html#_top_">Object</a>
  400. </dl></dd>
  401. </dl>
  402. <a name="equals(java.lang.Object)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
  403. <a name="equals"><b>equals</b></a>
  404. <pre>
  405. public boolean equals(<a href="java.lang.Object.html#_top_">Object</a> obj)
  406. </pre>
  407. <dl>
  408. <dd> Compares this object to the specifed object.
  409. The result is <code>true</code> if and only if the argument is not
  410. <code>null</code> and is a <code>Font</code> object with the same
  411. name, style, and point size as this font.
  412. <p>
  413. <dd><dl>
  414. <dt> <b>Parameters:</b>
  415. <dd> obj - the object to compare this font with.
  416. <dt> <b>Returns:</b>
  417. <dd> <code>true</code> if the objects are equal;
  418. <code>false</code> otherwise.
  419. <dt> <b>Overrides:</b>
  420. <dd> <a href="java.lang.Object.html#equals(java.lang.Object)">equals</a> in class <a href="java.lang.Object.html#_top_">Object</a>
  421. </dl></dd>
  422. </dl>
  423. <a name="toString()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
  424. <a name="toString"><b>toString</b></a>
  425. <pre>
  426. public <a href="java.lang.String.html#_top_">String</a> toString()
  427. </pre>
  428. <dl>
  429. <dd> Converts this object to a String representation.
  430. <p>
  431. <dd><dl>
  432. <dt> <b>Returns:</b>
  433. <dd> a string representation of this object
  434. <dt> <b>Overrides:</b>
  435. <dd> <a href="java.lang.Object.html#toString()">toString</a> in class <a href="java.lang.Object.html#_top_">Object</a>
  436. </dl></dd>
  437. </dl>
  438. <hr>
  439. <pre>
  440. <a href="packages.html">All Packages</a> <a href="tree.html">Class Hierarchy</a> <a href="Package-java.awt.html">This Package</a> <a href="java.awt.FlowLayout.html#_top_">Previous</a> <a href="java.awt.FontMetrics.html#_top_">Next</a> <a href="a-names.html">Index</a></pre>
  441. </body>
  442. </html>