Commit d056325e by ramdayalmunda

reload canvas when new font is inserted

parent 4dd20e64
......@@ -671,6 +671,7 @@ var ADocEditor = function (customConfig) {
return
}
let newStyle = `${styleTag.textContent}
@font-face {
font-family: '${name}';
......@@ -678,6 +679,12 @@ var ADocEditor = function (customConfig) {
`
if (typeof paths == 'object'){
for (let i=0; i<paths.length; i++) {
let linkTag = document.createElement('link')
linkTag.onload = ()=>{ reRenderPages(dataSet) }
linkTag.href = paths[i]
linkTag.rel = "stylesheet"
document.head.append(linkTag)
let splitted = paths[i].split('.')
let format = splitted[splitted.length-1]
format = format=='ttf'?'truetype':format
......@@ -685,7 +692,11 @@ var ADocEditor = function (customConfig) {
`
}
}else{
let linkTag = document.createElement('link')
linkTag.onload = ()=>{ reRenderPages(dataSet) }
linkTag.href = paths
let splitted = paths.split('.')
document.head.append(linkTag)
let format = splitted[splitted.length-1]
format = format=='ttf'?'truetype':format
newStyle+=`url('${paths}') format('${format}');`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment