diff --git a/build/webpack.base.config.js b/build/webpack.base.config.js index 3b034cec..ae07bc58 100644 --- a/build/webpack.base.config.js +++ b/build/webpack.base.config.js @@ -53,7 +53,7 @@ module.exports = { } }, { - test: /\.(ttf|eot|woff)$/, + test: /\.(ttf|eot|woff|woff2)$/, loader: "file-loader", options: { prefix: "font/" diff --git a/client/components/App.vue b/client/components/App.vue index c13316cf..fee0e8db 100644 --- a/client/components/App.vue +++ b/client/components/App.vue @@ -260,7 +260,7 @@ body, html, #app { margin: 0; padding: 0; height: 100%; - font: normal 12pt Arial, Verdana, Sans-serif; + font: normal 12pt ReaderDefault; } @font-face { @@ -280,4 +280,10 @@ body, html, #app { src: url('fonts/roboto.woff') format('woff'), url('fonts/roboto.ttf') format('truetype'); } + +@font-face { + font-family: 'Archivo'; + src: url('fonts/archivo.woff2') format('woff2'); +} + diff --git a/client/components/Reader/TextPage/TextPage.vue b/client/components/Reader/TextPage/TextPage.vue index 14e3af7c..78e9e298 100644 --- a/client/components/Reader/TextPage/TextPage.vue +++ b/client/components/Reader/TextPage/TextPage.vue @@ -176,6 +176,7 @@ class TextPage extends Vue { let loaded = await Promise.all(this.fontList.map(font => document.fonts.check(font))); if (loaded.some(r => !r)) { loaded = await Promise.all(this.fontList.map(font => document.fonts.load(font))); + await document.fonts.ready; if (loaded.some(r => !r.length)) throw new Error('some font not loaded'); } @@ -196,8 +197,8 @@ class TextPage extends Vue { this.backgroundColor = '#478355'; this.fontStyle = '';// 'bold','italic' this.fontSize = 33;// px - this.fontName = 'XoloniumRegular'; - this.fontCssUrl = 'https://fontlibrary.org/face/xolonium'; + this.fontName = 'Archivo'; + this.fontCssUrl = ''; this.lineInterval = 7;// px, межстрочный интервал this.textAlignJustify = true;// выравнивание по ширине this.p = 50;// px, отступ параграфа diff --git a/client/components/fonts/archivo.woff2 b/client/components/fonts/archivo.woff2 new file mode 100644 index 00000000..30b892d0 Binary files /dev/null and b/client/components/fonts/archivo.woff2 differ