hi,
I am trying to set default font size and family on froala editor, I set default selection but when I click on smart editor it changes its font size to 16 and font family to Times new Roman, how can I change it to selected style.
please see below: https://codepen.io/Javeria_Anwer/pen/ypvNVM?editors=0010
click on smart editor, you can see its size and family changed to other.
Using .fr-view seems like a poor way to do this. The styles are not saved to the actual content. So if you want different default settings for separate editors in your app, it gets complicated quickly.
@dcporter44 another way that you could use is to wrap the editor content into a different class and set the styles for that. It is not recommended to use inline styles, but rather use stylesheets .
Yes, @dcporter44 is right. That blog post is not a valid solution. Instead, Froala should respect the fontFamilyDefaultSelection and fontSizeDefaultSelection and actually apply those to the default paragraph inside the editor.
I agree that using the .fr-view class doesn't really address this issue. I want to have User A create a document and save it, and then have User B open it (using a different instance of Froala editor) and, by default, for any text that User B adds to appear in a different colour (a crude form of change tracking), but I can't find any way to set the default font colour for User B.
Using .fr-view seems to work at first, but then leads to this other closed issue (https://github.com/froala/wysiwyg-editor/issues/3320) where the line-height on \
I think the way the formatting/font size button works this is not so easy to fix.using .fr-view sets default font family in application, but when the content is send in mail those font family is used in outlook. It would be good it we can have that same way when we are selecting it form font family dropdown which preserves the font style.
Any chance this can be resolved?
Any solution? Still couldn't find anyway to solve this issue.
The fontFamilyDefaultSelection can only take effect if we enable the fontFamilySelection option and it only represents the title of the dropdown.
You can set the default font by calling the fontFamily.apply and fontSize.apply methods inside the initialized event.
Please see https://jsfiddle.net/ilyasfroaal/1d4pv28s/.
@ilyaskarim I know but everyone wants the same thing: to enable a default style inside the editor rather than having to find backwards ways of doing it. In addition, the placeholder is now off.
Seems like the official suggestion is to use .fr-view after all 馃え https://wysiwyg-editor.froala.help/hc/en-us/articles/115000817105-How-can-I-set-a-default-font-style-
Most helpful comment
Yes, @dcporter44 is right. That blog post is not a valid solution. Instead, Froala should respect the
fontFamilyDefaultSelectionandfontSizeDefaultSelectionand actually apply those to the default paragraph inside the editor.