This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
Hello,
I would like to add more fonts in the Richeditor of the blog plugin, by defaults, I've got "Arial, Georgia, Impact, Tahoma, Time new Roman and Verdana". I've tried several solutions ( including this one : https://github.com/octobercms/october/issues/3679 ), but either they are not working, or they are causing bad border effects.
I'm not a professional developper and as far as I understand this could be possible inside the froala module, but I fear to break something. So, please, could you give me a good way to proceed ? I don't think I'm the only one in that situation, maybe would it be possible to improve octobercms by including fonts management ? Or tell in the documentation a reliable way to import new fonts in the Richeditor ?
Thank you best regards Julien
Last updated
One approach for this would be to visit the Settings > Editor Settings area in the backend. Then under Markup Styles created your own style for the font:
.my-custom-style {
font-family: CustomFont;
}
Then in the Markup Classes tab, register the style under Paragraph:
- Label: Custom Font
- Class name: my-custom-style
You would then duplicate this CSS Class on the front end with your desired font, so then the class name is associated.
The only issue is you may not get much feedback in the backend that the font has been applied, so you might want to add something extra to make it more obvious.
.my-custom-style {
font-family: CustomFont;
color: blue;
}
This will mean text in the color blue will have your "CustomFont" font applied.
I hope this helps
Hello daftspunk
Thank you for your detailed answer, it is working very well and can help me as a workaround solution. But what I would really need is just to add more fonts in the "fonts" button if it is possible...
Thank you best regards
Hello,
I believe that I would need to rebuild '/modules/backend/formwidgets/richeditor/assets/js/build-min.js' to add more fonts. However, if I properly understand this post : https://github.com/octobercms/october/issues/3225 , I have to purchase a froala license in that aim. So, without a license, daftspunk's workaround seems to be the better solution. Best regards,
1-4 of 4