5 Replies Latest reply on May 5, 2009 10:56 PM by Flex harUI

    Font no longer imports in Flex 3 from CS4

    mediareason

      Hey all,

       

      I haven't found an answer to this anywhere, is there a workaround for the issue where fonts no longer import after a .swf has been exported via CS4?

       

      I'm having a hell of a time importing fonts that worked just fine in CS3, and I can't tell what has changed. Anyone have any experience with it.

       

      Since I have running files in Flex 3 that are using fonts just fine pre-CS4, I'm pretty sure it's not a code error on my part. However, the whole font set up is tweaky enough I suppose it's possible that some 'error' that allowed 'wrong' code to work got corrected.

       

      Any help here?

        • 1. Re: Font no longer imports in Flex 3 from CS4
          mediareason Level 1

          As far as code goes, I'm using the :

           

          [Embed(source="/CS4Background.swf", fontFamily="Helvetica Neue")]

          private var _helvetica_neue_str:String;

           

          Also, for example, I seem to be able to get Helevitica Neue to import correctly only the regular style, however it doesn't display on screen so it does me no good. Other other font weights (bold, etc.) give errors on import:

           

          font 'Helvetica Neue' with bold weight and regular style not found

          Unable to transcode /CS4Background.swf.

          Confused...

          • 2. Re: Font no longer imports in Flex 3 from CS4
            mediareason Level 1

            I also wonder if it has to do with OpenType fonts? OpenType fonts won't import without error ever, while the TrueType Helvetica imports successfully.

            • 3. Re: Font no longer imports in Flex 3 from CS4
              mediareason Level 1

              Further digging has led me to believe it may be because I wasn't referencing:

               

              flash.text.Font;

               

              Perhaps CS3 baked this reference into the .swf? Still investigating.

               

              I was able to get:

               

               

              [Embed(source="/assets/fonts/HelveticaNeueLTComBd.ttf", fontWeight="bold",fontFamily="HelveticaNeueLT",mimeType="application/x-font")]

              private var HelveticaNeueBold:Class;

               

               

              To run, but, however, the font still doesn't render on screen. Not sure what the issue is there.

               

              Also wasn't calling :

               

               

              Font.registerFont(HelveticaNeueBold);

               

               

              Again, this doesn't seem to help the text actually render unfortunately...

               

              Also, this doesn't answer the question why the .swf loaded Font suddenly stopped working with CS4.

              • 4. Re: Font no longer imports in Flex 3 from CS4
                mediareason Level 1

                Ok, I think I got the difference in the non-swf loading cases. The font name had changed to:

                 

                HelveticaNeueLTCom

                 

                Which I forgot to change all references to. But this STILL doesn't answer why CS4 broke the .swf loading version.

                • 5. Re: Font no longer imports in Flex 3 from CS4
                  Flex harUI Adobe Employee

                  Haven't looked at CS4 fonts, but maybe they're generating DefineFont4 tags instead of older tags which aren't compatible with TextField?

                   

                  However, the thing you did below takes CS4 out of the equation.  Maybe changing fontmanagers might help.

                   

                  Alex Harui

                  Flex SDK Developer

                  Adobe Systems Inc.

                  Blog: http://blogs.adobe.com/aharui