Поправки в шрифтах

This commit is contained in:
Book Pauk
2019-01-25 01:20:30 +07:00
parent 7fd54de0a0
commit 7e5314887a
4 changed files with 11 additions and 4 deletions

View File

@@ -53,7 +53,7 @@ module.exports = {
}
},
{
test: /\.(ttf|eot|woff)$/,
test: /\.(ttf|eot|woff|woff2)$/,
loader: "file-loader",
options: {
prefix: "font/"

View File

@@ -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');
}
</style>

View File

@@ -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, отступ параграфа

Binary file not shown.