Commit 57e3222d by ramdayalmunda

Calibri font added

parent 90f53e1e
...@@ -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);
......
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