(str, options)
| 2464 | } |
| 2465 | |
| 2466 | function textmetrics(str, options) { |
| 2467 | /* Returns array [width, height] for the given text. |
| 2468 | */ |
| 2469 | var a = _fontMixin(options); |
| 2470 | var w = 0; |
| 2471 | _ctx_font(a[0], a[1], a[2]); |
| 2472 | var lines = str.toString().split("\n"); |
| 2473 | for (var i=0; i<lines.length; i++) { |
| 2474 | w = Math.max(w, _ctx.measureText(lines[i]).width); |
| 2475 | } |
| 2476 | return [w, a[1] + a[1]*a[3]*(lines.length-1)]; |
| 2477 | } |
| 2478 | |
| 2479 | function textwidth(str, options) { |
| 2480 | /* Returns the width of the given text. |
no test coverage detected
searching dependent graphs…