Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
a-doc-editor
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ramdayal Munda
a-doc-editor
Commits
d056325e
Commit
d056325e
authored
Dec 14, 2023
by
ramdayalmunda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reload canvas when new font is inserted
parent
4dd20e64
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
a-doc-editor.js
dist/assets/a-doc-editor.js
+11
-0
No files found.
dist/assets/a-doc-editor.js
View file @
d056325e
...
...
@@ -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}'
);
`
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment