1 Reply Latest reply on Oct 23, 2008 11:26 AM by Chris Mauger

    Rich Text Editor isn't showing embedded non-system fonts

    Chris Mauger
      I've searched high and low for a resolution to this problem. And as far as I can tell there isn't a solution. So, please if anyone has a solution, I think it would be worth a lot of peoples time, if we could actually post it here.

      If you embed non-system fonts (below I've compiled true type fonts into swf's), and reset the rich text editors fontArrayFamily to only contain the newly embedded fonts, the embedded fonts will not work. If you embed system fonts, this method will work. If you assign 1 of the non-embedded fonts to a component, the font will render correctly. The issue only seems to be when the fonts are assigned to the RTE, and the font families that are available to it.

      Below should allow for non-system fonts to be available to the RTE, but you will get default fonts instead.

      <mx:Style>
      @font-face {
      src:url("AABIGFICTION.swf");
      fontFamily: "AABIGFICTION";
      }
      @font-face {
      src:url("Baskerville_Old_Face.swf");
      fontFamily: "Baskerville_Old_Face";
      }

      </mx:Style>

      <mx:Script>
      <![CDATA[
      private function returnHandler():void {

      RTE.fontFamilyArray = ["AABIGFICTION", "Baskerville_Old_Face"];
      }
      ]]>
      </mx:Script>

      <mx:RichTextEditor id="RTE" title="Title" width="440" height="368" creationComplete="returnHandler();">


      *NOTE*
      *IF you assign the fontFamily within the RTE to 1 of the embedded non-system fonts, it will render the font.
      *Below AAGBIGFICTION will show, but you will not be able to use any other font.
      ****
      <mx:RichTextEditor id="RTE" title="Title" width="440" fontFamily="AABIGFICTION" height="368" creationComplete="returnHandler();">

        • 1. Re: Rich Text Editor isn't showing embedded non-system fonts
          Chris Mauger Level 1
          I just figured this one out. Make sure that if you embed a font, that every font used by the movie is embedded. Because if flex tries to use a font that is not embedded, Flex will automatically switch to using system fonts. IT WILL IGNORE YOUR EMBEDDED FONTS.

          In my project, I was embedding 2 non-system fonts. The Rich Text editor by default uses Verdana to display your text size, font, all the control components that belong to the Rich Text Editor... And since I didn't embed Verdana, Flex ignored my embedded fonts, and forced the movie to use Verdana. After I embedded the system font (Verdana) everything worked as expected.

          So this fixed the issue:

          @font-face {
          src:url("AABIGFICTION.swf");
          fontFamily: "AABIGFICTION";
          fontName: "AABIGFICTION";

          }
          @font-face {
          src:url("Baskerville_Old_Face.swf");
          fontFamily: "Baskerville_Old_Face";
          fontName: "Baskerville_Old_Face";

          }
          @font-face {
          src: local(Verdana);
          fontFamily: "Verdana";
          fontName: "Verdana";
          }