1 Reply Latest reply on Feb 16, 2007 7:51 AM by

    Embed TrueType Font not working

    vergeerkaas
      I've tried for several hours to use a embedded font without succes.

      I have:

      <mx:Script>
      <![CDATA[[
      Embed(source="work/ttf/KIMSHAND.TTF", fontName="KIMSHAND", mimeType="application/x-font")]
      private var fontKIMSHAND:Class;
      ]]>
      </mx:Script>

      <mx:Text
      id="helpText"
      height="240"
      width="240"
      text="My help text"
      fontSize="24" color="#ffffff" fontFamily="KIMSHAND">
      </mx:Text>


      The .text isn't displayed when I run the project.
      I've trief a lot of other truetype fonts, but none are working.
      I'm using Flex 2.0.1 on OSX.

      Thanks for help!
      Jaap
        • 1. Re: Embed TrueType Font not working
          The easiest/cleanest way to embed fonts is in css code, try the following:

          <mx:Style>
          @font-face {
          src:url("work/ttf/KIMSHAND.TTF");
          fontFamily: myFont;
          flashType: true;
          }

          .MyStyle {
          fontFamily: myFont;
          fontSize: 24;
          }
          </mx:Style>
          <mx:Label styleName="MyStyle" text="HELLO WORLD"/>