Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

i have looked into the svg files and found it might be the transform attribute of the svg tags that causes this bug. chromium based browsers ignore it while firefox does not.

however, batch export the svg files is really time consuming, so i have written a javascript to repair the already exported files by removing 'transform' from svg tags.

// repairsvg.js
((cheerio, fs) => {
    let repair = path => fs.readFile(path, 'utf8', (err, data) => err ? console.log(err) : ($ => {
        $('svg').each((i, element) => $(element).attr('transform', null));
        fs.writeFile(path + '.repaired.svg', $.html(), 'utf8', err => err ? console.log(err) : null);
    })(cheerio.load(data, {
        xmlMode: true
    })));
    fs.readFile(process.argv[2], 'utf8', (err, data) => err ? console.log(err) : (data => 
        data.split('\0').forEach(path => repair(path))
    )(data));
})(require('cheerio'), require('fs'));

save the script above as 'repairsvg.js' and put it into the directory where you exported svg files to

% pushd /path/to/svg/files
% yarn add cheerio
% find -L -name '*svg' -print0 > ./list.txt
% node ./repairsvg.js ./list.txt

now wait for a few seconds and the svg files will be repaired (this takes much less time than exporting the svg files again)

Yes, that is correct and indeed the fix that is implemented in the latest build is removing the transform tag. Thank you for sharing your script!