CKEditor - OTN Question - Setting Default Font


We have a letter, a RTF file, that is made in a particular style (Trebuchet / 10)
The users can add a custom block of text to this letter. To do this, they can go to a custom made page in Peoplesoft with a Rich Text block.

But if they dont change the font of that Rich Text block, the text appears as Arial/12 on the RTF letter (because the function: <?html2fo:Text_1?> on the RTF letter defaults to Arial/12)

So I tried to change the config file of the CKEDITOR like this

CKEDITOR.config.font_names = 'Trebuchet MS/Trebuchet MS';

CKEDITOR.config.font_defaultLabel = 'Trebuchet MS';

CKEDITOR.config.font_style = {
element: 'span',
styles: { 'font-family': '#(family)' },
overrides: [ {
  element: 'font', attributes: { 'face': null }
} ]
};


(And I even tried to remove the buttons in the toolbar (for font & size).)

-> When you then click inside the Rich Text Block, the font is automatically set to Trebuchet in the dropdown of the toolbar, (and there are no other choices available)
But the text you type is still in 'default font, Arial?' and when it is saved in the database, the string has no font tags around it. -> so the text will appear as Arial/12 in the letter.
You really must click on the font dropdown in the toolbar of the CKEDITOR (even it is defaulted to Trebuchet and only has 1 value in it), otherwise the font tags are not saved to the string in the database.

And a lot of users make that mistake and don't test their letters properly... so they end up with a letter with two different fonts..
Anyone knows a workaround? To set the default of the CKEDITOR to Trebuchet....  so we can maybe even remove the font button in the toolbar?
(They want to keep the rich text block)

Related Posts: Working with CKEditor - Part 2

No comments:

Post a Comment