From 6f797ba770909db717c8328bcfd16dec8b537e8b Mon Sep 17 00:00:00 2001 From: Dan Allen Date: Tue, 5 Apr 2022 16:45:45 -0600 Subject: [PATCH] resolves #187 switch from deprecated typeface- packages to fontsource packages to retrieve fonts; use more liberal filter --- gulp.d/tasks/build.js | 2 +- package-lock.json | 24 ++++++++++++------------ package.json | 4 ++-- src/css/typeface-roboto-mono.css | 14 ++++++-------- src/css/typeface-roboto.css | 28 ++++++++++++---------------- 5 files changed, 33 insertions(+), 39 deletions(-) diff --git a/gulp.d/tasks/build.js b/gulp.d/tasks/build.js index 06e25c8..953022e 100644 --- a/gulp.d/tasks/build.js +++ b/gulp.d/tasks/build.js @@ -37,7 +37,7 @@ module.exports = (src, dest, preview) => () => { }), postcssUrl([ { - filter: '**/~typeface-*/files/*', + filter: new RegExp('^src/css/[~][^/]*(?:font|face)[^/]*/.*/files/.+[.](?:ttf|woff2?)$'), url: (asset) => { const relpath = asset.pathname.substr(1) const abspath = require.resolve(relpath) diff --git a/package-lock.json b/package-lock.json index f4b53ad..66ea74a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -259,6 +259,18 @@ "to-fast-properties": "^2.0.0" } }, + "@fontsource/roboto": { + "version": "4.5.5", + "resolved": "https://registry.npmjs.org/@fontsource/roboto/-/roboto-4.5.5.tgz", + "integrity": "sha512-Pe1p+gAO6K0aLxBXlLoJRHVx352tVc/v/7DOnvM3t+FYXb+KUga9aCD1NpnDfd0kKnWXqrZyAXguyyFWDDuphw==", + "dev": true + }, + "@fontsource/roboto-mono": { + "version": "4.5.5", + "resolved": "https://registry.npmjs.org/@fontsource/roboto-mono/-/roboto-mono-4.5.5.tgz", + "integrity": "sha512-krIslwmFMjDHtbSVKZLC6+PM6dOvw26OTm7rE7CrniJ4q5Lbfffx67RAlDI3ee0LsG6gIJd/JXBeUm+RgUsPqg==", + "dev": true + }, "@jridgewell/resolve-uri": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.5.tgz", @@ -11293,18 +11305,6 @@ "is-typedarray": "^1.0.0" } }, - "typeface-roboto": { - "version": "0.0.75", - "resolved": "https://registry.npmjs.org/typeface-roboto/-/typeface-roboto-0.0.75.tgz", - "integrity": "sha512-VrR/IiH00Z1tFP4vDGfwZ1esNqTiDMchBEXYY9kilT6wRGgFoCAlgkEUMHb1E3mB0FsfZhv756IF0+R+SFPfdg==", - "dev": true - }, - "typeface-roboto-mono": { - "version": "0.0.75", - "resolved": "https://registry.npmjs.org/typeface-roboto-mono/-/typeface-roboto-mono-0.0.75.tgz", - "integrity": "sha512-dYfyXd6HrKyMC/PuBAAtay0tZKsBrzxIW/fBY325vLxFfi/IDKSuyTkWxkU4lyZV6KPHetFnJ661PNXzz2FS/w==", - "dev": true - }, "typescript": { "version": "3.9.10", "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz", diff --git a/package.json b/package.json index e240634..a333bf4 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,8 @@ ], "devDependencies": { "@asciidoctor/core": "~2.2", + "@fontsource/roboto": "~4.5", + "@fontsource/roboto-mono": "~4.5", "autoprefixer": "~9.7", "browser-pack-flat": "~3.4", "browserify": "~16.5", @@ -49,8 +51,6 @@ "require-from-string": "~2.0", "stylelint": "~13.3", "stylelint-config-standard": "~20.0", - "typeface-roboto": "0.0.75", - "typeface-roboto-mono": "0.0.75", "vinyl-buffer": "~1.0", "vinyl-fs": "~3.0" } diff --git a/src/css/typeface-roboto-mono.css b/src/css/typeface-roboto-mono.css index c51a7fc..841df08 100644 --- a/src/css/typeface-roboto-mono.css +++ b/src/css/typeface-roboto-mono.css @@ -3,10 +3,9 @@ font-style: normal; font-weight: 400; src: - local("Roboto Mono Regular"), - local("RobotoMono-Regular"), - url(~typeface-roboto-mono/files/roboto-mono-latin-400.woff2) format("woff2"), - url(~typeface-roboto-mono/files/roboto-mono-latin-400.woff) format("woff"); + url(~@fontsource/roboto-mono/files/roboto-mono-latin-400-normal.woff2) format("woff2"), + url(~@fontsource/roboto-mono/files/roboto-mono-latin-400-normal.woff) format("woff"); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } @font-face { @@ -14,8 +13,7 @@ font-style: normal; font-weight: 500; src: - local("Roboto Mono Medium"), - local("RobotoMono-Medium"), - url(~typeface-roboto-mono/files/roboto-mono-latin-500.woff2) format("woff2"), - url(~typeface-roboto-mono/files/roboto-mono-latin-500.woff) format("woff"); + url(~@fontsource/roboto-mono/files/roboto-mono-latin-500-normal.woff2) format("woff2"), + url(~@fontsource/roboto-mono/files/roboto-mono-latin-500-normal.woff) format("woff"); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } diff --git a/src/css/typeface-roboto.css b/src/css/typeface-roboto.css index 7825486..1648a2b 100644 --- a/src/css/typeface-roboto.css +++ b/src/css/typeface-roboto.css @@ -3,10 +3,9 @@ font-style: normal; font-weight: 400; src: - local("Roboto Regular"), - local("Roboto-Regular"), - url(~typeface-roboto/files/roboto-latin-400.woff2) format("woff2"), - url(~typeface-roboto/files/roboto-latin-400.woff) format("woff"); + url(~@fontsource/roboto/files/roboto-latin-400-normal.woff2) format("woff2"), + url(~@fontsource/roboto/files/roboto-latin-400-normal.woff) format("woff"); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } @font-face { @@ -14,10 +13,9 @@ font-style: italic; font-weight: 400; src: - local("Roboto Italic"), - local("Roboto-Italic"), - url(~typeface-roboto/files/roboto-latin-400italic.woff2) format("woff2"), - url(~typeface-roboto/files/roboto-latin-400italic.woff) format("woff"); + url(~@fontsource/roboto/files/roboto-latin-400-italic.woff2) format("woff2"), + url(~@fontsource/roboto/files/roboto-latin-400-italic.woff) format("woff"); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } @font-face { @@ -25,10 +23,9 @@ font-style: normal; font-weight: 500; src: - local("Roboto Medium"), - local("Roboto-Medium"), - url(~typeface-roboto/files/roboto-latin-500.woff2) format("woff2"), - url(~typeface-roboto/files/roboto-latin-500.woff) format("woff"); + url(~@fontsource/roboto/files/roboto-latin-500-normal.woff2) format("woff2"), + url(~@fontsource/roboto/files/roboto-latin-500-normal.woff) format("woff"); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } @font-face { @@ -36,8 +33,7 @@ font-style: italic; font-weight: 500; src: - local("Roboto Medium Italic"), - local("Roboto-MediumItalic"), - url(~typeface-roboto/files/roboto-latin-500italic.woff2) format("woff2"), - url(~typeface-roboto/files/roboto-latin-500italic.woff) format("woff"); + url(~@fontsource/roboto/files/roboto-latin-500-italic.woff2) format("woff2"), + url(~@fontsource/roboto/files/roboto-latin-500-italic.woff) format("woff"); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } -- 2.11.0