diff --git a/jquery.flot.canvas.js b/jquery.flot.canvas.js index 05bbb4f..171f463 100644 --- a/jquery.flot.canvas.js +++ b/jquery.flot.canvas.js @@ -217,21 +217,24 @@ browser, but needs to redraw with canvas text when exporting as an image. // If the font was provided as CSS, create a div with those // classes and examine it to generate a canvas font spec. + // Note the trick of using a line-height of 1, without units; + // this sets it equal to the font-size, even if the font-size + // is something abstract, like 'smaller'. This enables us to + // read the real font-size via the element's height, working + // around browsers that return the literal 'smaller' value. + if (typeof font !== "object") { - var element = $("
").html(text) + var element = $("