dcsimg
A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: [RESOLVED] Embedding font --> invalid data?

  1. #1
    Senior Member
    Join Date
    Sep 2005
    Location
    Detroit
    Posts
    193

    resolved [RESOLVED] Embedding font --> invalid data?

    I have no idea what is going on here. Any one else having similar issues?

    Code:
    Embed(source="/Library/fonts/SwissBTExtCom.ttf", fontName="Swiss 911", mimeType="application/x-font-truetype")]
    This throws:
    Error: Error #2136: The SWF file contains invalid data.
    I can't find anything about this anywhere... Thanks for the help.
    While the music played you worked by candlelight
    Those san francisco nights
    You were the best in town
    Just by chance you crossed the diamond with the pearl
    You turned it on the world
    That’s when you turned the world around

  2. #2
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    Just for clarification, do you have the line between <mx:Script> tags?
    Have you tried this: source="SwissBTExtCom.ttf"?
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

  3. #3
    Senior Member
    Join Date
    Sep 2005
    Location
    Detroit
    Posts
    193
    Thanks for the response CancerInform, This is actually just outside a class in a class/Package file. The class is being called from inside the mx:script tags.

    I did put the font in the local directory and no luck there either. (FYI: it needs to be source="/SwissBTExtCom.ttf", for some reason). I am really stuck here. Any other suggestions?
    While the music played you worked by candlelight
    Those san francisco nights
    You were the best in town
    Just by chance you crossed the diamond with the pearl
    You turned it on the world
    That’s when you turned the world around

  4. #4
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    You can try this and create a style script:
    PHP Code:
    <mx:Style>
            @
    font-face
            
    {
                
    src:url("/Users/username/Library/Fonts/myfont.ttf");
                
    fontFamily:myFont;
            }
        </
    mx:Style
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

  5. #5
    Senior Member
    Join Date
    Sep 2005
    Location
    Detroit
    Posts
    193
    Thanks for the help CancerInform. That method did work but I needed to use TextFormat instead of HTML or css text.

    I finally figured out what was going on. For each font you need to create a private class under to load. So for my example above:

    Code:
    		[Embed(source="/SwissBTExtCom.ttf", fontFamily="Swiss911", mimeType="application/x-font-truetype")]
    		private var Swiss911:Class;
    This was an error with ActionScript 3.0 Cookbook. That is annoying. Spend $50 and still need to find the answers on the Web.

    Hope no one else wastes their time on this. Don't forget t(:TextField).embedFonts = true;
    While the music played you worked by candlelight
    Those san francisco nights
    You were the best in town
    Just by chance you crossed the diamond with the pearl
    You turned it on the world
    That’s when you turned the world around

  6. #6
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    I knew that but I thought you had done that, because the rest of your script was correct.
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

  7. #7
    Senior Member
    Join Date
    Sep 2005
    Location
    Detroit
    Posts
    193
    You would have thought. But hey thanks for the help. Problem solved now.
    While the music played you worked by candlelight
    Those san francisco nights
    You were the best in town
    Just by chance you crossed the diamond with the pearl
    You turned it on the world
    That’s when you turned the world around

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center