Trimmed "download-options.png"

This commit is contained in:
be5invis 2016-03-08 01:04:32 +08:00
parent 1b21cc1f2b
commit 0364176e68
10 changed files with 12 additions and 28 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 408 KiB

After

Width:  |  Height:  |  Size: 408 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 152 KiB

After

Width:  |  Height:  |  Size: 152 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 162 KiB

After

Width:  |  Height:  |  Size: 162 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 352 KiB

After

Width:  |  Height:  |  Size: 352 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 258 KiB

After

Width:  |  Height:  |  Size: 258 KiB

View File

@ -18,8 +18,8 @@ app.on('window-all-closed', function() {
checkQuit() checkQuit()
}); });
function combineImages(images, outfile, width, height, background, padding){ function combineImages(images, outfile, width, height, doubleTrim){
var command = 'convert ' + images.join(' ') + ' -append -crop ' + width + 'x' + height + '+0+0 +repage -bordercolor #008000 -fuzz 5% -trim ' + outfile; var command = 'convert ' + images.join(' ') + ' -append -crop ' + width + 'x' + height + '+0+0 +repage -bordercolor #008000 -fuzz 5% -trim ' + (doubleTrim ? '-bordercolor ' + doubleTrim + ' -trim ' : '') + outfile;
console.log(command); console.log(command);
cp.exec(command, function(err, stdout, stderr){ cp.exec(command, function(err, stdout, stderr){
images.forEach(function(file){ images.forEach(function(file){
@ -51,7 +51,7 @@ var phases = {
for(var k = 0; k < j; k++){ for(var k = 0; k < j; k++){
images.push(argv.dir + '/' + rect.name + '.' + k + '.png') images.push(argv.dir + '/' + rect.name + '.' + k + '.png')
} }
combineImages(images, file, rect.windowWidth * rect.dpi, rect.height * rect.dpi, rect.background, rect.padding); combineImages(images, file, rect.windowWidth * rect.dpi, rect.height * rect.dpi, rect.doubleTrim);
} }
} }
function step(){ function step(){

View File

@ -506,8 +506,7 @@ if(window && window.process && window.process.type && process.versions['electron
name: options.name, name: options.name,
windowWidth: windowWidth, windowWidth: windowWidth,
windowHeight: windowHeight, windowHeight: windowHeight,
background: options.background || 'white', doubleTrim: options.doubleTrim,
padding: options.padding || 1,
dpi: dpi, dpi: dpi,
x: rect.left | 0, x: rect.left | 0,
y: rect.top | 0, y: rect.top | 0,
@ -527,51 +526,36 @@ if(window && window.process && window.process.type && process.versions['electron
var snapshotTasks = [ var snapshotTasks = [
{ {
el: document.querySelector('#languages'), el: document.querySelector('#languages'),
name: 'languages', name: 'languages'
background: 'white',
padding: 0
}, },
{ {
el: document.querySelector('#variants'), el: document.querySelector('#variants'),
name: 'variants', name: 'variants'
background: 'white',
padding: 0
}, },
{ {
el: document.querySelector('#opentype'), el: document.querySelector('#opentype'),
name: 'opentype', name: 'opentype'
background: 'white',
padding: 0
}, },
{ {
el: document.querySelector('#matrix'), el: document.querySelector('#matrix'),
name: 'matrix', name: 'matrix'
background: 'white',
padding: 0
}, },
{ {
el: document.querySelector('#family'), el: document.querySelector('#family'),
name: 'family', name: 'family'
background: 'white',
padding: 0
}, },
{ {
el: document.querySelector('#previews'), el: document.querySelector('#previews'),
name: 'preview-all', name: 'preview-all'
background: 'white',
padding: 0
}, },
{ {
el: document.querySelector('#weights'), el: document.querySelector('#weights'),
name: 'weights', name: 'weights'
background: 'white',
padding: 0
}, },
{ {
el: document.querySelector('#downloadoptions'), el: document.querySelector('#downloadoptions'),
name: 'download-options', name: 'download-options',
background: 'white', doubleTrim: 'white'
padding: 0
} }
] ]