4 Replies Latest reply on Oct 14, 2010 10:54 AM by Ijimero

    RichTextEditor fontsize issue

    Ijimero

      Hi,

       

      I'm trying to use RichTextEditor, but the fontsize of the htmlText don't change, and is always a big size font... it change on the component, but when i check on HTML it remains big.

       

      I have no idea how to fix that problem...

       

      can anybody help me?

        • 1. Re: RichTextEditor fontsize issue
          Flex harUI Adobe Employee

          Any font tags in the HTML will override what you set on the component.

          • 2. Re: RichTextEditor fontsize issue
            Ijimero Level 1

            I managed to identify the problem...

             

            the problem is that the component uses the "SIZE" (that are predetermined sizes that goes from 1 to 7), where it should be using the fontsize, wich is a style, that's why it never changes the size of the font, it because the value is always is above 7...

             

            <TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" SIZE="14" COLOR="#0B333C" LETTERSPACING="0" KERNING="0">.</FONT></P></TEXTFORMAT>

             

            how can this be corrected?

            • 3. Re: RichTextEditor fontsize issue
              Flex harUI Adobe Employee

              The component or the html?  If it is the html, you'll have to modify the

              html.

              1 person found this helpful
              • 4. Re: RichTextEditor fontsize issue
                Ijimero Level 1

                well, after some research i've managed to change the html..

                 

                i've created the following function:

                 

                          private function fixHtmlSize(str:String):String{

                               //str = RichTextEditor.htmlText
                                var pattern:RegExp = /SIZE=\"(.*?)\"/g;
                               
                                return (str.replace(pattern, 'style="font-size:$1px;"'));
                            }

                 

                that solved the problem.