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

Commit 4f5c87a

Browse files
authored
Remove akzidenz (#138)
* chore: remove akzidenz font assets COMPASS-4470 * chore: download akzidenz on install COMPASS-4470 * fix util
1 parent ba54730 commit 4f5c87a

31 files changed

+76
-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
@@ -25,7 +25,8 @@
2525
"check": "mongodb-js-precommit './src/**/*{.js,.jsx}' './test/**/*.js' './electron/**/*.js' './config/**/*{.js,.jsx}'",
2626
"link-plugin": "./scripts/link.sh",
2727
"unlink-plugin": "./scripts/unlink.sh",
28-
"prepublishOnly": "npm run compile"
28+
"prepublishOnly": "npm run compile",
29+
"install": "node scripts/download-akzidenz.js"
2930
},
3031
"precommit": [
3132
"check"
@@ -194,4 +195,4 @@
194195
"lodash.isempty": "^4.4.0",
195196
"react-sortable-hoc": "^1.10.1"
196197
}
197-
}
198+
}

scripts/download-akzidenz.js

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