Работа над избавлением от канваса в сторону верстки дивами

This commit is contained in:
Book Pauk
2019-01-24 16:16:04 +07:00
parent 132956eabd
commit 6cecc8d8c8
3 changed files with 73 additions and 89 deletions

View File

@@ -8,15 +8,9 @@ export default class BookParser {
this.w = 300;// px, ширина страницы
this.wordWrap = false;// перенос по слогам
//заглушка
this.measureText = (text, style) => {// eslint-disable-line no-unused-vars
if (this.context) {
this.context.save();
this.context.font = this.fontByStyle(style);
const w = this.context.measureText(text).width;
this.context.restore();
return w;
} else
return 0;
return text.length*20;
};
}