Skip to content

Commit

Permalink
Merge pull request #28 from sebgroup/rename-svg-files
Browse files Browse the repository at this point in the history
optimize fonts
  • Loading branch information
ForkInSpace authored Sep 1, 2020
2 parents 8de7b77 + 3027b6e commit 49a48fd
Show file tree
Hide file tree
Showing 253 changed files with 321 additions and 542 deletions.
166 changes: 27 additions & 139 deletions projects/seb-pictograms/fonts/seb-light-pictograms.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified projects/seb-pictograms/fonts/seb-light-pictograms.woff
Binary file not shown.
Empty file.
166 changes: 27 additions & 139 deletions projects/seb-pictograms/fonts/seb-pictograms.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified projects/seb-pictograms/fonts/seb-pictograms.woff
Binary file not shown.
Empty file.
22 changes: 12 additions & 10 deletions projects/seb-pictograms/pictograms.scss
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
@font-face {
font-family: 'seb-pictograms';
src: url('fonts/seb-pictograms.eot?a7zwa4');
src: url('fonts/seb-pictograms.eot?a7zwa4#iefix') format('embedded-opentype'),
src: url('fonts/seb-pictograms.eot');
src: url('fonts/seb-pictograms.eot?#iefix') format('embedded-opentype'),
url('fonts/seb-pictograms.ttf?a7zwa4') format('truetype'),
url('fonts/seb-pictograms.woff?a7zwa4') format('woff'),
url('fonts/seb-pictograms.svg?a7zwa4#icomoon') format('svg');
url('fonts/seb-pictograms.woff2') format('woff2'),
url('fonts/seb-pictograms.woff') format('woff'),
url('fonts/seb-pictograms.svg#seb-iconsregular') format('svg');
font-weight: normal;
font-style: normal;
}

@font-face {
font-family: 'seb-light-pictograms';
src: url('fonts/seb-light-pictograms.eot?a7zwa4');
src: url('fonts/seb-light-pictograms.eot?a7zwa4#iefix') format('embedded-opentype'),
src: url('fonts/seb-light-pictograms.eot');
src: url('fonts/seb-light-pictograms.eot?#iefix') format('embedded-opentype'),
url('fonts/seb-light-pictograms.ttf?a7zwa4') format('truetype'),
url('fonts/seb-light-pictograms.woff?a7zwa4') format('woff'),
url('fonts/seb-light-pictograms.svg?a7zwa4#icomoon') format('svg');
url('fonts/seb-light-pictograms.woff2') format('woff2'),
url('fonts/seb-light-pictograms.woff') format('woff'),
url('fonts/seb-light-pictograms.svg#seb-light-iconsregular') format('svg');
font-weight: normal;
font-style: normal;
}
Expand All @@ -28,7 +30,7 @@
font-variant: normal;
text-transform: none;
line-height: 1;

/* Better Font Rendering =========== */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
Expand All @@ -50,4 +52,4 @@
content: #{'"\\' + map-get($item, code) + '"'};
}
}
}
}
4 changes: 2 additions & 2 deletions projects/seb-pictograms/scripts/compress-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ const directoryNames = getDirectories

// loop through the dir names and compress their contents
directoryNames.forEach((dir) => {
(async () => {
await imagemin([`../svg/${dir}/*.svg`], {
(() => {
imagemin([`../svg/${dir}/*.svg`], {
destination: `../svg/${dir}`,
plugins: [
imageminSvgo({
Expand Down
17 changes: 9 additions & 8 deletions projects/seb-pictograms/scripts/rename-files.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { readdirSync, rename, readFileSync } = require('fs');
const { readdirSync, readFileSync, renameSync } = require('fs');
const { resolve } = require('path');

// Load file names
Expand All @@ -12,17 +12,18 @@ const fileNames = JSON.parse(namesObjString)
})

// Get path to image directory
const imageDirPath = resolve(__dirname, '../svg/light');
const imageDirPath = resolve(__dirname, '../svg/regular');

// Get an array of the files inside the folder
const files = readdirSync(imageDirPath);

// Sort the array
const sortedFiles = files.sort(function(a, b){
return a.split("-")[0] - b.split("-")[0];
});

// Loop through each file and rename
files.forEach((fileName, indx) => rename(
sortedFiles.forEach((fileName, indx) => renameSync(
imageDirPath + `/${fileName}`,
imageDirPath + `/${fileNames[indx].toLowerCase()}.svg`,
err => {
if(err)
console.log(err);
}
imageDirPath + `/${fileNames[indx].toLowerCase()}.svg`
));
2 changes: 1 addition & 1 deletion projects/seb-pictograms/svg/light/address-book.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion projects/seb-pictograms/svg/light/arrow-up.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion projects/seb-pictograms/svg/light/balance-scale.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion projects/seb-pictograms/svg/light/bed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion projects/seb-pictograms/svg/light/bell.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion projects/seb-pictograms/svg/light/bike.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion projects/seb-pictograms/svg/light/briefcase.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion projects/seb-pictograms/svg/light/bulb.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion projects/seb-pictograms/svg/light/calculator.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion projects/seb-pictograms/svg/light/calendar.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion projects/seb-pictograms/svg/light/call.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion projects/seb-pictograms/svg/light/cancel.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion projects/seb-pictograms/svg/light/card-broken.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 49a48fd

Please sign in to comment.