diff --git a/platform/viewer/.webpack/webpack.pwa.js b/platform/viewer/.webpack/webpack.pwa.js index e9fb77a7c..35c36d41c 100644 --- a/platform/viewer/.webpack/webpack.pwa.js +++ b/platform/viewer/.webpack/webpack.pwa.js @@ -102,6 +102,32 @@ module.exports = (env, argv) => { swDest: 'sw.js', clientsClaim: true, skipWaiting: true, + exclude: [ + new RegExp('^https://fonts.googleapis.com/'), + new RegExp('^https://fonts.gstatic.com/'), + ], + runtimeCaching: [ + { + urlPattern: new RegExp('^https://fonts.googleapis.com/'), + handler: 'StaleWhileRevalidate', + options: { + cacheName: 'google-fonts-stylesheets', + }, + }, + { + urlPattern: new RegExp('^https://fonts.gstatic.com/'), + handler: 'CacheFirst', + options: { + cacheName: 'google-fonts-webfonts', + + // Only cache 30 images / one year. + expiration: { + maxAgeSeconds: 60 * 60 * 24 * 365, + maxEntries: 30, + }, + }, + }, + ], }), ], // https://webpack.js.org/configuration/dev-server/ diff --git a/platform/viewer/public/html-templates/rollbar.html b/platform/viewer/public/html-templates/rollbar.html index 8dafd18c5..c7d240ef1 100644 --- a/platform/viewer/public/html-templates/rollbar.html +++ b/platform/viewer/public/html-templates/rollbar.html @@ -1,53 +1,47 @@ - - - - - - - - - + + + + - OHIF Viewer + + + + + - - + OHIF Viewer - - + - + - - + + -
+
- - + + + diff --git a/platform/viewer/src/fonts/KFOmCnqEu92Fr1Mu4WxKKTU1Kvnz.woff2 b/platform/viewer/src/fonts/KFOmCnqEu92Fr1Mu4WxKKTU1Kvnz.woff2 new file mode 100644 index 000000000..23cb3ad44 Binary files /dev/null and b/platform/viewer/src/fonts/KFOmCnqEu92Fr1Mu4WxKKTU1Kvnz.woff2 differ diff --git a/platform/viewer/src/fonts/KFOmCnqEu92Fr1Mu4mxKKTU1Kg.woff2 b/platform/viewer/src/fonts/KFOmCnqEu92Fr1Mu4mxKKTU1Kg.woff2 new file mode 100644 index 000000000..4fc449afd Binary files /dev/null and b/platform/viewer/src/fonts/KFOmCnqEu92Fr1Mu4mxKKTU1Kg.woff2 differ diff --git a/platform/viewer/src/fonts/KFOmCnqEu92Fr1Mu5mxKKTU1Kvnz.woff2 b/platform/viewer/src/fonts/KFOmCnqEu92Fr1Mu5mxKKTU1Kvnz.woff2 new file mode 100644 index 000000000..814b9474c Binary files /dev/null and b/platform/viewer/src/fonts/KFOmCnqEu92Fr1Mu5mxKKTU1Kvnz.woff2 differ diff --git a/platform/viewer/src/fonts/KFOmCnqEu92Fr1Mu72xKKTU1Kvnz.woff2 b/platform/viewer/src/fonts/KFOmCnqEu92Fr1Mu72xKKTU1Kvnz.woff2 new file mode 100644 index 000000000..10cd611dd Binary files /dev/null and b/platform/viewer/src/fonts/KFOmCnqEu92Fr1Mu72xKKTU1Kvnz.woff2 differ diff --git a/platform/viewer/src/fonts/KFOmCnqEu92Fr1Mu7GxKKTU1Kvnz.woff2 b/platform/viewer/src/fonts/KFOmCnqEu92Fr1Mu7GxKKTU1Kvnz.woff2 new file mode 100644 index 000000000..9b257dcbd Binary files /dev/null and b/platform/viewer/src/fonts/KFOmCnqEu92Fr1Mu7GxKKTU1Kvnz.woff2 differ diff --git a/platform/viewer/src/fonts/KFOmCnqEu92Fr1Mu7WxKKTU1Kvnz.woff2 b/platform/viewer/src/fonts/KFOmCnqEu92Fr1Mu7WxKKTU1Kvnz.woff2 new file mode 100644 index 000000000..4a61f8697 Binary files /dev/null and b/platform/viewer/src/fonts/KFOmCnqEu92Fr1Mu7WxKKTU1Kvnz.woff2 differ diff --git a/platform/viewer/src/fonts/KFOmCnqEu92Fr1Mu7mxKKTU1Kvnz.woff2 b/platform/viewer/src/fonts/KFOmCnqEu92Fr1Mu7mxKKTU1Kvnz.woff2 new file mode 100644 index 000000000..e17542dc1 Binary files /dev/null and b/platform/viewer/src/fonts/KFOmCnqEu92Fr1Mu7mxKKTU1Kvnz.woff2 differ diff --git a/platform/viewer/src/fonts/fonts.css b/platform/viewer/src/fonts/fonts.css new file mode 100644 index 000000000..60a491b8b --- /dev/null +++ b/platform/viewer/src/fonts/fonts.css @@ -0,0 +1,74 @@ +/* cyrillic-ext */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: local('Roboto'), local('Roboto-Regular'), + url('./KFOmCnqEu92Fr1Mu72xKKTU1Kvnz.woff2') format('woff2'); + unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, + U+FE2E-FE2F; +} +/* cyrillic */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: local('Roboto'), local('Roboto-Regular'), + url('./KFOmCnqEu92Fr1Mu5mxKKTU1Kvnz.woff2') format('woff2'); + unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} +/* greek-ext */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: local('Roboto'), local('Roboto-Regular'), + url('./KFOmCnqEu92Fr1Mu7mxKKTU1Kvnz.woff2') format('woff2'); + unicode-range: U+1F00-1FFF; +} +/* greek */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: local('Roboto'), local('Roboto-Regular'), + url('./KFOmCnqEu92Fr1Mu4WxKKTU1Kvnz.woff2') format('woff2'); + unicode-range: U+0370-03FF; +} +/* vietnamese */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: local('Roboto'), local('Roboto-Regular'), + url('./KFOmCnqEu92Fr1Mu7WxKKTU1Kvnz.woff2') format('woff2'); + unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB; +} +/* latin-ext */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: local('Roboto'), local('Roboto-Regular'), + url('./KFOmCnqEu92Fr1Mu7GxKKTU1Kvnz.woff2') format('woff2'); + unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, + U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; +} +/* latin */ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: local('Roboto'), local('Roboto-Regular'), + url('./KFOmCnqEu92Fr1Mu4mxKKTU1Kg.woff2') format('woff2'); + 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/platform/viewer/src/index-umd.js b/platform/viewer/src/index-umd.js index 810097fce..fc7ccc5a7 100644 --- a/platform/viewer/src/index-umd.js +++ b/platform/viewer/src/index-umd.js @@ -7,6 +7,8 @@ import React from 'react'; import ReactDOM from 'react-dom'; import App from './App.js'; +import './fonts/fonts.css'; + function installViewer(props, containerId = 'root', callback) { const container = document.getElementById(containerId);