|
@@ -19,9 +19,10 @@ export class ContentContainer {
|
|
|
this.destroyed = false
|
|
|
this.rendered = false
|
|
|
this.frameEditorList = []
|
|
|
- this.tool = this.pageViewer.tool || ''
|
|
|
+ this.tool = this.pageViewer.tool || options.tool || ''
|
|
|
this.color = this.pageViewer.color || ''
|
|
|
this._selectedFrameIndex = -1
|
|
|
+ this.initedFont = false
|
|
|
|
|
|
this.onHandleTool = this.handleTool.bind(this)
|
|
|
this.onKeydown = this.handleKeyDown.bind(this)
|
|
@@ -32,16 +33,22 @@ export class ContentContainer {
|
|
|
pagePtr: this.pagePtr
|
|
|
})
|
|
|
this.editPagePtr = editPagePtr
|
|
|
+ await this.initFont()
|
|
|
+ }
|
|
|
|
|
|
- // await this.messageHandler.sendWithPromise('SetFontCallBackForEditPage', {
|
|
|
- // editPagePtr: this.editPagePtr,
|
|
|
- // fontFile: this.pageViewer.fontFile,
|
|
|
- // fontName: 'DroidSansFallbackFull'
|
|
|
- // })
|
|
|
+ async initFont() {
|
|
|
+ if (this.initedFont || this.tool === 'editImage' || this.tool === 'addImage') return
|
|
|
+ await this.messageHandler.sendWithPromise('SetFontCallBackForEditPage', {
|
|
|
+ editPagePtr: this.editPagePtr,
|
|
|
+ fontFile: this.pageViewer.fontFile,
|
|
|
+ fontName: 'DroidSansFallbackFull'
|
|
|
+ })
|
|
|
+ this.initedFont = true
|
|
|
}
|
|
|
|
|
|
async render () {
|
|
|
if (this._cancelled || this.contentContainer) {
|
|
|
+ if (!this.initedFont) await this.initFont()
|
|
|
return;
|
|
|
}
|
|
|
|