|
@@ -63,6 +63,8 @@ class ComPDFKitViewer {
|
|
|
this.color = 'color'
|
|
|
this.pagesPtr = []
|
|
|
this.saveAction = null
|
|
|
+ this.enableCustomFont = false
|
|
|
+ this.fontsJson = null
|
|
|
this.webFontURL = 'https://www.compdf.com/fonts/'
|
|
|
this.optionUrl = {
|
|
|
// baseUrl: 'https://test-compdf.kdan.cn',
|
|
@@ -272,12 +274,16 @@ class ComPDFKitViewer {
|
|
|
// this.webviewerServer = true
|
|
|
|
|
|
if (verified) {
|
|
|
+ if (options.enableCustomFont) {
|
|
|
+ this.enableCustomFont = true
|
|
|
+ }
|
|
|
if (options.webFontURL) {
|
|
|
+ this.enableCustomFont = true
|
|
|
this.webFontURL = options.webFontURL
|
|
|
}
|
|
|
- if (!this.webviewerServer) {
|
|
|
+ if (!this.webviewerServer && this.enableCustomFont) {
|
|
|
const webFontURL = this.webFontURL
|
|
|
-
|
|
|
+
|
|
|
const response = await fetch(webFontURL + 'font.ff')
|
|
|
if (response.ok) {
|
|
|
const resData = await response.arrayBuffer()
|