aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/js
diff options
context:
space:
mode:
authorManuel Luis SanmartĂ­n Rozada2014-07-28 00:58:51 +0200
committerPim van den Berg2014-08-02 12:29:52 +0200
commit234bcf189bdf919e5a2da796ea580f3c18f8f63b (patch)
tree4570513a034e629b5821e68d7aea5b2235dcc1da /js
parentjsrrdgraph: Use Typed Arrays for better performance (diff)
downloadapt-panopticon_cgp-234bcf189bdf919e5a2da796ea580f3c18f8f63b.zip
apt-panopticon_cgp-234bcf189bdf919e5a2da796ea580f3c18f8f63b.tar.gz
apt-panopticon_cgp-234bcf189bdf919e5a2da796ea580f3c18f8f63b.tar.bz2
apt-panopticon_cgp-234bcf189bdf919e5a2da796ea580f3c18f8f63b.tar.xz
jsrrdgraph: Add fallback fonts.
Diffstat (limited to 'js')
-rw-r--r--js/RrdGfxCanvas.js4
-rw-r--r--js/RrdGraph.js2
2 files changed, 3 insertions, 3 deletions
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
211 y = Math.round(y); 211 y = Math.round(y);
212 212
213 this.ctx.save(); 213 this.ctx.save();
214 this.ctx.font = font.size+'px '+"'"+font.font+"'"; 214 this.ctx.font = font.size+'px '+font.font;
215 215
216 switch (h_align) { 216 switch (h_align) {
217 case RrdGraph.GFX_H_LEFT: 217 case RrdGraph.GFX_H_LEFT:
@@ -247,7 +247,7 @@ RrdGfxCanvas.prototype.text = function (x, y, color, font, tabwidth, angle, h_al
247RrdGfxCanvas.prototype.get_text_width = function(start, font, tabwidth, text) 247RrdGfxCanvas.prototype.get_text_width = function(start, font, tabwidth, text)
248{ 248{
249 this.ctx.save(); 249 this.ctx.save();
250 this.ctx.font = font.size+"px "+font.font; 250 this.ctx.font = font.size+'px '+font.font;
251 var width = this.ctx.measureText(text); 251 var width = this.ctx.measureText(text);
252 this.ctx.restore(); 252 this.ctx.restore();
253 return width.width; 253 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)
797 this.AlmostEqualInt = new Int32Array(this.AlmostEqualBuffer); 797 this.AlmostEqualInt = new Int32Array(this.AlmostEqualBuffer);
798 this.AlmostEqualFloat = new Float32Array(this.AlmostEqualBuffer); 798 this.AlmostEqualFloat = new Float32Array(this.AlmostEqualBuffer);
799 799
800 this.DEFAULT_FONT = 'DejaVu Sans Mono'; //DejaVu Sans Mono ,Bitstream Vera Sans Mono,monospace,Courier', // pt -> pt=px*72/96 800 this.DEFAULT_FONT = "'DejaVu Sans Mono', 'Courier', 'Ubuntu Mono'"; // pt -> pt=px*72/96
801 this.MGRIDWIDTH = 0.6; 801 this.MGRIDWIDTH = 0.6;
802 this.GRIDWIDTH = 0.4; 802 this.GRIDWIDTH = 0.4;
803 this.YLEGEND_ANGLE = 90.0; 803 this.YLEGEND_ANGLE = 90.0;