From 234bcf189bdf919e5a2da796ea580f3c18f8f63b Mon Sep 17 00:00:00 2001 From: Manuel Luis SanmartĂ­n Rozada Date: Mon, 28 Jul 2014 00:58:51 +0200 Subject: jsrrdgraph: Add fallback fonts. --- js/RrdGfxCanvas.js | 4 ++-- js/RrdGraph.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'js') diff --git a/js/RrdGfxCanvas.js b/js/RrdGfxCanvas.js index 0d1784e..324b655 100644 --- a/js/RrdGfxCanvas.js +++ b/js/RrdGfxCanvas.js @@ -211,7 +211,7 @@ RrdGfxCanvas.prototype.text = function (x, y, color, font, tabwidth, angle, h_al y = Math.round(y); this.ctx.save(); - this.ctx.font = font.size+'px '+"'"+font.font+"'"; + this.ctx.font = font.size+'px '+font.font; switch (h_align) { case RrdGraph.GFX_H_LEFT: @@ -247,7 +247,7 @@ RrdGfxCanvas.prototype.text = function (x, y, color, font, tabwidth, angle, h_al RrdGfxCanvas.prototype.get_text_width = function(start, font, tabwidth, text) { this.ctx.save(); - this.ctx.font = font.size+"px "+font.font; + this.ctx.font = font.size+'px '+font.font; var width = this.ctx.measureText(text); this.ctx.restore(); return width.width; diff --git a/js/RrdGraph.js b/js/RrdGraph.js index 7171a9c..57adaee 100644 --- a/js/RrdGraph.js +++ b/js/RrdGraph.js @@ -797,7 +797,7 @@ var RrdGraph = function (gfx, data) this.AlmostEqualInt = new Int32Array(this.AlmostEqualBuffer); this.AlmostEqualFloat = new Float32Array(this.AlmostEqualBuffer); - this.DEFAULT_FONT = 'DejaVu Sans Mono'; //DejaVu Sans Mono ,Bitstream Vera Sans Mono,monospace,Courier', // pt -> pt=px*72/96 + this.DEFAULT_FONT = "'DejaVu Sans Mono', 'Courier', 'Ubuntu Mono'"; // pt -> pt=px*72/96 this.MGRIDWIDTH = 0.6; this.GRIDWIDTH = 0.4; this.YLEGEND_ANGLE = 90.0; -- cgit v1.1