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