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
57e3222d
Commit
57e3222d
authored
Dec 18, 2023
by
ramdayalmunda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Calibri font added
parent
90f53e1e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
4 deletions
+3
-4
a-doc-editor.js
dist/assets/a-doc-editor.js
+3
-4
Calibri.ttf
dist/assets/fonts/Calibri.ttf
+0
-0
customfont.woff
dist/assets/fonts/customfont.woff
+0
-0
No files found.
dist/assets/a-doc-editor.js
View file @
57e3222d
...
@@ -36,7 +36,7 @@ var ADocEditor = function (customConfig) {
...
@@ -36,7 +36,7 @@ var ADocEditor = function (customConfig) {
},
},
style
:
{
style
:
{
fontSize
:
16
,
fontSize
:
16
,
fontFamily
:
'
Kenia
'
,
fontFamily
:
'
Calibri
'
,
bold
:
false
,
bold
:
false
,
italic
:
false
,
italic
:
false
,
fontColor
:
"#001"
fontColor
:
"#001"
...
@@ -149,7 +149,7 @@ var ADocEditor = function (customConfig) {
...
@@ -149,7 +149,7 @@ var ADocEditor = function (customConfig) {
</div>
</div>
`
`
addFonts
([
"./assets/fonts/
customfont.woff"
,
"./assets/fonts/customfont.ttf"
],
'customfont
'
)
addFonts
([
"./assets/fonts/
Calibri.ttf"
],
'Calibri
'
)
addFonts
([
"./assets/fonts/Kenia-Regular.ttf"
],
'Kenia'
)
addFonts
([
"./assets/fonts/Kenia-Regular.ttf"
],
'Kenia'
)
container
.
innerHTML
=
htmlSetup
container
.
innerHTML
=
htmlSetup
...
@@ -438,7 +438,6 @@ var ADocEditor = function (customConfig) {
...
@@ -438,7 +438,6 @@ var ADocEditor = function (customConfig) {
}else{
}else{
caretData.style = { ...caretData.activeData.style }
caretData.style = { ...caretData.activeData.style }
}
}
// fontFamilyDropdown.value = caretData.style.fontFamily
ctx.restore()
ctx.restore()
}
}
...
@@ -775,7 +774,7 @@ var ADocEditor = function (customConfig) {
...
@@ -775,7 +774,7 @@ var ADocEditor = function (customConfig) {
format = format[format.length-1]
format = format[format.length-1]
linkString += `
url
(
$
{
paths
[
i
]})
format
(
"${format=='ttf'?'truetype':format}"
)
$
{(
i
>=
paths
.
length
-
1
)?
''
:
',
\
n'
}
`
linkString += `
url
(
$
{
paths
[
i
]})
format
(
"${format=='ttf'?'truetype':format}"
)
$
{(
i
>=
paths
.
length
-
1
)?
''
:
',
\
n'
}
`
}
}
const customFont = new FontFace(
'YourCustomFont'
, `
$
{
linkString
}
`);
const customFont = new FontFace(
`
$
{
name
}
`
, `
$
{
linkString
}
`);
customFont.load()
customFont.load()
.then( (loadedFont)=>{
.then( (loadedFont)=>{
document.fonts.add(loadedFont);
document.fonts.add(loadedFont);
...
...
dist/assets/fonts/
customfont
.ttf
→
dist/assets/fonts/
Calibri
.ttf
View file @
57e3222d
File moved
dist/assets/fonts/customfont.woff
deleted
100644 → 0
View file @
90f53e1e
File deleted
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