Skip to content

Commit

Permalink
Generic Rebuild v3 (#115)
Browse files Browse the repository at this point in the history
* feat: generate weight CSS files directly and major refactor

* fix: css file generation since glob is an async function

* fix: pass variable flag into metadata

* docs: update to match new import format

* chore: apply new generic changes to packages

Co-authored-by: Lotus <DecliningLotus@users.noreply.github.com>
  • Loading branch information
ayuhito and Lotus committed Dec 22, 2020
1 parent 13b1990 commit 4f75799
Show file tree
Hide file tree
Showing 506 changed files with 1,710 additions and 2,849 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -30,7 +30,7 @@
"format:scripts": "prettier --write ./scripts/**/*.{js,jsx,json,md}",
"format:eslint": "eslint **/*.{js,jsx} --fix",
"format:prettier": "prettier --write **/*.{js,jsx,json,md}",
"build:generic": "node scripts/generic/generic-font-packager.js",
"build:generic": "node scripts/generic/build.js",
"build:google": "node scripts/google/download-google.js",
"build:google-force": "node scripts/google/download-google.js force",
"parser:v1": "npm explore google-font-metadata -- yarn parser:v1",
Expand Down
10 changes: 10 additions & 0 deletions packages/aileron/100-italic.css
@@ -0,0 +1,10 @@
/* aileron-latin-100-italic*/
@font-face {
font-family: 'Aileron';
font-style: italic;
font-display: swap;
font-weight: 100;
src:
url('./files/aileron-latin-100-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./files/aileron-latin-100-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
File renamed without changes.
10 changes: 10 additions & 0 deletions packages/aileron/300-italic.css
@@ -0,0 +1,10 @@
/* aileron-latin-300-italic*/
@font-face {
font-family: 'Aileron';
font-style: italic;
font-display: swap;
font-weight: 300;
src:
url('./files/aileron-latin-300-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./files/aileron-latin-300-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
File renamed without changes.
10 changes: 10 additions & 0 deletions packages/aileron/400-italic.css
@@ -0,0 +1,10 @@
/* aileron-latin-400-italic*/
@font-face {
font-family: 'Aileron';
font-style: italic;
font-display: swap;
font-weight: 400;
src:
url('./files/aileron-latin-400-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./files/aileron-latin-400-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
File renamed without changes.
10 changes: 10 additions & 0 deletions packages/aileron/600-italic.css
@@ -0,0 +1,10 @@
/* aileron-latin-600-italic*/
@font-face {
font-family: 'Aileron';
font-style: italic;
font-display: swap;
font-weight: 600;
src:
url('./files/aileron-latin-600-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./files/aileron-latin-600-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
File renamed without changes.
10 changes: 10 additions & 0 deletions packages/aileron/700-italic.css
@@ -0,0 +1,10 @@
/* aileron-latin-700-italic*/
@font-face {
font-family: 'Aileron';
font-style: italic;
font-display: swap;
font-weight: 700;
src:
url('./files/aileron-latin-700-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./files/aileron-latin-700-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
File renamed without changes.
10 changes: 10 additions & 0 deletions packages/aileron/800-italic.css
@@ -0,0 +1,10 @@
/* aileron-latin-800-italic*/
@font-face {
font-family: 'Aileron';
font-style: italic;
font-display: swap;
font-weight: 800;
src:
url('./files/aileron-latin-800-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./files/aileron-latin-800-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
File renamed without changes.
26 changes: 18 additions & 8 deletions packages/aileron/README.md
Expand Up @@ -15,29 +15,27 @@ yarn add fontsource-aileron // npm install fontsource-aileron
Then within your app entry file or site component, import it in. For example in Gatsby, you could choose to import it into a layout template (`layout.js`), page component (`index.js`), or `gatsby-browser.js`.

```javascript
import "fontsource-aileron" // Defaults to weight 400 with all styles included.
import "fontsource-aileron" // Defaults to weight 400.
```

Fontsource allows you to select font subsets, weights and even individual styles, allowing you to cut down on payload sizes to the last byte! The default selection above, however, sticks to the Latin subset including all weights and styles.
Fontsource allows you to select weights and even individual styles, allowing you to cut down on payload sizes to the last byte! Utilizing the CSS unicode-range selector, all language subsets are accounted for.

```javascript
import "fontsource-aileron/latin-ext.css" // All weights and styles included.
import "fontsource-aileron/cyrillic-ext-400.css" // All styles included.
import "fontsource-aileron/greek-700-normal.css" // Select either normal or italic.
import "fontsource-aileron/500.css" // Weight 500.
import "fontsource-aileron/900-italic.css" // Italic variant.
```

Alternatively, the same solutions could be imported via SCSS!

```scss
@import "~fontsource-aileron/index.css";
@import "~fontsource-aileron/vietnamese-300-italic.css";
@import "~fontsource-aileron/index.css"; // Weight 400.
@import "~fontsource-aileron/300-italic.css";
```

_These examples may not reflect actual compatibility. Please refer below._

Supported variables:

- Subsets: `[latin]`
- Weights: `[100,300,400,600,700,800]`
- Styles: `[italic,normal]`

Expand All @@ -49,6 +47,18 @@ body {
}
```

## Additional Options

In the rare case you need to individually select a language subset and not utilize the CSS unicode-range selector, you may specify the import as follows. This is especially not recommended for languages, such as Japanese, with a large amount of characters.

```javascript
import "fontsource-aileron/latin-ext.css" // All weights with normal style included.
import "fontsource-aileron/cyrillic-ext-500.css" // Weight 500 with normal style.
import "fontsource-aileron/greek-900-normal.css" // Italic variant.
```

- Supported subsets: `[latin]`

## Licensing

It is important to always read the license for every font that you use.
Expand Down
10 changes: 0 additions & 10 deletions packages/aileron/index.css
@@ -1,13 +1,3 @@
/* aileron-latin-400-italic*/
@font-face {
font-family: 'Aileron';
font-style: italic;
font-display: swap;
font-weight: 400;
src:
url('./files/aileron-latin-400-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./files/aileron-latin-400-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* aileron-latin-400-normal*/
@font-face {
font-family: 'Aileron';
Expand Down
10 changes: 0 additions & 10 deletions packages/aileron/latin-100.css
@@ -1,13 +1,3 @@
/* aileron-latin-100-italic*/
@font-face {
font-family: 'Aileron';
font-style: italic;
font-display: swap;
font-weight: 100;
src:
url('./files/aileron-latin-100-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./files/aileron-latin-100-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* aileron-latin-100-normal*/
@font-face {
font-family: 'Aileron';
Expand Down
10 changes: 0 additions & 10 deletions packages/aileron/latin-300.css
@@ -1,13 +1,3 @@
/* aileron-latin-300-italic*/
@font-face {
font-family: 'Aileron';
font-style: italic;
font-display: swap;
font-weight: 300;
src:
url('./files/aileron-latin-300-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./files/aileron-latin-300-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* aileron-latin-300-normal*/
@font-face {
font-family: 'Aileron';
Expand Down
10 changes: 0 additions & 10 deletions packages/aileron/latin-400.css
@@ -1,13 +1,3 @@
/* aileron-latin-400-italic*/
@font-face {
font-family: 'Aileron';
font-style: italic;
font-display: swap;
font-weight: 400;
src:
url('./files/aileron-latin-400-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./files/aileron-latin-400-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* aileron-latin-400-normal*/
@font-face {
font-family: 'Aileron';
Expand Down
10 changes: 0 additions & 10 deletions packages/aileron/latin-600.css
@@ -1,13 +1,3 @@
/* aileron-latin-600-italic*/
@font-face {
font-family: 'Aileron';
font-style: italic;
font-display: swap;
font-weight: 600;
src:
url('./files/aileron-latin-600-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./files/aileron-latin-600-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* aileron-latin-600-normal*/
@font-face {
font-family: 'Aileron';
Expand Down
10 changes: 0 additions & 10 deletions packages/aileron/latin-700.css
@@ -1,13 +1,3 @@
/* aileron-latin-700-italic*/
@font-face {
font-family: 'Aileron';
font-style: italic;
font-display: swap;
font-weight: 700;
src:
url('./files/aileron-latin-700-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./files/aileron-latin-700-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* aileron-latin-700-normal*/
@font-face {
font-family: 'Aileron';
Expand Down
10 changes: 0 additions & 10 deletions packages/aileron/latin-800.css
@@ -1,13 +1,3 @@
/* aileron-latin-800-italic*/
@font-face {
font-family: 'Aileron';
font-style: italic;
font-display: swap;
font-weight: 800;
src:
url('./files/aileron-latin-800-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('./files/aileron-latin-800-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* aileron-latin-800-normal*/
@font-face {
font-family: 'Aileron';
Expand Down
14 changes: 1 addition & 13 deletions packages/aileron/metadata.json
@@ -1,13 +1 @@
{
"fontId": "aileron",
"fontName": "Aileron",
"subsets": ["latin"],
"weights": ["100", "300", "400", "600", "700", "800"],
"styles": ["italic", "normal"],
"defSubset": "latin",
"lastModified": "2020-11-26",
"version": "v0.102",
"source": "http://dotcolon.net/font/aileron/",
"license": "https://creativecommons.org/publicdomain/zero/1.0/deed.en",
"type": "other"
}
{"fontId":"aileron","fontName":"Aileron","subsets":["latin"],"weights":["100","300","400","600","700","800"],"styles":["italic","normal"],"defSubset":"latin","variable":false,"lastModified":"2020-11-26","version":"v0.102","source":"http://dotcolon.net/font/aileron/","license":"https://creativecommons.org/publicdomain/zero/1.0/deed.en","type":"other"}
File renamed without changes.
28 changes: 19 additions & 9 deletions packages/blackout-midnight/README.md
Expand Up @@ -12,32 +12,30 @@ Fontsource assumes you are using a bundler, such as Webpack, to load in CSS. Sol
yarn add fontsource-blackout-midnight // npm install fontsource-blackout-midnight
```

Then within your app entry file or site component, import it in. For example in Gatsby, you could choose to import it into a layout template (`layout.js`), page component, or `gatsby-browser.js`.
Then within your app entry file or site component, import it in. For example in Gatsby, you could choose to import it into a layout template (`layout.js`), page component (`index.js`), or `gatsby-browser.js`.

```javascript
import "fontsource-blackout-midnight" // Defaults to weight 400 with all styles included.
import "fontsource-blackout-midnight" // Defaults to weight 400.
```

Fontsource allows you to select font subsets, weights and even individual styles, allowing you to cut down on payload sizes to the last byte! The default selection above, however, sticks to the Latin subset including all weights and styles.
Fontsource allows you to select weights and even individual styles, allowing you to cut down on payload sizes to the last byte! Utilizing the CSS unicode-range selector, all language subsets are accounted for.

```javascript
import "fontsource-blackout-midnight/latin-ext.css" // All weights and styles included.
import "fontsource-blackout-midnight/cyrillic-ext-400.css" // All styles included.
import "fontsource-blackout-midnight/greek-700-normal.css" // Select either normal or italic.
import "fontsource-blackout-midnight/500.css" // Weight 500.
import "fontsource-blackout-midnight/900-italic.css" // Italic variant.
```

Alternatively, the same solutions could be imported via SCSS!

```scss
@import "~fontsource-blackout-midnight/index.css";
@import "~fontsource-blackout-midnight/vietnamese-300-italic.css";
@import "~fontsource-blackout-midnight/index.css"; // Weight 400.
@import "~fontsource-blackout-midnight/300-italic.css";
```

_These examples may not reflect actual compatibility. Please refer below._

Supported variables:

- Subsets: `[latin]`
- Weights: `[400]`
- Styles: `[normal]`

Expand All @@ -49,6 +47,18 @@ body {
}
```

## Additional Options

In the rare case you need to individually select a language subset and not utilize the CSS unicode-range selector, you may specify the import as follows. This is especially not recommended for languages, such as Japanese, with a large amount of characters.

```javascript
import "fontsource-blackout-midnight/latin-ext.css" // All weights with normal style included.
import "fontsource-blackout-midnight/cyrillic-ext-500.css" // Weight 500 with normal style.
import "fontsource-blackout-midnight/greek-900-normal.css" // Italic variant.
```

- Supported subsets: `[latin]`

## Licensing

It is important to always read the license for every font that you use.
Expand Down
14 changes: 1 addition & 13 deletions packages/blackout-midnight/metadata.json
@@ -1,13 +1 @@
{
"fontId": "blackout-midnight",
"fontName": "Blackout Midnight",
"subsets": ["latin"],
"weights": ["400"],
"styles": ["normal"],
"defSubset": "latin",
"lastModified": "2020-08-02",
"version": "v1",
"source": "https://github.com/theleagueof/blackout",
"license": "https://github.com/theleagueof/blackout/blob/master/Open%20Font%20License.markdown",
"type": "league"
}
{"fontId":"blackout-midnight","fontName":"Blackout Midnight","subsets":["latin"],"weights":["400"],"styles":["normal"],"defSubset":"latin","variable":false,"lastModified":"2020-08-02","version":"v1","source":"https://github.com/theleagueof/blackout","license":"https://github.com/theleagueof/blackout/blob/master/Open%20Font%20License.markdown","type":"league"}
6 changes: 3 additions & 3 deletions packages/blackout-midnight/package.json
Expand Up @@ -11,7 +11,8 @@
"blackout-midnight",
"css",
"front-end",
"web"
"web",
"typeface"
],
"author": "Lotus <declininglotus@gmail.com>",
"license": "MIT",
Expand All @@ -20,6 +21,5 @@
"type": "git",
"url": "https://github.com/fontsource/fontsource.git",
"directory": "packages/blackout-midnight"
},
"gitHead": "9bd9a7143897d39e0fdbbca366a889a4028edf5b"
}
}
File renamed without changes.
28 changes: 19 additions & 9 deletions packages/blackout-sunrise/README.md
Expand Up @@ -12,32 +12,30 @@ Fontsource assumes you are using a bundler, such as Webpack, to load in CSS. Sol
yarn add fontsource-blackout-sunrise // npm install fontsource-blackout-sunrise
```

Then within your app entry file or site component, import it in. For example in Gatsby, you could choose to import it into a layout template (`layout.js`), page component, or `gatsby-browser.js`.
Then within your app entry file or site component, import it in. For example in Gatsby, you could choose to import it into a layout template (`layout.js`), page component (`index.js`), or `gatsby-browser.js`.

```javascript
import "fontsource-blackout-sunrise" // Defaults to weight 400 with all styles included.
import "fontsource-blackout-sunrise" // Defaults to weight 400.
```

Fontsource allows you to select font subsets, weights and even individual styles, allowing you to cut down on payload sizes to the last byte! The default selection above, however, sticks to the Latin subset including all weights and styles.
Fontsource allows you to select weights and even individual styles, allowing you to cut down on payload sizes to the last byte! Utilizing the CSS unicode-range selector, all language subsets are accounted for.

```javascript
import "fontsource-blackout-sunrise/latin-ext.css" // All weights and styles included.
import "fontsource-blackout-sunrise/cyrillic-ext-400.css" // All styles included.
import "fontsource-blackout-sunrise/greek-700-normal.css" // Select either normal or italic.
import "fontsource-blackout-sunrise/500.css" // Weight 500.
import "fontsource-blackout-sunrise/900-italic.css" // Italic variant.
```

Alternatively, the same solutions could be imported via SCSS!

```scss
@import "~fontsource-blackout-sunrise/index.css";
@import "~fontsource-blackout-sunrise/vietnamese-300-italic.css";
@import "~fontsource-blackout-sunrise/index.css"; // Weight 400.
@import "~fontsource-blackout-sunrise/300-italic.css";
```

_These examples may not reflect actual compatibility. Please refer below._

Supported variables:

- Subsets: `[latin]`
- Weights: `[400]`
- Styles: `[normal]`

Expand All @@ -49,6 +47,18 @@ body {
}
```

## Additional Options

In the rare case you need to individually select a language subset and not utilize the CSS unicode-range selector, you may specify the import as follows. This is especially not recommended for languages, such as Japanese, with a large amount of characters.

```javascript
import "fontsource-blackout-sunrise/latin-ext.css" // All weights with normal style included.
import "fontsource-blackout-sunrise/cyrillic-ext-500.css" // Weight 500 with normal style.
import "fontsource-blackout-sunrise/greek-900-normal.css" // Italic variant.
```

- Supported subsets: `[latin]`

## Licensing

It is important to always read the license for every font that you use.
Expand Down

0 comments on commit 4f75799

Please sign in to comment.