From 82ac1aecb06e7be48ccfec190c1a2ea8fa4d4df7 Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Wed, 4 May 2011 17:02:21 +0200 Subject: [PATCH 1/2] Fixes the font of the axis labels by removing single quotes in CSS font property (otherwise a list of fonts is interpreted as a single font name or already quoted font names are quoted twice --- jquery.flot.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jquery.flot.js b/jquery.flot.js index d719714..fd87ef8 100644 --- a/jquery.flot.js +++ b/jquery.flot.js @@ -1692,7 +1692,10 @@ // placeholder.append('
') // debug ctx.fillStyle = axis.options.color; - ctx.font = f.style + " " + f.variant + " " + f.weight + " " + f.size + "px '" + f.family + "'"; + // Important: Don't use quotes around axis.font.family! Just around single + // font names like 'Times New Roman' that have a space in it, or if it includes a + // special character). + ctx.font = f.style + " " + f.variant + " " + f.weight + " " + f.size + "px " + f.family; ctx.textAlign = "start"; // middle align the labels - top would be more // natural, but browsers can differ a pixel or two in From a35b7d0fead6c5dc6e4270e2a01b7f65ca3d45ef Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Wed, 4 May 2011 17:04:54 +0200 Subject: [PATCH 2/2] Corrected inline comment --- jquery.flot.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/jquery.flot.js b/jquery.flot.js index fd87ef8..ebe7a7f 100644 --- a/jquery.flot.js +++ b/jquery.flot.js @@ -1693,8 +1693,7 @@ ctx.fillStyle = axis.options.color; // Important: Don't use quotes around axis.font.family! Just around single - // font names like 'Times New Roman' that have a space in it, or if it includes a - // special character). + // font names like 'Times New Roman' that have a space or special character in it. ctx.font = f.style + " " + f.variant + " " + f.weight + " " + f.size + "px " + f.family; ctx.textAlign = "start"; // middle align the labels - top would be more