Reputation: 2087
I am trying to set the default Font and Font size in a RT Field on my XPage. I have this code:
<xp:inputRichText value="#{document1.Body}" id="body1" >
<xp:this.dojoAttributes>
<xp:dojoAttribute name="font-family" value="Tahoma"></xp:dojoAttribute>
<xp:dojoAttribute name="font-size" value="16pt"></xp:dojoAttribute>
</xp:this.dojoAttributes>
</xp:inputRichText>
When the XPage with this RT Control is displayed the default is unchanged so I'm guessing that the "font-family" is not a RTF attribute that dojo can set. Am I on the right track with this or is there another way.
Upvotes: 0
Views: 846
Reputation: 57
There is a small issue here… the "default" font and size will be determined by CSS applied to the surrounding tags, as the editor by default does not add font family nor font size to the content until a selection is made from the drop down list. The editor does not know what CSS is applied by default to the content, but you can make the selects match the default that is being applied by setting the variables font_defaultLabel and fontSize_defaultLabel (see the documentation here: http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html). To apply CSS to the editor content, use the variable contentsCss to point to a CSS file, just make sure to make the CSS in that file match what will be applied to the field contents when it is in read mode for consistency.
Upvotes: 1