The following example shows you how you can edit the font family combo box in the RichTextEditor control in Flex.
Full code after the jump.
<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2007/11/23/populating-the-nested-font-family-combobox-control-in-a-flex-richtexteditor-control/ -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
verticalAlign="middle"
backgroundColor="white">
<mx:Array id="fontFamilyArr">
<mx:String>Arial</mx:String>
<mx:String>Verdana</mx:String>
<mx:String>Comic Sans MS</mx:String>
</mx:Array>
<mx:RichTextEditor id="richTextEditor"
fontFamilyArray="{fontFamilyArr}" />
</mx:Application>
View source is enabled in the following example.
You can also set the fontFamilyArray property using ActionScript, as seen in the following snippet:
richTextEditor.fontFamilyArray = fontFamilyArr;
Or, you can set the data provider on the ComboBox control directly, as seen in the following snippet:
richTextEditor.fontFamilyCombo.dataProvider = fontFamilyArr;





Where is it grabbing the Comic Sans font from? The system? I’m trying to define a custom font for the RichTextEditor and have gotten it to display in the editor, but the bold and italics don’t react. Have been able to define a custom font?
Hi! How i can add embedded font to RichTextEditor?
I’m trying this solution
.fontFamilyArray = [’Arial’, ‘Verdana’, ‘VerdanaEmbeded’];
and many others but they not works.