bifont.html

来自「ajax 框价.是个好工具.javascript 矿家.可以用在任何平台.」· HTML 代码 · 共 281 行

HTML
281
字号
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><!--Generated using api.website.xsl version 2003-07-17--><head><META http-equiv="Content-Type" content="text/html; charset=utf-8"><title>BiFont</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><link type="text/css" rel="stylesheet" href="api.css"><script type="text/javascript">				function showDerivedClasses() {					var ul = document.getElementById("api-derived-classes");					var lis = ul.childNodes;					var l = lis.length;					for (var i = 1; i < l; i++)						lis[i].style.display = "";					lis[0].style.display = "none";				}			</script></head><body><h1 id="BiFont">BiFont</h1><p>		This class is used with <code><a href="BiLabel.html">BiLabel</a></code> to provide		the font style information.	</p><p>This class extends		<code><a href="BiObject.html">BiObject</a></code>		and therefore all methods and fields available for		<code><a href="BiObject.html">BiObject</a></code>		are also available for <code>BiFont</code>.</p><ul class="partial-class-tree"><li><code><a href="BiObject.html">BiObject</a></code><ul><li><code>BiFont</code><ul id="api-derived-classes"></ul></li></ul></li></ul><h2>Constructor</h2><p><code>	new BiFont([<span class="methodArgument">nSize</span> [, <span class="methodArgument">sName</span>]])</code></p><h3>Parameters</h3><table><thead><tr><td>Name</td><td>Type</td><td class="optional-header">Optional</td><td>Default</td><td>Descripton</td></tr></thead><tbody><tr><td><code>nSize</code></td><td><code class="type">Number</code></td><td class="optional-column"><img src="check.png" alt="checked"></td><td></td><td>The font size in pixels</td></tr><tr><td><code>sName</code></td><td><code class="type">String</code></td><td class="optional-column"><img src="check.png" alt="checked"></td><td></td><td>The font name</td></tr></tbody></table><h2>Properties</h2><table><thead><tr><td>Name</td><td>Type</td><td class="get-header">get</td><td class="set-header">set</td><td>Descripton</td></tr></thead><tbody><tr><td><a name="bold"></a><code>bold</code></td><td><code class="type">Boolean</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"><img src="check.png" alt="checked"></td><td>Whether to use bold</td></tr><tr><td><a name="italic"></a><code>italic</code></td><td><code class="type">Boolean</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"><img src="check.png" alt="checked"></td><td>Whether to use italic</td></tr><tr><td><a name="name"></a><code>name</code></td><td><code class="type">String</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"><img src="check.png" alt="checked"></td><td>The name of the font. A comma seprated list also works</td></tr><tr><td><a name="size"></a><code>size</code></td><td><code class="type">Number</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"><img src="check.png" alt="checked"></td><td>The font size (in pixels)</td></tr><tr><td><a name="strikeout"></a><code>strikeout</code></td><td><code class="type">Boolean</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"><img src="check.png" alt="checked"></td><td>Whether to line through the text</td></tr><tr><td><a name="underline"></a><code>underline</code></td><td><code class="type">Boolean</code></td><td class="get-column"><img src="check.png" alt="checked"></td><td class="set-column"><img src="check.png" alt="checked"></td><td>Whether to underline the text</td></tr></tbody></table><h2>Methods</h2><table><thead><tr><td>Name</td><td>Description</td></tr></thead><tbody><tr><td><code><a href="#paintFont">paintFont</a></code></td><td>Makes the component have a font described by the current font object</td></tr><tr><td><code><a href="#removeFont">removeFont</a></code></td><td>				Removes this font from a component. This means that				the font styles this font object has applied to a component				will be reset/removed.			</td></tr></tbody></table><h2>Events</h2><p>None.</p><h2>Static Methods</h2><table><thead><tr><td>Name</td><td>Description</td></tr></thead><tbody><tr><td><code><a href="#fromString">fromString</a></code></td><td>				Parses a string and returns a new font object. The format for the				string is<br>				<br>				"bold"? "italic"? "underline"? "strikeout"? (&lt;size&gt;"px"?)? &lt;font name&gt;?<br>				<br>				12px bold italic Arial<br>				<br>				The order of the parts is not relevant.			</td></tr></tbody></table><h2>Static Fields</h2><p>None.</p><h2>Remarks</h2><p>		To change the font of the component you have to use		<code><a href="BiLabel.html#font">setFont()</a></code>. Changing the		font object without calling <code><a href="BiLabel.html#font">setFont()</a></code>		will not update the component.	</p><h2>Method Details</h2><h3><a name="paintFont"></a>paintFont</h3><p>Makes the component have a font described by the current font object</p><h4>Syntax</h4><pre class="method-syntax">object.paintFont(<span class="methodArgument">oComponent</span>)</pre><h4>Parameters</h4><table><thead><tr><td>Name</td><td>Type</td><td class="optional-header">Optional</td><td>Default</td><td>Descripton</td></tr></thead><tbody><tr><td><code>oComponent</code></td><td><code class="type"><code><a href="BiComponent.html">BiComponent</a></code></code></td><td class="optional-column"></td><td></td><td>The component to set the font to</td></tr></tbody></table><h4>Return Type</h4><p><code class="type">void</code></p><h3><a name="removeFont"></a>removeFont</h3><p>				Removes this font from a component. This means that				the font styles this font object has applied to a component				will be reset/removed.			</p><h4>Syntax</h4><pre class="method-syntax">object.removeFont(<span class="methodArgument">oComponent</span>)</pre><h4>Parameters</h4><table><thead><tr><td>Name</td><td>Type</td><td class="optional-header">Optional</td><td>Default</td><td>Descripton</td></tr></thead><tbody><tr><td><code>oComponent</code></td><td><code class="type"><code><a href="BiComponent.html">BiComponent</a></code></code></td><td class="optional-column"></td><td></td><td>The component to remove the font from</td></tr></tbody></table><h4>Return Type</h4><p><code class="type">void</code></p><h2>Static Method Details</h2><h3><a name="fromString"></a>fromString</h3><p>				Parses a string and returns a new font object. The format for the				string is<br>				<br>				"bold"? "italic"? "underline"? "strikeout"? (&lt;size&gt;"px"?)? &lt;font name&gt;?<br>				<br>				12px bold italic Arial<br>				<br>				The order of the parts is not relevant.			</p><h4>Syntax</h4><pre class="method-syntax">BiFont.fromString(<span class="methodArgument">s</span>)</pre><h4>Parameters</h4><table><thead><tr><td>Name</td><td>Type</td><td class="optional-header">Optional</td><td>Default</td><td>Descripton</td></tr></thead><tbody><tr><td><code>s</code></td><td><code class="type">String</code></td><td class="optional-column"></td><td></td><td>The string to parse</td></tr></tbody></table><h4>Return Type</h4><p><code class="type"><code><a href="BiFont.html">BiFont</a></code></code></p></body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?