Skip to content

Commit ed91ad9

Browse files
committed
[2.3.0] add support for subsets of the google fonts unicode ranges
1 parent da72cda commit ed91ad9

File tree

8 files changed

+920
-6179
lines changed

8 files changed

+920
-6179
lines changed

.eslintrc

Lines changed: 43 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,55 @@
33
"es6": true,
44
"node": true
55
},
6+
"parserOptions": {
7+
"ecmaVersion": 2018
8+
},
69
"extends": "eslint:recommended",
7-
"plugins": [
8-
"prettier"
9-
],
1010
"rules": {
11-
"prettier/prettier": "error",
12-
"indent": [
11+
"quotes": [2, "single"],
12+
"indent": [2, 4, { "SwitchCase": 1 }],
13+
"no-console": 1,
14+
"key-spacing":[
1315
"error",
14-
4
16+
{
17+
"beforeColon": false,
18+
"afterColon": true,
19+
"mode": "strict"
20+
}
1521
],
16-
"linebreak-style": [
17-
"error",
18-
"unix"
22+
"no-debugger": 1,
23+
"no-var": 1,
24+
"semi": [1, "always"],
25+
"no-trailing-spaces": 1,
26+
"eol-last": 0,
27+
"no-underscore-dangle": 0,
28+
"no-alert": 0,
29+
"no-lone-blocks": 0,
30+
"jsx-quotes": 1,
31+
"no-duplicate-case": 0,
32+
"no-unused-vars": [
33+
1,
34+
{ "vars": "all", "args": "after-used", "ignoreRestSiblings": true }
1935
],
20-
"quotes": [
21-
"error",
22-
"single"
36+
"no-empty": [2, { "allowEmptyCatch": true }],
37+
"array-element-newline": [
38+
"warn",
39+
"consistent"
2340
],
24-
"semi": [
25-
"error",
26-
"always"
41+
"array-bracket-spacing": [
42+
"warn",
43+
"always",
44+
{
45+
"singleValue": true,
46+
"objectsInArrays": false,
47+
"arraysInArrays": false
48+
}
49+
],
50+
"object-property-newline": [
51+
"warn",
52+
{
53+
"allowAllPropertiesOnSameLine": false
54+
}
2755
]
2856
}
2957
}

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
## 2.3.0 (2019-11-11)
2+
3+
Added: Support of Google fonts unicode-range subsets
4+
Fixed: refactoring the plugin script
5+
Updated: google-fonts-complete dependency
6+
Updated: dev dependecies
7+
Updated: package.json
8+
Updated: eslint rules
9+
10+
111
## 2.2.2 (2019-06-13)
212

313
Updated: google-fonts-complete dependency

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ yarn add postcss-font-magician --dev
5656

5757
Use [Font Magician] in your script:
5858
```js
59+
const fs = require('fs');
60+
const postcss = require('postcss');
5961
const pfm = require('postcss-font-magician');
6062
postcss([
6163
pfm({ /* options */ })
@@ -207,14 +209,14 @@ The plugin will download the font only selected weights, styles and formats.
207209

208210
### unicode-range
209211

210-
Need to support [unicode-range](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/unicode-range)? You can use it as a second element in an option array.
212+
Need to support [unicode-range](https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/unicode-range)? You can use both the names of the subsets of Google fonts (e.g. 'latin-ext' or 'cyrillic') and specific unicode ranges values. You can use it as a second element in an option array.
211213

212214
```js
213215
require('postcss-font-magician')({
214216
variants: {
215217
'Open Sans': {
216-
'300': ['woff, eot, woff2', 'U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF'],
217-
'400 italic': ['woff2']
218+
'300': ['woff2', 'cyrillic-ext, greek'],
219+
'400 italic': ['woff2', 'U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF']
218220
}
219221
}
220222
});

0 commit comments

Comments
 (0)