Skip to content
This repository was archived by the owner on May 17, 2021. It is now read-only.

Commit 458449e

Browse files
authored
Remove akzidenz (#148)
* chore: remove akzidenz font assets COMPASS-4470 * chore: download akzidenz on install COMPASS-4470
1 parent b6e2286 commit 458449e

31 files changed

+75
-11518
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ coverage
1010
.nvmrc
1111
.nyc_output
1212
*.swp
13+
src/assets/fonts/akzid*

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"check": "mongodb-js-precommit './src/**/*{.js,.jsx}' './test/**/*.js' './electron/**/*.js' './config/**/*{.js,.jsx}'",
2121
"link-plugin": "./scripts/link.sh",
2222
"unlink-plugin": "./scripts/unlink.sh",
23-
"prepublishOnly": "npm run compile"
23+
"prepublishOnly": "npm run compile",
24+
"install": "node scripts/download-akzidenz.js"
2425
},
2526
"dependency-check": {
2627
"ignore": [
@@ -165,4 +166,4 @@
165166
"xvfb-maybe": "^0.2.1"
166167
},
167168
"dependencies": {}
168-
}
169+
}

scripts/download-akzidenz.js

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/* eslint-disable no-console */
2+
const path = require('path');
3+
const https = require('https');
4+
const fs = require('fs');
5+
const stream = require('stream');
6+
const util = require('util');
7+
const pipeline = util.promisify(stream.pipeline);
8+
9+
const download = (url, destDir) => {
10+
const destFileName = path.join(destDir, path.basename(url));
11+
const destFile = fs.createWriteStream(destFileName);
12+
console.log('Downloading', url, 'to', path.relative(process.cwd(), destFileName));
13+
14+
return new Promise((resolve) => {
15+
https.get(url, (response) => {
16+
resolve(pipeline(response, destFile));
17+
});
18+
});
19+
};
20+
21+
const AKZIDENZ_CDN_BASE_URL = 'https://d2va9gm4j17fy9.cloudfront.net/fonts/';
22+
const AKZIDENZ_CDN_URLS = [
23+
`${AKZIDENZ_CDN_BASE_URL}/akzidgrostdita.eot`,
24+
`${AKZIDENZ_CDN_BASE_URL}/akzidgrostdita.svg`,
25+
`${AKZIDENZ_CDN_BASE_URL}/akzidgrostdita.ttf`,
26+
`${AKZIDENZ_CDN_BASE_URL}/akzidgrostdita.woff`,
27+
`${AKZIDENZ_CDN_BASE_URL}/akzidgrostdlig.eot`,
28+
`${AKZIDENZ_CDN_BASE_URL}/akzidgrostdlig.svg`,
29+
`${AKZIDENZ_CDN_BASE_URL}/akzidgrostdlig.ttf`,
30+
`${AKZIDENZ_CDN_BASE_URL}/akzidgrostdlig.woff`,
31+
`${AKZIDENZ_CDN_BASE_URL}/akzidgrostdligcnd.eot`,
32+
`${AKZIDENZ_CDN_BASE_URL}/akzidgrostdligcnd.svg`,
33+
`${AKZIDENZ_CDN_BASE_URL}/akzidgrostdligcnd.ttf`,
34+
`${AKZIDENZ_CDN_BASE_URL}/akzidgrostdligcnd.woff`,
35+
`${AKZIDENZ_CDN_BASE_URL}/akzidgrostdligita.eot`,
36+
`${AKZIDENZ_CDN_BASE_URL}/akzidgrostdligita.svg`,
37+
`${AKZIDENZ_CDN_BASE_URL}/akzidgrostdligita.ttf`,
38+
`${AKZIDENZ_CDN_BASE_URL}/akzidgrostdligita.woff`,
39+
`${AKZIDENZ_CDN_BASE_URL}/akzidgrostdmed.eot`,
40+
`${AKZIDENZ_CDN_BASE_URL}/akzidgrostdmed.svg`,
41+
`${AKZIDENZ_CDN_BASE_URL}/akzidgrostdmed.ttf`,
42+
`${AKZIDENZ_CDN_BASE_URL}/akzidgrostdmed.woff`,
43+
`${AKZIDENZ_CDN_BASE_URL}/akzidgrostdmedita.eot`,
44+
`${AKZIDENZ_CDN_BASE_URL}/akzidgrostdmedita.svg`,
45+
`${AKZIDENZ_CDN_BASE_URL}/akzidgrostdmedita.ttf`,
46+
`${AKZIDENZ_CDN_BASE_URL}/akzidgrostdmedita.woff`,
47+
`${AKZIDENZ_CDN_BASE_URL}/akzidgrostdreg.eot`,
48+
`${AKZIDENZ_CDN_BASE_URL}/akzidgrostdreg.svg`,
49+
`${AKZIDENZ_CDN_BASE_URL}/akzidgrostdreg.ttf`,
50+
`${AKZIDENZ_CDN_BASE_URL}/akzidgrostdreg.wof`
51+
];
52+
53+
const FONTS_DIRECTORY = path.resolve(
54+
__dirname,
55+
'..',
56+
'src',
57+
'assets',
58+
'fonts'
59+
);
60+
61+
(async() => {
62+
await Promise.all(
63+
AKZIDENZ_CDN_URLS.map(url => download(url, FONTS_DIRECTORY))
64+
);
65+
})().catch((err) => {
66+
if (err) {
67+
console.error(err);
68+
}
69+
70+
process.exit(1);
71+
});
-31 KB
Binary file not shown.

src/assets/fonts/akzidgrostdita.svg

Lines changed: 0 additions & 1862 deletions
This file was deleted.
-78.4 KB
Binary file not shown.
-33.4 KB
Binary file not shown.
-28.6 KB
Binary file not shown.

src/assets/fonts/akzidgrostdlig.svg

Lines changed: 0 additions & 1886 deletions
This file was deleted.
-71.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)