Skip to content

Commit 1b67344

Browse files
committed
adjust toSVG to skip none text style values
1 parent 0a1f7a8 commit 1b67344

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/snapshot/tosvg.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,20 @@ module.exports = function toSVG(gd, format, scale) {
118118
if(fv && fv === 'normal') {
119119
txt.style('font-variant', undefined);
120120
}
121+
122+
// Drop none text-shadow, text-transform and text-decoration-line to reduce the size
123+
var ts = this.style.textShadow;
124+
if(ts && ts === 'none') {
125+
txt.style('text-shadow', undefined);
126+
}
127+
var tt = this.style.textTransform;
128+
if(tt && tt === 'none') {
129+
txt.style('text-transform', undefined);
130+
}
131+
var td = this.style.textDecorationLine;
132+
if(td && td === 'none') {
133+
txt.style('text-decoration-line', undefined);
134+
}
121135
});
122136

123137
svg.selectAll('.gradient_filled,.pattern_filled').each(function() {

0 commit comments

Comments
 (0)