sync
[roojs1] / docs / symbols / Roo.util.TextMetrics.json
1 {
2   "name" : "Roo.util.TextMetrics",
3   "augments" : [],
4   "desc" : "Provides precise pixel measurements for blocks of text so that you can determine exactly how high and\nwide, in pixels, a given block of text will be.",
5   "isSingleton" : true,
6   "isStatic" : false,
7   "isBuiltin" : false,
8   "memberOf" : "TextMetrics",
9   "example" : "",
10   "deprecated" : "",
11   "since" : "",
12   "see" : "",
13   "params" : [],
14   "returns" : [],
15   "throws" : "",
16   "requires" : "",
17   "config" : [],
18   "methods" : [
19     {
20       "name" : "createInstance",
21       "type" : "function",
22       "desc" : "Return a unique TextMetrics instance that can be bound directly to an element and reused.  This reduces\nthe overhead of multiple calls to initialize the style properties on each measurement.",
23       "sig" : "(el, fixedWidth)",
24       "static" : false,
25       "memberOf" : "",
26       "isStatic" : false,
27       "isConstructor" : false,
28       "isPrivate" : false,
29       "example" : "",
30       "deprecated" : "",
31       "since" : "",
32       "see" : "",
33       "exceptions" : "",
34       "requires" : "",
35       "params" : [
36         {
37           "name" : "el",
38           "type" : "String/HTMLElement",
39           "desc" : "The element, dom node or id that the instance will be bound to",
40           "isOptional" : false
41         },
42         {
43           "name" : "fixedWidth",
44           "type" : "Number",
45           "desc" : "(optional) If the text will be multiline, you have to set a fixed width\nin order to accurately measure the text height",
46           "isOptional" : false
47         }
48       ],
49       "returns" : [
50         {
51           "name" : "",
52           "type" : "Roo.util.TextMetrics.Instance",
53           "desc" : "instance The new instance"
54         }
55       ]
56     },
57     {
58       "name" : "measure",
59       "type" : "function",
60       "desc" : "Measures the size of the specified text",
61       "sig" : "(el, text, fixedWidth)",
62       "static" : false,
63       "memberOf" : "",
64       "isStatic" : false,
65       "isConstructor" : false,
66       "isPrivate" : false,
67       "example" : "",
68       "deprecated" : "",
69       "since" : "",
70       "see" : "",
71       "exceptions" : "",
72       "requires" : "",
73       "params" : [
74         {
75           "name" : "el",
76           "type" : "String/HTMLElement",
77           "desc" : "The element, dom node or id from which to copy existing CSS styles\nthat can affect the size of the rendered text",
78           "isOptional" : false
79         },
80         {
81           "name" : "text",
82           "type" : "String",
83           "desc" : "The text to measure",
84           "isOptional" : false
85         },
86         {
87           "name" : "fixedWidth",
88           "type" : "Number",
89           "desc" : "(optional) If the text will be multiline, you have to set a fixed width\nin order to accurately measure the text height",
90           "isOptional" : false
91         }
92       ],
93       "returns" : [
94         {
95           "name" : "",
96           "type" : "Object",
97           "desc" : "An object containing the text's size {width: (width), height: (height)}"
98         }
99       ]
100     }
101   ],
102   "events" : []
103 }