diff --git a/src/plots/layout_attributes.js b/src/plots/layout_attributes.js index 3362a1b0526..cf6684b6a04 100644 --- a/src/plots/layout_attributes.js +++ b/src/plots/layout_attributes.js @@ -18,7 +18,7 @@ var extendFlat = Plotly.Lib.extendFlat; module.exports = { font: { family: extendFlat({}, fontAttrs.family, { - dflt: '"Open sans", verdana, arial, sans-serif' + dflt: '"Open Sans", verdana, arial, sans-serif' }), size: extendFlat({}, fontAttrs.size, { dflt: 12 diff --git a/src/plots/plots.js b/src/plots/plots.js index ecf1bf8cafd..f83e424769b 100644 --- a/src/plots/plots.js +++ b/src/plots/plots.js @@ -288,8 +288,8 @@ plots.addLinks = function(gd) { linkContainer.enter().append('text') .classed('js-plot-link-container', true) .style({ - 'font-family':'"Open Sans",Arial,sans-serif', - 'font-size':'12px', + 'font-family':'"Open Sans", Arial, sans-serif', + 'font-size': '12px', 'fill': Plotly.Color.defaultLine, 'pointer-events': 'all' }) diff --git a/src/snapshot/tosvg.js b/src/snapshot/tosvg.js index 4ba8396a829..bc2c779241e 100644 --- a/src/snapshot/tosvg.js +++ b/src/snapshot/tosvg.js @@ -113,8 +113,21 @@ module.exports = function toSVG(gd, format) { // serialized svg because the style attribute itself is double-quoted! // Is this an IE thing? Any other attributes or style elements that can have quotes in them? // TODO: this looks like a noop right now - what happened to it? + + /* + * Font-family styles with double quotes in them breaks the to-image + * step in FF42 because the style attribute itself is wrapped in + * double quotes. See: + * + * - http://codepen.io/etpinard/pen/bEdQWK + * - https://github.com/plotly/plotly.js/pull/104 + * + * for more info. + */ var ff = txt.style('font-family'); - if(ff && ff.indexOf('"') !== -1) txt.style('font-family', ff.replace(/"/g, '"')); + if(ff && ff.indexOf('"') !== -1) { + txt.style('font-family', ff.replace(/"/g, '\\\'')); + } }); if(format === 'pdf' || format === 'eps') {