1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7 <meta http-equiv="content-type" content="text/html; charset=undefined" />
8 <meta name="generator" content="JsDoc Toolkit" />
11 <title>JsDoc Reference - Roo.util.TextMetrics</title>
14 <link rel="stylesheet" type="text/css" href="../../css/roojs.css" />
15 <link rel="stylesheet" type="text/css" href="../default.css" />
18 <script type="text/javascript" src="../page.js">
25 <body onload="RooDocsPage.onload();">
28 <div class="body-wrap">
30 <!-- ============================== links to methods. ================================= -->
32 <div class="top-tools">
34 <a class="inner-link" href="#Roo.util.TextMetrics-props"><img src="resources/s.gif" class="item-icon icon-prop">Properties</a>
35 <a class="inner-link" href="#Roo.util.TextMetrics-methods"><img src="resources/s.gif" class="item-icon icon-method">Methods</a>
36 <a class="inner-link" href="#Roo.util.TextMetrics-events"><img src="resources/s.gif" class="item-icon icon-event">Events</a>
37 <a class="inner-link" href="#Roo.util.TextMetrics-configs"><img src="resources/s.gif" class="item-icon icon-config">Config Options</a>
38 <a class="bookmark" href="NEED_TO_CREATE_DIRECT_LINK_HREF"><img src="resources/s.gif" class="item-icon icon-fav">Direct Link</a>
43 <!-- ============================== inheritance Block. ================================= -->
45 <!-- ============================== class title / details ============================ -->
48 <h1 class="classTitle">
50 Class Roo.util.TextMetrics
53 <table cellspacing="0" class="class-summary-table">
55 <tr><td class="label">Package:</td><td class="hd-info">Roo.util</td></tr>
57 <tr><td class="label">Defined In:</td><td class="hd-info">
59 <a href="./src/Roo_util_TextMetrics.js.html">Roo/util/TextMetrics.js</a>.
62 <tr><td class="label">Class:</td><td class="hd-info">TextMetrics</td></tr>
70 <!-- ============================== class summary ========================== -->
71 <div class="description">
72 Provides precise pixel measurements for blocks of text so that you can determine exactly how high and<br/>wide, in pixels, a given block of text will be.
76 <!-- ============================== Class comment block... ========================== -->
78 <div class="comments">
79 <b>Class Comments / Notes</B> =>
80 <u onclick="parent.CommentDialog.showCommentId = 'Roo.util.TextMetrics';">[Add Your comment/notes about this class]</u>
82 <iframe frameborder="0" id="comments-Roo.util" style="border: none;width:100%;"
83 src="/blog.php/GtkDjsComments/Roo.util.TextMetrics.html"></iframe>
88 <!-- ============================== config options ========================== -->
93 <div class="hr"></div>
94 <a id="Roo.util.TextMetrics-configs"></a>
98 <table cellspacing="0" class="member-table">
99 <caption class="Empty">Config Options - Has None</caption>
113 <!-- ============================== public properties ==================== -->
117 <a id="Roo.util.TextMetrics-props"></a>
123 <table cellspacing="0" class="member-table">
124 <caption class="Empty">Public Properties - Has None</caption>
130 <!-- ============================== methods summary / details ======================== -->
133 <a id="Roo.util.TextMetrics-methods"></a>
134 <!-- constructor?? -->
141 <!-- then dynamics first -->
148 <table cellspacing="0" class="member-table">
149 <caption>Public Methods</caption>
151 <th class="sig-header" colspan="2">Method</th>
152 <th class="msource-header">Defined By</th>
162 <tr class="method-row config-row-alt0 expandable notInherited">
163 <td class="micon"><a class="exi" href="#expand"> </a></td>
167 <a id="Roo.util.TextMetrics-method-createInstance" name=".createInstance"></a>
168 <div class="fixedFont">
169 <span class="attributes">Roo.util.TextMetrics.</span><b class="itemname">createInstance</b>
171 (<a href="./String.html#constructor" roo:cls="String.html#constructor">String</a>/HTMLElement <B><i>el</i></B>, <a href="./Number.html#constructor" roo:cls="Number.html#constructor">Number</a> <B><i>fixedWidth</i></B>)
177 <a href="./Roo.util.TextMetrics.Instance.html#constructor" roo:cls="Roo.util.TextMetrics.Instance.html#constructor">Roo.util.TextMetrics.Instance</a>
186 <div class="short">Return a unique TextMetrics instance that can be bound directly to an element and reused.</div>
192 Return a unique TextMetrics instance that can be bound directly to an element and reused. This reduces<br/>the overhead of multiple calls to initialize the style properties on each measurement.
199 <dl class="detailList">
200 <dt class="heading">Parameters:</dt>
203 <span class="fixedFont"><a href="./String.html#constructor" roo:cls="String.html#constructor">String</a>/HTMLElement</span> <b>el</b>
206 <dd>The element, dom node or id that the instance will be bound to</dd>
209 <span class="fixedFont"><a href="./Number.html#constructor" roo:cls="Number.html#constructor">Number</a></span> <b>fixedWidth</b>
212 <dd>(optional) If the text will be multiline, you have to set a fixed width<br/>in order to accurately measure the text height</dd>
220 <dl class="detailList">
221 <dt class="heading">Returns:</dt>
223 <dd><span class="fixedFont"><a href="./Roo.util.TextMetrics.Instance.html#constructor" roo:cls="Roo.util.TextMetrics.Instance.html#constructor">Roo.util.TextMetrics.Instance</a></span> instance The new instance</dd>
245 <tr class="method-row config-row-alt1 expandable notInherited">
246 <td class="micon"><a class="exi" href="#expand"> </a></td>
250 <a id="Roo.util.TextMetrics-method-measure" name=".measure"></a>
251 <div class="fixedFont">
252 <span class="attributes">Roo.util.TextMetrics.</span><b class="itemname">measure</b>
254 (<a href="./String.html#constructor" roo:cls="String.html#constructor">String</a>/HTMLElement <B><i>el</i></B>, <a href="./String.html#constructor" roo:cls="String.html#constructor">String</a> <B><i>text</i></B>, <a href="./Number.html#constructor" roo:cls="Number.html#constructor">Number</a> <B><i>fixedWidth</i></B>)
260 <a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Object">Object</a>
269 <div class="short">Measures the size of the specified text</div>
275 Measures the size of the specified text
282 <dl class="detailList">
283 <dt class="heading">Parameters:</dt>
286 <span class="fixedFont"><a href="./String.html#constructor" roo:cls="String.html#constructor">String</a>/HTMLElement</span> <b>el</b>
289 <dd>The element, dom node or id from which to copy existing CSS styles<br/>that can affect the size of the rendered text</dd>
292 <span class="fixedFont"><a href="./String.html#constructor" roo:cls="String.html#constructor">String</a></span> <b>text</b>
295 <dd>The text to measure</dd>
298 <span class="fixedFont"><a href="./Number.html#constructor" roo:cls="Number.html#constructor">Number</a></span> <b>fixedWidth</b>
301 <dd>(optional) If the text will be multiline, you have to set a fixed width<br/>in order to accurately measure the text height</dd>
309 <dl class="detailList">
310 <dt class="heading">Returns:</dt>
312 <dd><span class="fixedFont"><a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Object">Object</a></span> An object containing the text's size {width: (width), height: (height)}</dd>
337 <!-- ============================== events summary / details ======================== -->
340 <a id="Roo.util.TextMetrics-events"></a>
346 <table cellspacing="0" class="member-table">
347 <caption class="Empty">Events - Has None</caption>
358 <!-- ============================== footer ================================= -->
359 <div class="fineprint" style="clear:both">
361 Documentation generated by <a href="http://www.akbkhome.com" target="_blankt">Introspection Doc Generator</a> on Fri Sep 09 2016 14:29:47 GMT+0800 (HKT)
363 <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a>