I have added the custom font using the method below but that font is only working in few cases
Question
There is one font issue when i click on any element it not show the current font of the element, i added custom code for add my custom fonts. code work perfectly but it not show the selected font by default when i select an paragraph or any text.
editor.on('load', function () {
styleManager = editor.StyleManager;
fontProperty = styleManager.getProperty('Typography', 'font-family');
var list = [];
fontProperty.set('list', list);
list = [
fontProperty.addOption({value: "'Oswald', sans-serif", name: 'Oswald'}),
fontProperty.addOption({value: "Helvetica Neue,Helvetica,Arial,sans-serif", name: 'Helvetica'}),
fontProperty.addOption({value: "sans-serif", name: 'sans-serif'}),
fontProperty.addOption({value: "Times New Roman", name: 'Times New Roman'}),
fontProperty.addOption({value: "Arial Black", name: 'Arial Black'}),
fontProperty.addOption({value: "Tahoma", name: 'Tahoma'}),
fontProperty.addOption({value: "Verdana, Geneva, sans-serif", name: 'Verdana'}),
fontProperty.addOption({value: "Courier New Courier, monospace", name: 'Courier New Courier'}),
fontProperty.addOption({value: "'Lato', sans-serif", name: 'Lato'}),
fontProperty.addOption({value: "'Open Sans', sans-serif", name: 'Open Sans'}),
fontProperty.addOption({value: "'Montserrat', sans-serif", name: 'Montserrat'}),
];
fontProperty.set('list', list);
styleManager.render();
});
Originally posted by @hgphpdev in https://github.com/artf/grapesjs/issues/857#issuecomment-443104577
Answers (0)
No answers yet.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1622
Default selected font issue for custom font in the Typography.
There is one font issue when i click on any element it not show the current font of the element, i added custom code for add my custom font...
Issue #2667
link element not append in head element in ediot.canvas #firefox #grapesjs
am trying to add google fonts in web-builder to change the font style for that to import am adding cdn in editor the code works in chrome a...
Issue #1496
issue in adding new row cell in grapejs not working
i am using grapejs version 0.14.33 with angular 6 i want to add a section with 2 blocks on block manager as created on grapejs demo. and fo...
Issue #3644
BUG: link showing as span when getHtml() called
Hi , @artf I using CKEDITOR for add link into selected text it is working fine . i am using this code to add link it is showing as the abov...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.