Remove SVGO compression, now done upstream in Mathoid

Change-Id: I961eb82722ae161bdf7a3ea945c299244ce321fb
Depends-On: I86c1a14ad81d2d252ac73da973274f88153d993c
This commit is contained in:
Ed Sanders 2016-03-22 15:24:58 +00:00
parent 49fc247004
commit 481138a73d
2 changed files with 25 additions and 37 deletions

View File

@ -16,12 +16,6 @@
fs = require( 'fs' ), fs = require( 'fs' ),
http = require( 'http' ), http = require( 'http' ),
querystring = require( 'querystring' ), querystring = require( 'querystring' ),
SVGO = require( 'svgo' ),
svgo = new SVGO( {
plugins: [
{ convertTransform: false }
]
} ),
mathoidMaxConnections = 20, mathoidMaxConnections = 20,
// If symbol.alignBaseline is true, a background-position property will be added to the // If symbol.alignBaseline is true, a background-position property will be added to the
// CSS rule to shift the baseline of the SVG to be a certain proportion of the way up the // CSS rule to shift the baseline of the SVG to be a certain proportion of the way up the
@ -74,7 +68,8 @@
} ); } );
res.on( 'end', function () { res.on( 'end', function () {
var className = texToClass( symbol.tex ), var cssRule, buttonHeight, height, verticalAlign, heightDifference, offset,
className = texToClass( symbol.tex ),
data = JSON.parse( body ), data = JSON.parse( body ),
svg = data.svg; svg = data.svg;
@ -84,11 +79,8 @@
return; return;
} }
svgo.optimize( svg, function ( result ) {
var cssRule, buttonHeight, height, verticalAlign, heightDifference, offset;
cssRule = cssPrefix + className + ' {\n' + cssRule = cssPrefix + className + ' {\n' +
'\tbackground-image: url(data:image/svg+xml,' + encodeURIComponentForCSS( result.data ) + ');\n'; '\tbackground-image: url(data:image/svg+xml,' + encodeURIComponentForCSS( svg ) + ');\n';
if ( symbol.alignBaseline ) { if ( symbol.alignBaseline ) {
// Convert buttonHeight from em to ex, because SVG height is given in ex. (This is an // Convert buttonHeight from em to ex, because SVG height is given in ex. (This is an
@ -111,7 +103,6 @@
cssRules.push( cssRule ); cssRules.push( cssRule );
console.log( symbol.tex + ' -> ' + className ); console.log( symbol.tex + ' -> ' + className );
} }
} );
onEnd(); onEnd();
} ); } );

View File

@ -1,6 +1,3 @@
{ {
"name": "math-icons-generator", "name": "math-icons-generator"
"dependencies": {
"svgo": "^0.6.0"
}
} }