Remove SVGO compression, now done upstream in Mathoid
Change-Id: I961eb82722ae161bdf7a3ea945c299244ce321fb Depends-On: I86c1a14ad81d2d252ac73da973274f88153d993c
This commit is contained in:
parent
49fc247004
commit
481138a73d
|
@ -16,12 +16,6 @@
|
|||
fs = require( 'fs' ),
|
||||
http = require( 'http' ),
|
||||
querystring = require( 'querystring' ),
|
||||
SVGO = require( 'svgo' ),
|
||||
svgo = new SVGO( {
|
||||
plugins: [
|
||||
{ convertTransform: false }
|
||||
]
|
||||
} ),
|
||||
mathoidMaxConnections = 20,
|
||||
// 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
|
||||
|
@ -74,7 +68,8 @@
|
|||
} );
|
||||
|
||||
res.on( 'end', function () {
|
||||
var className = texToClass( symbol.tex ),
|
||||
var cssRule, buttonHeight, height, verticalAlign, heightDifference, offset,
|
||||
className = texToClass( symbol.tex ),
|
||||
data = JSON.parse( body ),
|
||||
svg = data.svg;
|
||||
|
||||
|
@ -84,11 +79,8 @@
|
|||
return;
|
||||
}
|
||||
|
||||
svgo.optimize( svg, function ( result ) {
|
||||
var cssRule, buttonHeight, height, verticalAlign, heightDifference, offset;
|
||||
|
||||
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 ) {
|
||||
// Convert buttonHeight from em to ex, because SVG height is given in ex. (This is an
|
||||
|
@ -111,7 +103,6 @@
|
|||
cssRules.push( cssRule );
|
||||
console.log( symbol.tex + ' -> ' + className );
|
||||
}
|
||||
} );
|
||||
onEnd();
|
||||
|
||||
} );
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
{
|
||||
"name": "math-icons-generator",
|
||||
"dependencies": {
|
||||
"svgo": "^0.6.0"
|
||||
}
|
||||
"name": "math-icons-generator"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue