Question

How change and fix the font and size on RichText control (PRPC-7.4.0-185)

***Edited by Moderator Marissa to update platform capability tags****

Comments

Keep up to date on this post and subscribe to comments

Pega
August 15, 2019 - 3:09pm

 

See if this helps you - 

https://community.pega.com/support/support-articles/procedure-set-default-font-size-rich-text-editor

This would just be helpful in choosing from the existing fonts though. I doubt if you can add a new font type to the list. Since we base our RTE on 3rd party CKEditor, you could also check in with them on how to do this and whether they offer extension points to allow you to extend it for your needs.

Pega
August 19, 2019 - 8:53am

Hi ,

You can use the below script in userWorkForm to fix the font name and font size 

<script>
window.customCKEditorFontSizes = '12/12px';

    window.customCKEditorFonts = "Helvetica"; 
                        
</script>

If you need more number of font sizes in the dropdown ,add the elements to the variable as below .

window.customCKEditorFontSizes = '8/8px;10/10px;13/13px;16/16px;24/24px;';

 

Please note that these changes will override the default values .

September 17, 2019 - 4:20pm

Tried 

<script>
window.customCKEditorFontSizes = '12/12px';

window.customCKEditorFonts = "Helvetica"; 
                        
</script>

The font dropdown was restricted to Helvetica only. But if user doesn't select the text and applies the font, then the font=helvetica markup doesn't get added. Which is a limitation I can live with.

Font didn't restrict the dropdown to 12px. It shows everything and if I select 8px it applied 8px markup.So, not working. Any thoughts ?