I am using quill editor in angular I am unable to add multiple fonts in angular 2+ I am using following code snippet
QuillModule.forRoot({
modules: {
toolbar: [
['blockquote', 'code-block'],
// [{ 'header': 1 }, { 'header': 2 }], // custom button values
[{ 'list': 'ordered' }, { 'list': 'bullet' }],
// [{ 'script': 'sub' }, { 'script': 'super' }], // superscript/subscript
[{ 'indent': '-1' }, { 'indent': '+1' }], // outdent/indent
[{ 'direction': 'rtl' }], // text direction
[{ 'size': ['small', false, 'large', 'huge'] }], // custom dropdown
[{ 'header': [1, 2, 3, 4, 5, 6, false] }],
[{ 'color': [] }, { 'background': [] }], // dropdown with defaults from theme
[{ 'font': [] }],
[{ 'align': [] }],
['clean'], // remove formatting button
['link', 'image'] // link and image, video
]
},
})
when ever I add fonts in fonts list I get same font all the time. I followed this link as well but its not for angular I suppose How to add font types on Quill js with toolbar options?
can anyone help me?
A select tag with a
ql-font
class. This will contain the new font options.Add the new fonts to the whitelist. This has to be defined before you call the Quill constructor in Javascript.Define the font-family for each label in the dropdown. Example:Define the content font-families that will be used in the text area. Following the example in the 3rd component:
.ql-font-inconsolata
{ font-family: "Inconsolata";}