Font embedding in Flash CS5

Hi,
I have 3 swf files: Main, FontLibrary and Graphics.
Main.swf loads the other two and applies logic.
Graphics.swf is created in Flash CS5 and contains a dynamic TextField instance, to which I want to apply a font from FontLibrary.swf. To know which font to apply, I apply the same font to textfield when I create it on stage.
The problem is that the textfField with embedFonts=true searches for glyphs in its own swf file first. I don't want to embed the font in Graphics.swf. I use anti-alias type "Use device fonts". But as size report shows it still embeds the font, with no glyphs though.
Is there a way to not embed a font into swf file using Flash CS5.5?
(Buy the way, if I use TLFTextField it doesn't embed the font)
Or how can I handle the situation from my Main.swf in a way that I get font not from Graphics.swf, but from FontLibrary.swf

Good tutorial for you:
http://www.republicofcode.com/tutorials/flash/as3text/
http://www.republicofcode.com/tutorials/flash/as3css/

Similar Messages

  • Accessing a non TTF/OTF font embedded in Flash CS5 SWF via Flex

    Hello,
    I'm trying to embed an older Mac font in a Flash Builder application. I need it to be loaded dymanically for size reasons. I am able to do this with TTF and OTF fonts, but I'm having trouble with other formats.
    I embedded the font in a CS5 FLA, but I can't seem to locate the font when I load the SWF into Flash Builder.
    My function is below. I have it enumerating through the variables in the loaded SWF, but the font I need is not coming up as one of them. I tried, in the FLA, to cast the embedded font to a Class in AS because, but when try to access that variable ("font") after it's loaded, I get null. I also tried setting the embedded font to a Font variable in AS, but I still get null on the other side. Does anyone have any suggestions? Alternate solutions are welcome also.. Thanks!!
            private function loadFonts():void{
                var lc:LoaderContext = new LoaderContext();
                lc.securityDomain = SecurityDomain.currentDomain;
                lc.applicationDomain = ApplicationDomain.currentDomain;
                var ldr:Loader = new Loader();
                ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
                ldr.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
                ldr.load(new URLRequest('compatil_bold.swf'),lc);
                function completeHandler(e:Event):void{
                    fontLibrary = e.target.applicationDomain.getDefinition('Compatil') as Class;
                    var varList:XMLList = flash.utils.describeType(fontLibrary)..variable;
                    for (var i:int = 0; i < varList.length(); i++){
                        trace(varList[i].@name+': '+fontLibrary[varList[i].@name]);   
                    Font.registerFont(fontLibrary.font);
                    //Font.registerFont(fontLibrary.CompatilFactBold);
                    trace('font loaded');
                    fontsLoaded = true;
                function ioErrorHandler(e:ErrorEvent):void{
                    trace(e.text);
    in FLA
    var font:Class = new CompatilFactBold() as Class;

    I got it!
    Here is the embedded font in a CS5 FLA:
    That's all you have to do in Flash.
    Here's the function I have in my Flash Builder AS application:
    private function loadFonts():void{
    var lc:LoaderContext = new LoaderContext();
    lc.securityDomain = SecurityDomain.currentDomain;
    lc.applicationDomain = ApplicationDomain.currentDomain;
    var ldr:Loader = new Loader();
    ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
    ldr.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
    ldr.load(new URLRequest('http://some.other.domain/compatil_bold.swf'),lc);
    function completeHandler(e:Event):void{
    fontLibrary = e.target.applicationDomain.getDefinition('CompatilFactBold') as Class;
    Font.registerFont(fontLibrary);
    trace('font loaded');
    fontsLoaded = true;
    function ioErrorHandler(e:ErrorEvent):void{
    trace(e.text);
    Then you reference the font by its name when you want to use it. In this case: 'CompatilFact LT Bold.'
    update: question is answered.

  • How to make the font shown in Flash CS5 ?

    The font can not be shown in Flash CS5,
    I download the Meiryo font from internet, and paste it to the font folder in windows7 control panel , when i re-open the flash cs5, it is not shown yet. who can tell me how to solve this problem?

    Thanks for the tip, I did try this, but it didnt work.  It works for Texting, email and other apps, but not the "Music" or itunes app.  thats the frustrating part.

  • Issues with font in adobe flash cs5

    i have a font that is installed on my system Mac OSX Lion and can view it fine, however i have a fla file that i used the font in and when i look at the drop down box of fonts, this is not showing, i have tried reinstalling the font with no luck what so ever.  Any help here would be greatly appreeicated.         

    Are you using Classic textFields or TLF textFields? In authoring you see the font that you want, you can select that font and use it in a textField during authoring, correct?
    How are you using the font? Is the font in your movie's Library? Are you using the font in a static, input or dynamic textField, if you are using TLF text then is the textField Read Only, Selectable or Editable?
    Are you embedding the font?
    Do you see the text when you Test Movie in authoring?

  • Font not visible in Flash CS5

    Hi,
    I have purchased this font "HY Zhong Hei Simplified Chinese J" and installed on my PC but it is not visible in FLASH CS5
    Please help.
    Thanks,
    Vikrant

    Yes it is listed in other softwares like photoshop and it is also in TTF format.
    Photoshop: Font showing up
    Flash CS5: Font not showing up

  • Mediamind not show in Flash CS5

    Hi guys,
    The .mxp is installed (showing up in extension manager) but not showing up in Flash.
    Tried restarting Flash, un-installing + re-installing .mxp, reboot.
    only see the old version of eyeblaster workshop...I've read the related forum topics and the installation guide.
    as I can do to fix it?
    thanks!!!

    Yes it is listed in other softwares like photoshop and it is also in TTF format.
    Photoshop: Font showing up
    Flash CS5: Font not showing up

  • Embedding and using external fonts in Flash CS5

    I just upgraded to Flash CS5.  Font embedding is entirely different than it was in CS4.  I've been looking for examples online but none seem to show me a solution that matches what I need.
    In the project I'm working on, code changes the font a text box uses based on region and language.  To keep file size down I created separate swf files with the fonts embedded.  That way I only download the font I need.  The way I did this and the code I used in CS4 doesn't seem to work anymore.  Can someone please point me to a tutorial on this.
    Thanks

    OK, maybe you can help me figure out what I'm doing wrong.  Below is the code I'm using.
    LOADING THE FONT
    Font SWFs:
    I'm trying something new with CS5.  To create a swf with the font I need I'm creating a library symbol of the font with all the characters in it.  Titled it "Verdana".  I've also turned on Export for ActionScript and given the font a unique class name (VerdanaFont).  Then of course publish the swf, name it Verdana.swf, and put it in the correct location.  Does doing it this way automatically register the font?
    The Loader code:
    private function LoadFont()
    var fontPath:String = "assets/fonts/Verdana.swf";
    var fontLoader:Loader = new Loader();
    fontLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, createTextBox);
    fontLoader.load(new URLRequest(fontPath));
    The TextBox code:
    private function createTextBox()
    var tf:TextFormat = new TextFormat;
    tf.font = "Verdana";
    tf.align = "left";
    var textBox:TextField = new TextField;
    textBox.embedFonts = true;
    textBox.selectable = false;
    textBox.htmlText = "This is test text";
    textBox.setTextFormat(tf);
    stage.addChild(textBox);

  • Flash CS5.5 - font outlines still get embeded while using runtime sharing

    I have a project where I use several SWFs and have the fonts outlines stored into a seperate SWF. Within the .fla file's I have checked the Import for runtime sharing with the various font definitions.
    In the library the linkage part shows for every font the Import: classname
    To get a correct idea how things look within the IDE, I've checked several character ranges within the font properties so the preview renders correctly.
    In Flash CS5 everything was working correctly; no font outline was included within the SWF. The size report also shows this.
    When I create the SWF with Flash CS5.5 font outlines of the selected ranges still get embedded into the SWF. The file size of the SWF is much larger and the font outline information shows up in the size report.
    Anyone has a solution for this problem?

    I've just stepped into the same problem. Quick analysis of SWF content showed that all "import" tags have been removed and replaced by "font" tags (sometimes empty (empty - meaning no glyphs are there), sometimes not). I am publishing SWFs for Flash 8/ AS 2.0, thus, the SWFs should be FULLY compatible with old players. Technically speaking, importing of fonts is totally busted in CS5.5 and makes the CS5.5 completely unusable for us.
    Seems VERY much like a nasty bug. I am going to play a bit more with it in order to find a workaround. If not - I'll go back to CS5. I really hope Adobe will fix this bug ASAP. I have submitted a bug report about this issue.
    A bit more info about repro the issue: create font.fla and export font $Font from it. Create the second fla (main.fla) that imports the font $Font from  the font.swf. Publish all the swfs. Look inside the main.swf and instead of "ImportAsset" tag for font you'll see the regular "Font" tag (like it was never imported). However, the "ExportAsset" tag exists in font.swf and it looks completely fine.
    AB: Added some info

  • Library font Bitmap text (no anti-alias) Flash CS5

    Ok, in previous version of flash we had this window:
    But now in Flash CS5 the new font embedding window is changed, and there is no Bitmap text checkbox, so how am I to create dynamic Text Fields with ActionScript, and embed the fonts in them using Bitmap text [no anti-alias]? And don't give me the GridFitType.PIXEL solution, I want true Bitmap text.

    Can someone please help me with the above problem?
    I've published two images to show what appen.
    This it's the correct
    one (without embedding font and with font installed in the client
    machine).
    This it's the wrong one
    (with font embedded and not installed in the client machine).
    I'm so sad... thanks
    -g

  • Using fonts embedded in the main app in Flash swf(s) loaded at runtime

    Hello there,
    My main application has several fonts embedded via CSS:
    @font-face {
    src: url('/Library/Fonts/ACaslonPro-Regular.otf');
    fontFamily: CaslonR;
    unicodeRange: U+0021-U+007E;
    At runtime the main application loads various swf files that were created in Flash CS5.
    I can't figure out how to allow those dynamically loaded external swf files to use the fonts that are already embedded in the main application.
    Of course I can embed the font in each swf in Flash CS5 to begin with, but that doesn't seem like an elegant solution, let alone it significantly increases the file size of every swf.
    Thanks,
    FTQuest

    See the embedded font post on my blog
    Alex Harui
    Flex SDK Team
    Adobe System, Inc.
    http://blogs.adobe.com/aharui

  • How to use embedded font (CFF) for Flash CS4?

    Hi,
    I am trying to embed "Arial Unicode MS" for use by TLF in my Flash CS4 project. As I googled around, I am using the "Flex SWC" approach, only not having any luck. Here is what I got:
    //Code in Flex ActionScript project:
    package
        public class FontEmbeds
            [Embed(source='C:/Windows/Fonts/ARIALUNI.TTF',
                    fontFamily='ArialUnicodeMS',
                    embedAsCFF='true'
            public const Font1:Class;
    When I am trying to instantiate this class, I have AS code in my Flash main timeline:
    var font:Font = new FontEmbeds_Font1();
    Flash compiler says: "1067: Implicit coercion of a value of type FontEmbeds_Font1 to an unrelated type flash.text:Font."
    Ok. Now after I changed it to:
    var font:FontEmbeds_Font1 = new FontEmbeds_Font1();
    Flash gives 3 errors:
    "VerifyError: Error #1014: Class mx.core::FontAsset could not be found.
    ReferenceError: Error #1065: Variable TextLayout is not defined.
    ReferenceError: Error #1065: Variable MainTimeline is not defined."
    I am assuming I have to create a Font1 object in order to use the embedded font. Is this assumption correct? As I've tried to use the "fontFamily" directly but Flash didn't seem to find the font at all:
    charFormat.fontFamily = "ArialUnicodeMS";
    Thanks.

    Hi Eric,
    Thanks for the info.
    I've tried to use the "fontFamily" directly but Flash didn't seem to  find the font at all:
    charFormat.fontFamily = "ArialUnicodeMS";
    In one fla where I used pure TFL, nothing gets rendered at all in the container Sprite. Flash doesn't throw any errors either. In another fla where I used a ComboBox, etc. along with TFL, it throws an error says it can't compile since "there is no ActionScript found" and I got a screen where all the Flash components were  flickering. After several attempts, Flash crashed.
    Also as a side note, the swc gets generated by Flash Builder Beta 2, at first it was 18mb and the second time I complied it become 9mb and stayed 9mb afterwards. Not sure if that's a concern.
    Geng

  • Fonts not showing up in Flash CS5

    Maybe I'm missing something simple but I just can't get some fonts to appear in Flash cs5  on mac osx. they work fine in Photoshop / Illustrator, but don't appear in Flash.
    Any ideas?

    You may find something useful in one of these links:
    http://forums.adobe.com/message/3238692
    http://jeremy-knight.com/2011/05/certain-fonts-not-showing-up-in-flash/

  • How to disable automatic font embedding in CS5?

    I installed CS5 and opened an old .fla which did not embed the Arial font because everyone has it already. Mostly it is used for user-entered and dynamic content.  However, CS5 is auto-embedding the few characters I use in Arial, and all of the other characters are no longer showing up in the swf file.  The only fix seems to be embedding the entire Arial font in the movie, which is too large since I want to be able to support all kinds of characters.
    Is there a way to turn off auto-font embedding?  This feature seems well-intentioned but critically flawed if it can't be turned off.
    -Ben

    Hi,
    You can set the TextField's Anti-alias setting to "Use device fonts" if you don't want to embed the font.
    HTH,
    Nivesh

  • Flash CS5 IDE on OS X missing several font families from property inspector

    I'm missing several font families from the properties character font family inspector in my Flash CS5 ide on os x. These fonts are present in my font dir and are available in all my other CS5 suite applications (Photoshop, Dreamweaver, AfterEffects, etc).
    Anyone experience this?

    This forum is for Flash Media Server Developers so most likely you migth get much traction here. I would recommend you to post your query on Flash Builder forum: http://forums.adobe.com/community/flash_builder/using_flash_builder
    Also you can try posting here:
    Flash Platform Services For Promotion - http://forums.adobe.com/community/promotion
    Flash : http://forums.adobe.com/community/flash/flash_general

  • No Font-Embedding using AIR 3.0 in Flash Professional (for iOS Development)

    Hey there,
    we're developing some plain AS3 projects using Flash Professional (to compile) and Flash Builder.
    All is working good with the new AIR 3.0 release and performance is better than with AIR 2.6
    I followed this tutorial and simlar to use AIR 3.0 instead of AIR 2.6:
    http://kb2.adobe.com/cps/908/cpsid_90810.html
    Sadly today we saw a new issue with font embedding. Neither using Flash Professional itself or Embed-Tag in the code itself works. Also we see that the SWF size does not change when adding multiple fonts.
    Anybody has a clue where this issue might be caused? I can think that the way fonts are embedded has changed in AIR 3.0 and it's not working with the "replace AIR 2.6 with AIR X.Y trick".
    Any help welcome.
    Best,
    Cedric

    Hi,
    yes. It works now.
    The problem was the TLFTextField itself. Strangely in debug on my Mac fonts showed of correctly, but on the device not. So I assumed that there was an problem of embedding.
    But after changing setDefaultFormat to setFormat, then setting the tlftextfield.htmlText = ".." and after that doing tlftextfield.textFlow.flowComposer.updateAllControllers(); it works on the device.
    Strange to me, that with active fonts on my Mac it works without updateAllControllers - but on the devices not.
    Thanks for the hints.

Maybe you are looking for