Is there a way to set the default font and font size in the RickTextEditor?
Announcement
Collapse
No announcement yet.
X
-
There are two possibilities here:
You can specify a css style to apply to the edit area of the RichTextEditor.
For example if you had this CSS class definition in your HTML file:
Code:<style> .rteStyle { font-family:Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif; font-size: 20pt; color: blue; } </style>
Code:isc.RichTextEditor.create({ editAreaProperties:{ styleName:"rteStyle" }, ... // other properties });
To copy that HTML to a new component and apply the same styling you'd have to also set the same styleName on that new component.
Alternatively, when populating the RTE with an HTML value, you could just specify css styling inline and it will be displayed *and* picked up as part of the value
Code:var HTML = "<span style='font-family:Impact'>Some crazy text</span>"; myRichTextEditor.setValue(HTML);
Comment