diff options
-rw-r--r-- | gulpfile.js | 19 | ||||
-rw-r--r-- | src/_icons/a-b.svg | 2 | ||||
-rw-r--r-- | src/_icons/brand-behance.svg | 2 | ||||
-rw-r--r-- | src/_icons/brand-codepen.svg | 8 | ||||
-rw-r--r-- | src/_icons/brand-medium.svg | 8 | ||||
-rw-r--r-- | src/_icons/brightness.svg | 6 | ||||
-rw-r--r-- | src/_icons/comet.svg | 6 | ||||
-rw-r--r-- | src/_icons/eraser.svg | 2 | ||||
-rw-r--r-- | src/_icons/exposure.svg | 2 | ||||
-rw-r--r-- | src/_icons/letter-a.svg | 2 | ||||
-rw-r--r-- | src/_icons/letter-b.svg | 2 | ||||
-rw-r--r-- | src/_icons/letter-e.svg | 2 | ||||
-rw-r--r-- | src/_icons/letter-f.svg | 2 | ||||
-rw-r--r-- | src/_icons/letter-h.svg | 6 | ||||
-rw-r--r-- | src/_icons/letter-i.svg | 2 | ||||
-rw-r--r-- | src/_icons/letter-k.svg | 4 | ||||
-rw-r--r-- | src/_icons/letter-q.svg | 2 | ||||
-rw-r--r-- | src/_icons/letter-r.svg | 2 | ||||
-rw-r--r-- | src/_icons/letter-t.svg | 4 | ||||
-rw-r--r-- | src/_icons/letter-x.svg | 4 | ||||
-rw-r--r-- | src/_icons/letter-y.svg | 2 | ||||
-rw-r--r-- | src/_icons/pill.svg | 2 | ||||
-rw-r--r-- | src/_icons/scooter.svg | 2 | ||||
-rw-r--r-- | src/_icons/social.svg | 4 | ||||
-rw-r--r-- | src/_icons/tractor.svg | 2 | ||||
-rw-r--r-- | src/_icons/truck-return.svg | 2 |
26 files changed, 59 insertions, 42 deletions
diff --git a/gulpfile.js b/gulpfile.js index 43c55a77..79535baa 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -399,6 +399,10 @@ gulp.task('icons-stroke', gulp.series('build-jekyll', function (cb) { })); gulp.task('optimize', function (cb) { + const addFloats = function(n1, n2) { + return Math.round((parseFloat(n1) + parseFloat(n2)) * 1000) / 1000 + }; + glob("src/_icons/*.svg", {}, function (er, files) { files.forEach(function (file, i) { @@ -412,7 +416,20 @@ gulp.task('optimize', function (cb) { .replace(/\n\s*<(line|circle|path|polyline|rect)/g, "\n <$1") .replace(/polyline points="([0-9.]+)\s([0-9.]+)\s([0-9.]+)\s([0-9.]+)"/g, 'line x1="$1" y1="$2" x2="$3" y2="$4"') .replace(/a\s?([0-9.]+)\s([0-9.]+)\s([0-9.]+)\s?([0-1])\s?([0-1])\s?(-?[0-9.]+)\s?(-?[0-9.]+)/g, 'a$1 $2 $3 $4 $5 $6 $7') - .replace(/\n\n+/g, "\n"); + .replace(/\n\n+/g, "\n") + + .replace(/<path d="M([0-9.]*) ([0-9.]*)l([-0-9.]*) ([-0-9.]*)"/g, function(f, r1, r2, r3, r4){ + return `<line x1="${r1}" y1="${r2}" x2="${addFloats(r1, r3)}" y2="${addFloats(r2, r4)}"`; + }) + .replace(/<path d="M([0-9.]*) ([0-9.]*)v([0-9.]*)"/g, function(f, r1, r2, r3){ + return `<line x1="${r1}" y1="${r2}" x2="${r1}" y2="${addFloats(r2, r3)}"`; + }) + .replace(/<path d="M([0-9.]*) ([0-9.]*)h([0-9.]*)"/g, function(f, r1, r2, r3){ + return `<line x1="${r1}" y1="${r2}" x2="${addFloats(r1, r3)}" y2="${r2}"`; + }); + + // + // if(svgFile.toString() !== svgFileContent) { fs.writeFileSync(file, svgFileContent); diff --git a/src/_icons/a-b.svg b/src/_icons/a-b.svg index 38683e71..2ff7f2bd 100644 --- a/src/_icons/a-b.svg +++ b/src/_icons/a-b.svg @@ -2,6 +2,6 @@ --- <svg> <path d="M3 16v-5.5a2.5 2.5 0 0 1 5 0v5.5m0 -4h-5" /> - <path d="M12 6v12" /> + <line x1="12" y1="6" x2="12" y2="18" /> <path d="M16 16v-8h3a2 2 0 0 1 0 4h-3m3 0a2 2 0 0 1 0 4h-3" /> </svg> diff --git a/src/_icons/brand-behance.svg b/src/_icons/brand-behance.svg index 155dd52d..a5f9a553 100644 --- a/src/_icons/brand-behance.svg +++ b/src/_icons/brand-behance.svg @@ -3,7 +3,7 @@ category: Brand --- <svg> <path d="M3 18v-12h4.5a3 3 0 0 1 0 6a3 3 0 0 1 0 6h-4.5" /> - <line x1="3" y1="12" x2="7" y2="12" /> + <line x1="3" y1="12" x2="7.5" y2="12" /> <path d="M14 13h7a3.5 3.5 0 0 0 -7 0v2a3.5 3.5 0 0 0 6.64 1" /> <line x1="16" y1="6" x2="19" y2="6" /> </svg> diff --git a/src/_icons/brand-codepen.svg b/src/_icons/brand-codepen.svg index 7a4cbfb8..10c3830c 100644 --- a/src/_icons/brand-codepen.svg +++ b/src/_icons/brand-codepen.svg @@ -4,8 +4,8 @@ category: Brand <svg> <path d="M3 15l9 6l9 -6l-9 -6l-9 6" /> <path d="M3 9l9 6l9 -6l-9 -6l-9 6" /> - <path d="M3 9v6" /> - <path d="M21 9v6" /> - <path d="M12 3v6" /> - <path d="M12 15v6" /> + <line x1="3" y1="9" x2="3" y2="15" /> + <line x1="21" y1="9" x2="21" y2="15" /> + <line x1="12" y1="3" x2="12" y2="9" /> + <line x1="12" y1="15" x2="12" y2="21" /> </svg> diff --git a/src/_icons/brand-medium.svg b/src/_icons/brand-medium.svg index ee33f53e..02544b86 100644 --- a/src/_icons/brand-medium.svg +++ b/src/_icons/brand-medium.svg @@ -4,8 +4,8 @@ category: Brand <svg> <rect x="4" y="4" width="16" height="16" rx="2" /> <path d="M8 9h1l3 3l3 -3h1" /> - <path d="M8 15h2" /> - <path d="M14 15h2" /> - <path d="M9 9v6" /> - <path d="M15 9v6" /> + <line x1="8" y1="15" x2="10" y2="15" /> + <line x1="14" y1="15" x2="16" y2="15" /> + <line x1="9" y1="9" x2="9" y2="15" /> + <line x1="15" y1="9" x2="15" y2="15" /> </svg> diff --git a/src/_icons/brightness.svg b/src/_icons/brightness.svg index a8b52eb5..2d8f479c 100644 --- a/src/_icons/brightness.svg +++ b/src/_icons/brightness.svg @@ -4,7 +4,7 @@ tags: [light, dark, screen] <svg> <circle cx="12" cy="12" r="9" /> <line x1="12" y1="3" x2="12" y2="21" /> - <path d="M12 9l4.65 -4.65" /> - <path d="M12 14.3l7.37 -7.37" /> - <path d="M12 19.6l8.85 -8.85" /> + <line x1="12" y1="9" x2="16.65" y2="4.35" /> + <line x1="12" y1="14.3" x2="19.37" y2="6.93" /> + <line x1="12" y1="19.6" x2="20.85" y2="10.75" /> </svg> diff --git a/src/_icons/comet.svg b/src/_icons/comet.svg index 3ceb71c5..5995f2bb 100644 --- a/src/_icons/comet.svg +++ b/src/_icons/comet.svg @@ -3,7 +3,7 @@ category: Weather --- <svg> <path d="M15.5 18.5l-3 1.5l.5-3.5-2-2 3-.5 1.5-3 1.5 3 3 .5-2 2 .5 3.5z" /> - <path d="M4 4l7 7" /> - <path d="M9 4l3.5 3.5" /> - <path d="M4 9l3.5 3.5" /> + <line x1="4" y1="4" x2="11" y2="11" /> + <line x1="9" y1="4" x2="12.5" y2="7.5" /> + <line x1="4" y1="9" x2="7.5" y2="12.5" /> </svg> diff --git a/src/_icons/eraser.svg b/src/_icons/eraser.svg index 46b1434c..3a34e94a 100644 --- a/src/_icons/eraser.svg +++ b/src/_icons/eraser.svg @@ -3,5 +3,5 @@ tags: [delete, remove, eliminate, wipe-out] --- <svg> <path d="M19 19h-11l-4 -4a1 1 0 0 1 0 -1.41l10 -10a1 1 0 0 1 1.41 0l5 5a1 1 0 0 1 0 1.41l-9 9" /> - <path d="M18 12.3l-6.3 -6.3" /> + <line x1="18" y1="12.3" x2="11.7" y2="6" /> </svg> diff --git a/src/_icons/exposure.svg b/src/_icons/exposure.svg index 39ce4432..a256bcb3 100644 --- a/src/_icons/exposure.svg +++ b/src/_icons/exposure.svg @@ -5,5 +5,5 @@ tags: [light, bright, dark, camera] <rect x="4" y="4" width="16" height="16" rx="2" /> <line x1="4.6" y1="19.4" x2="19.4" y2="4.6" /> <path d="M7 9h4m-2 -2v4" /> - <path d="M13 16h4" /> + <line x1="13" y1="16" x2="17" y2="16" /> </svg> diff --git a/src/_icons/letter-a.svg b/src/_icons/letter-a.svg index 0f6546e9..ceb6c947 100644 --- a/src/_icons/letter-a.svg +++ b/src/_icons/letter-a.svg @@ -3,5 +3,5 @@ category: Letters --- <svg> <path d="M7 20v-12a4 4 0 0 1 4 -4h2a4 4 0 0 1 4 4v12" /> - <path d="M7 13h10" /> + <line x1="7" y1="13" x2="17" y2="13" /> </svg> diff --git a/src/_icons/letter-b.svg b/src/_icons/letter-b.svg index 11e49c98..5b24bb6b 100644 --- a/src/_icons/letter-b.svg +++ b/src/_icons/letter-b.svg @@ -3,5 +3,5 @@ category: Letters --- <svg> <path d="M7 20v-16h6a4 4 0 0 1 0 8a4 4 0 0 1 0 8h-6" /> - <path d="M7 12h6" /> + <line x1="7" y1="12" x2="13" y2="12" /> </svg> diff --git a/src/_icons/letter-e.svg b/src/_icons/letter-e.svg index f272e8a2..0e39e6fd 100644 --- a/src/_icons/letter-e.svg +++ b/src/_icons/letter-e.svg @@ -3,5 +3,5 @@ category: Letters --- <svg> <path d="M17 4h-10v16h10" /> - <path d="M7 12h8" /> + <line x1="7" y1="12" x2="15" y2="12" /> </svg> diff --git a/src/_icons/letter-f.svg b/src/_icons/letter-f.svg index 60686471..2f32c0bc 100644 --- a/src/_icons/letter-f.svg +++ b/src/_icons/letter-f.svg @@ -3,5 +3,5 @@ category: Letters --- <svg> <path d="M17 4h-10v16" /> - <path d="M7 12h8" /> + <line x1="7" y1="12" x2="15" y2="12" /> </svg> diff --git a/src/_icons/letter-h.svg b/src/_icons/letter-h.svg index dfd22167..4f070165 100644 --- a/src/_icons/letter-h.svg +++ b/src/_icons/letter-h.svg @@ -2,7 +2,7 @@ category: Letters --- <svg> - <path d="M17 4v16" /> - <path d="M7 12h10" /> - <path d="M7 4v16" /> + <line x1="17" y1="4" x2="17" y2="20" /> + <line x1="7" y1="12" x2="17" y2="12" /> + <line x1="7" y1="4" x2="7" y2="20" /> </svg> diff --git a/src/_icons/letter-i.svg b/src/_icons/letter-i.svg index d03470ec..665e6d35 100644 --- a/src/_icons/letter-i.svg +++ b/src/_icons/letter-i.svg @@ -2,5 +2,5 @@ category: Letters --- <svg> - <path d="M12 4v16" /> + <line x1="12" y1="4" x2="12" y2="20" /> </svg> diff --git a/src/_icons/letter-k.svg b/src/_icons/letter-k.svg index c59a1334..83ecb744 100644 --- a/src/_icons/letter-k.svg +++ b/src/_icons/letter-k.svg @@ -2,7 +2,7 @@ category: Letters --- <svg> - <path d="M7 4v16" /> + <line x1="7" y1="4" x2="7" y2="20" /> <path d="M7 12h2l8 -8" /> - <path d="M9 12l8 8" /> + <line x1="9" y1="12" x2="17" y2="20" /> </svg> diff --git a/src/_icons/letter-q.svg b/src/_icons/letter-q.svg index 288bffde..66b248f0 100644 --- a/src/_icons/letter-q.svg +++ b/src/_icons/letter-q.svg @@ -3,5 +3,5 @@ category: Letters --- <svg> <path d="M18 9a5 5 0 0 0 -5 -5h-2a5 5 0 0 0 -5 5v6a5 5 0 0 0 5 5h2a5 5 0 0 0 5 -5v-6" /> - <path d="M13 15l5 5" /> + <line x1="13" y1="15" x2="18" y2="20" /> </svg> diff --git a/src/_icons/letter-r.svg b/src/_icons/letter-r.svg index 5d3dc5eb..28e25057 100644 --- a/src/_icons/letter-r.svg +++ b/src/_icons/letter-r.svg @@ -3,5 +3,5 @@ category: Letters --- <svg> <path d="M7 20v-16h5.5a4 4 0 0 1 0 9h-5.5" /> - <path d="M12 13l5 7" /> + <line x1="12" y1="13" x2="17" y2="20" /> </svg> diff --git a/src/_icons/letter-t.svg b/src/_icons/letter-t.svg index 84e84f24..f336b6f9 100644 --- a/src/_icons/letter-t.svg +++ b/src/_icons/letter-t.svg @@ -2,6 +2,6 @@ category: Letters --- <svg> - <path d="M6 4h12" /> - <path d="M12 4v16" /> + <line x1="6" y1="4" x2="18" y2="4" /> + <line x1="12" y1="4" x2="12" y2="20" /> </svg> diff --git a/src/_icons/letter-x.svg b/src/_icons/letter-x.svg index 4549348d..53b12ca5 100644 --- a/src/_icons/letter-x.svg +++ b/src/_icons/letter-x.svg @@ -2,6 +2,6 @@ category: Letters --- <svg> - <path d="M7 4l10 16" /> - <path d="M17 4l-10 16" /> + <line x1="7" y1="4" x2="17" y2="20" /> + <line x1="17" y1="4" x2="7" y2="20" /> </svg> diff --git a/src/_icons/letter-y.svg b/src/_icons/letter-y.svg index 009430a4..19ef0249 100644 --- a/src/_icons/letter-y.svg +++ b/src/_icons/letter-y.svg @@ -3,5 +3,5 @@ category: Letters --- <svg> <path d="M7 4l5 9l5 -9" /> - <path d="M12 13v7" /> + <line x1="12" y1="13" x2="12" y2="20" /> </svg> diff --git a/src/_icons/pill.svg b/src/_icons/pill.svg index e831dd70..b733d4f6 100644 --- a/src/_icons/pill.svg +++ b/src/_icons/pill.svg @@ -3,5 +3,5 @@ tags: [drug, medication, illness, sickness, doctor, prescription] --- <svg> <path d="M4.5 12.5l8 -8a4.94 4.94 0 0 1 7 7l-8 8a4.94 4.94 0 0 1 -7 -7" /> - <path d="M8.5 8.5l7 7" /> + <line x1="8.5" y1="8.5" x2="15.5" y2="15.5" /> </svg> diff --git a/src/_icons/scooter.svg b/src/_icons/scooter.svg index 89f0f31e..2078f169 100644 --- a/src/_icons/scooter.svg +++ b/src/_icons/scooter.svg @@ -5,5 +5,5 @@ category: Vehicles <svg> <circle cx="18" cy="17" r="2" /> <path d="M5 16v1a2 2 0 0 0 4 0v-5h-3a3 3 0 0 0 -3 3v1h10a6 6 0 0 1 5 -4v-5a2 2 0 0 0 -2 -2h-1" /> - <path d="M6 9h3" /> + <line x1="6" y1="9" x2="9" y2="9" /> </svg> diff --git a/src/_icons/social.svg b/src/_icons/social.svg index b53b7285..834f9e2c 100644 --- a/src/_icons/social.svg +++ b/src/_icons/social.svg @@ -6,6 +6,6 @@ <circle cx="19" cy="19" r="2" /> <circle cx="12" cy="14" r="3" /> <line x1="12" y1="7" x2="12" y2="11" /> - <path d="M6.7 17.8l2.8 -2" /> - <path d="M17.3 17.8l-2.8 -2" /> + <line x1="6.7" y1="17.8" x2="9.5" y2="15.8" /> + <line x1="17.3" y1="17.8" x2="14.5" y2="15.8" /> </svg> diff --git a/src/_icons/tractor.svg b/src/_icons/tractor.svg index 3ce3e9cb..e03f3a87 100644 --- a/src/_icons/tractor.svg +++ b/src/_icons/tractor.svg @@ -5,7 +5,7 @@ category: Vehicles <circle cx="7" cy="15" r="4" /> <line x1="7" y1="15" x2="7" y2="15.01" /> <circle cx="19" cy="17" r="2" /> - <path d="M10.5 17h6.5" /> + <line x1="10.5" y1="17" x2="17" y2="17" /> <path d="M20 15.2v-4.2a1 1 0 0 0 -1 -1h-6l-2 -5h-6v6.5" /> <path d="M18 5h-1a1 1 0 0 0 -1 1v4" /> </svg> diff --git a/src/_icons/truck-return.svg b/src/_icons/truck-return.svg index 16fcca91..6022f2fc 100644 --- a/src/_icons/truck-return.svg +++ b/src/_icons/truck-return.svg @@ -5,6 +5,6 @@ category: Vehicles <circle cx="7" cy="17" r="2" /> <circle cx="17" cy="17" r="2" /> <path d="M5 17h-2v-11a1 1 0 0 1 1 -1h9v6h-5l2 2m0 -4l-2 2" /> - <path d="M9 17h6" /> + <line x1="9" y1="17" x2="15" y2="17" /> <path d="M13 6h5l3 5v6h-2" /> </svg> |