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);

Similar Messages

  • Embedding and using external fonts.

    I'm using Flash CS4.  I'm trying to load and embed an external font.  The main problem I'm having is that I need to import more than just latin 1.  I need many special characters imported as well.  Because of this, using Flash CS4's create new font from the library is not an option.  I'm using Verdana, so I know the font has all the characters I need.
    So what I need to do is create an external swf that holds the font.  Then I need to import and use the font.  Unfortunately, I've found way too many ways online that work but don't fit my needs.
    Any help is appreciated.

    1. Embedding
    a. You can embed font in Flash IDE by creating Font as a library asset and then compile this swf. There are tons of help available on Internet.
    b. If you use Flash CS5 or compilers that utilizes Flex SDK, you can create class like below and compile it into a swf:
    package 
         import flash.display.Sprite;
         public class FontLibrary extends Sprite
              [Embed(systemFont="Verdana", fontName="_verdana", mimeType="application/x-font", advancedAntiAliasing="true", fontStyle="normal",unicodeRange="U+0020-U+007E")]
              public static var Normal:Class;
              [Embed(systemFont="Verdana", fontName="_verdana", mimeType="application/x-font", advancedAntiAliasing="true", fontStyle="normal", fontWeight="bold",unicodeRange="U+0020-U+007E")]
              public static var Bold:Class;
              [Embed(systemFont="Verdana", fontName="_verdana", mimeType="application/x-font", advancedAntiAliasing="true", fontStyle="italic", fontWeight="normal",unicodeRange="U+0020-U+007E")]
              public static var Italic:Class;
              [Embed(systemFont="Verdana", fontName="_verdana", mimeType="application/x-font", advancedAntiAliasing="true", fontStyle="italic", fontWeight="bold",unicodeRange="U+0020-U+007E")]
              public static var ItalicBold:Class;
    No matter what way you choose - you will have font available the external swf.
    Try to load external swf into current domain. When you load the swf there is no much to do. Once swf is loaded - fonts should be available throughout application.
    To use the font - just pass its name into TextFiled instance's TextFormat. WIth the example above:
    myTextFormat.font = "_verdana";
    Documentation for TextFormat:
    http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/text/TextFormat.html
    To see available fonts you can use the following:
    var allFonts:Array = Font.enumerateFonts(false);
    allFonts.sortOn("fontName", Array.CASEINSENSITIVE);     
    for (var i:int = 0; i < allFonts.length; i++)
         trace(allFonts[i].fontName);

  • Dynamic and shared TLF font help in CS5

    I am simply trying to use a special font in Flash CS5 in a dynamic text field. This was so easy to do before CS5. I am not able to embed fonts in CS5 and have them work?
    I am working on a large project and the time to relearn Flash each release, makes it not cost effective use anymore.

    Then don't use the TLF textfields and just use the Classic textfields. They work the same way they used to.
    So details would help. What kind of font? What kind of embedding? and...
    ... what kind of trouble are you having embedding fonts? I haven't done a lot with it, but the bit I have seems to be much more straight forward and easy to do.

  • I have a iMac version 10.6.8 and used to have adobe flash player my laptop requires me to download the latest version of the player but warns me that there is a "risk" downloading from the internet. Anyone else experienced this and may have some solutions

    I have a iMac version 10.6.8 and used to have adobe flash player my laptop requires me to download the latest version of the player but warns me that there is a "risk" downloading from the internet. Anyone else experienced this and may have some solutions

    Install it directly from Adobe. Ensure that you use the uninstaller before installing.

  • When you create a PostScript file you must rely on system fonts and use document fonts

    I got this error:
    "When you create a PostScript file you must rely on system fonts and use document fonts. Please go to the printer properties, "Adobe PDF Settings" page and turn OFF the option "Rely on system fonts only; do not use document fonts."
    This strikes me as bad practice. I only want to use system fonts and document fonts will muck me up.
    That being said, I could not easily find a way to fix this with Acrobat Pro XI. I opened Control Panel (Windows 8) and found the printer and mucked around in the various ways to get to change the PDF settings (there are several ways, and some of them present the choices as bold and not just regular). I found two separate switches for "Rely on system fonts only; do not use document fonts" and turned both off, BUT that did not work.
    Frustrated, I went back to FrameMaker and clicked File > Print Setup and then for the PDF printer, Printer Properties. There I found a THIRD instance of "Rely on system fonts only; do not use document fonts" that was set differently than the other two. This was the setting the error message meant. Change this one.
    Thanks for the convoluted UI, Adobe. What a pain, but there is the answer for all who follow after....

    > Windows 7 and Frame 7.2.
    This is not a supported configuration and probably does not work, due (I'm guessing) to driver API changes from XP to Win7, which would affect generating PDF and Ps output. This would affect Save-as-PDF and Print-to-Ps+Distill (unless you have a newer version of the full Acrobat product).
    As it happens, I'm going to attempt something similar: FM 7.0 on Win7 64 Pro. However, I'm going to install that old FM in "XP Mode".
    XP Mode is a 32-bit virtual machine running actual Windows XP inside Win7. It is (now maybe "was") available for Windows 7 Enterprise, Professional and Ultimate (but not Basic, Home or not-so-Premium). When XP went off support life earlier this month, Mr.Bill may have taken down the ability  to download XP Mode (or not, since some large enterprises are able to  purchase continued support for XP at some great cost). XP Mode never was supported for Win8. There are other VMs for Windows available.
    If XP Mode is still available, you also need a CPU that has hardware virtualization, which all recent 64-bit AMD processors do, but which is fused-off in many low end 64-bit Intel processors. AMD processors need a separate unobvious hot-fix patch installed before you do anything else about XP Mode.

  • How do I setup and use Hawaiian fonts?

    How do I setup and use Hawaiian fonts in OSX 10.7.4?  The instructions I obtained by Googling no longer seem to work.  See Wahinoho.net
    Message was edited by: fbeckner

    How do I setup and use Hawaiian fonts in OSX 10.7.4?  The instructions I obtained by Googling no longer seem to work.  See Wahinoho.net
    Message was edited by: fbeckner

  • Help: Embedding Japanese Fonts in Flash cs5 is actionscript

    I have been trying to embed "小塚ゴシック Pro M" font via export for actionscript and I haven't had luck so far. I did the font.registration method but still no luck I had no problem doing this in CS3 and CS4 but CS5 must be different. Anybody got this to work?
    TIA
    Gerry

    I got it. For those who might have the same question.
    register font and use the name you used to export to actionscript like:
    Font.registerFont(Font2);
    to use, create a variable for the font:
    var myFont = new Font2();
    to apply:
    urTextFormatvarhere.font = myFont.fontName;
    I did this to apply alpha;
    urTextFieldvarhere.embedFonts = true;
    urTextFieldvarhere.antiAliasType = AntiAliasType.ADVANCED;
    Hope this helps!

  • Embedding and securing my font

    Hi to all,
    Its my first post, and need urgent help.
    Iam developing a application in local language and iam using my own font to be used in it. It will be used in as a resource in the application (embedded with app).
    Can anyone help me how to secure my font in the jar file. So that no one can extract it and use it.
    Any kind of help will be appreciated.
    Thankx in advance
    GD

    Can anyone help me how to secure my font in the jar
    file. So that no one can extract it and use it.Can't be done.

  • Anti alias and Use device font not why is that not working?

    I am editing a flash template that I have and I know
    about the anti alias setting and I went through all the text boxes and set them to use device fonts and they all seem to b
    e working except for the sliding text boxes, see attached images that show the sliding box (the gray color) and the text box behind it, when I drill down to the text box it is set to use device fonts already but when I enter my text it does not show all the letters (the W A and V for example are missing) I know that is caused by the Antialias setting but I am unable to find what is set to that in this sliding box, what am I missing? I am a very novice user so please be as detailed as you can in you answer, I can provide any information needed. Thank s in advance.
    I am using CS10

    I had the same issue. They say that because TRC Sri Lanka haven't registered IPad or apple as a safe product. That means the IMEI of apple products will not match with srilankan regulatory specifications. But this issue will be solved in near future. Please contact telecommunications and regulatory bord for details. Dialog axiata can't help.

  • What is the best way to add and use custom fonts with Eloqua?

    We have a custom font that we'd like to use with Eloqua and were wondering how others might have successfully approached this.

    ~~Disclaimer: This answer refers to email fonts only - landing page font imports are discussed below~~
    Hi Brett,
    I took a look at these two posts: Re: Tips for getting the E10 email editor to change the email font for Outlook & other old-school email clients? and Re: E10 Fonts
    It seems that there are reasons as to why only a few of the fonts are supported. You can drill down into the source code to edit the font type, but I'm not sure that will get you anywhere.
    To drill down:
    To get the desired font & size in various clients (Gmail, Hotmail, Yahoo, Outlook) I found that specifying in the html works best.
    So whether it’s a P or TD, tag I add the style attribute & specify the font along with color & size.
    e.g.:
    <td style="LINE-HEIGHT: 18px; FONT-FAMILY: Arial, Helvetica, sans-serif; COLOR: #000000; FONT-SIZE: 12px;">
    Of course if you use the WYSIWYG editor you will have to view the html source & add this.

  • Disable iSight camera and use external USA webcam

    We have a macbook and use a large monitor for managing brochures etc. I would like to mount an external USB webcam on the monitor and use it with Skype. However, whenever I open Skype it turns on the iSight camera (which is facing a wall). Is there any way to have the external webcam be the active camera and disable the iSight camera?
    Thanks

    Frodo 51 wrote:
    We have a macbook and use a large monitor for managing brochures etc. I would like to mount an external USB webcam on the monitor and use it with Skype. However, whenever I open Skype it turns on the iSight camera (which is facing a wall). Is there any way to have the external webcam be the active camera and disable the iSight camera?
    Thanks
    I no longer use Skype, so I cannot test Skype's claims, but http://www.skype.com/go/help should best be able to help you use their product with your system.
    I found this page http://www.skype.com/help/guides/skypeformac/skypefeatures/video.html that seems to address your specific question. The picture on that page shows that you should be able to select among connected cameras from the "Camera:" choices bar in Skype > Preferences > Video:
    Of course, if you have only one compatible camera connected, only the one choice will show.
    Use the latest version of Skype that is compatible with your system. If camera selection works as explained in the Skype Help page, there should be no need to "disable the iSight camera."
    EZ Jim
    Mac Pro Quad Core (Early 2009) 2.93Ghz w/Mac OS X (10.6.2)  MacBook Pro (13 inch, Mid 2009) 2.26GHz (10.6.2)
    LED Cinema Display  G4 PowerBook 1.67GHz (10.4.11)  iBookSE 366MHz (10.3.9)  External iSight

  • How to Use External Fonts

    Hi All,
    How can I use extrnal fonts i.e (Windows\Fonts) in my PDF Reports? I'm using APEX 3.01 to print my reports to PDF files. Arabic Characters Appers like ????.
    Same report Appears OK when I select HTML, Excel, word as my print file.
    Thanks,
    Ribhi

    I have successfully used Russian Fonts in LV 7. There are two ways to go about this. The first way is to use an ini or config file to do the conversion for you. This way you can type russian into the file and read in the proper strings. The second way is to take the integer value of the character and type cast it to a string. You must have the russian font installed first before this will work. My example used the alphabet and converted it to Russian. I used the ER Univers 1251 font and used a for loop that will run 32 times and added the iteration terminal with the value of 192 for lower case and type cased each value into a string from an integer. For upper case letters add the iteration terminal with 224. This will display the Russian Alphabet. Hope this h
    elps.
    BJD1613
    Lead Test Tools Development Engineer
    Philips Respironics
    Certified LV Architect / Instructor

  • Applet loading and using ttf font

    Hello,
    I'd like my applet to load a TTF file from the server (or from a provided jar file) and
    use it to render text, or use it with GUI elements like TextArea.
    Here the significant part of my code:
            URL fontURL=applet2.class.getClassLoader().getResource("my.ttf");
            try { fontStream = fontURL.openStream(); } catch (Exception e) {
                str=str+"Error 1\n";
                e.printStackTrace();
            str=str+"Step 1\n";
    // also tried this way instead, as well as including the ttf in a jar or as separate file on the server
    //      fontStream = getClass().getResourceAsStream("my.ttf");
            try { font = Font.createFont(Font.TRUETYPE_FONT, fontStream); } catch (Exception e) {
                str=str+"Error 2\n";
                e.printStackTrace();
            str=str+"Step 2\n";
            try { fontStream.close();} catch (Exception e) {
                str=str+"Error 3\n";
                e.printStackTrace();
            str=str+"Step 3\n";
            big_font=font.deriveFont(40f);
            text_out_main = new TextArea(str,4,40,TextArea.SCROLLBARS_NONE);
            text_out_main.setFont(big_font);the funny thing is, that this works on several Linux installations I tried (all UTF8/Unicode based ones).
    And I tried several WinXP/Win2k FF/IE/Safari combinations and none of them works! The Windows
    machines all show a standard font but with the size 40f, I cant see any exceptions, the strings "Step 1"
    to "Step 3" are nicely attached to the main string and not a single "Error x" string appears.
    All systems use the latest jre 1.6 plugins.
    Any hints are appreciated.
    Thanks,
    Leander
    Edited by: Leander2000 on Jun 7, 2008 5:55 AM

    Meanwhile I found out that the TextArea (or probably any other awt gui element)
    did not use the font when running on Windows, when drawing to a Graphic or using
    it with a JTextArea everything is ok.
    Regards,
    Leander

  • Using different fonts in flash

    Ok so im using some very different fonts in my flash file. I
    know most people wont have the fonts ** 5 min pause had to answer a
    911 call of a foot bleeding excessively,** ok where was I? oh yeah
    my fonts. Ok so my fonts are so strange that no one else will have
    them. I noticed that they do not see the same fonts as me. I
    figured in flash that the fonts would be included in the swf making
    the fonts visible the say way i inteded them to be. Let me know if
    there is a way to make the fonts look the same as i want them to
    without converting them to gif or jpg

    There is an option to embed the font in your flash movie.
    That will fix your
    problem. I'm not at home so I can't include screenshot, but
    I'm sure if you
    google "embed fonts in flash" you'll find details on how to
    do it.
    "Flash Actions" <[email protected]> wrote in
    message
    news:fbl3n6$rv$[email protected]..
    > Ok so im using some very different fonts in my flash
    file. I know most
    > people
    > wont have the fonts ** 5 min pause had to answer a 911
    call of a foot
    > bleeding
    > excessively,** ok where was I? oh yeah my fonts. Ok so
    my fonts are so
    > strange that no one else will have them. I noticed that
    they do not see
    > the
    > same fonts as me. I figured in flash that the fonts
    would be included in
    > the
    > swf making the fonts visible the say way i inteded them
    to be. Let me
    > know if
    > there is a way to make the fonts look the same as i want
    them to without
    > converting them to gif or jpg
    >

  • FAQ: SWF's and loading external files in Flash Catalyst

    How do I make the images in my Flash Catalyst project external to the published SWF?
    You can choose whether images are embedded in your Flash Catalyst SWF, or loaded dynamically; this can help to keep your SWF's small. Simply right-click an image and chose "Externalize Image".
    Answered by: Adam Cath.
    See entire discussion.
    How do I make the SWF I imported to Flash Catalyst load external files?
    When importing a SWF, Flash Catalyst only pulls the SWF asset into your project. Many SWF's, such as slideshows and media players, rely on external data files, such as configuration files or media assets. If you would like to use such a SWF in Catalyst, then you will have to place these external resources into your Catalyst project as well as importing the SWF.
    Let's assume you have a SWF source folder that contains your SWF file and all of the external files it needs. You can open the SWF file from this folder and it works fine. But, if you import the SWF into Catalyst, the Catalyst project doesn't display it correctly because it can't load the external files. Here's what you do:
    1. Open your swf source folder, and copy all of the files/folders there except the SWF you imported.
    2. In Catalyst, Run/Preview your project (Ctl/Cmd-Enter)
    2. Note the file path to Main.html in your browser
    3. In your OS, open the folder that contains /bin-debug/Main.html from above
    4. Open the "src" folder
    5. Paste all of the files from step 1 into the src folder.
    6. Catalyst won't pick up that your project changed, so tweak it a bit (add a Rectangle), and save it.
    7. Run your project. If it doesn't work, try closing and reopening your project and running again.
    For an example, check out: Using an XML-driven SWF in Catalyst to create a slideshow.
    See entire discussion.
    Answered by: Bear Travis

    You can make you swf a custom component with 2 states.
    The first state will be empty and rename it "OFF" the second state will have your swf file and name it ON.
    Then go back to your artboard/project, add your 2 buttons ON & OFF.
    For the ON button add interaction "play transition to custom component ON"
    For the OFF button add interaction "play transition to custom component OFF"
    Here is an example swf_control

Maybe you are looking for

  • Why does illustrator CC crash on open in my macbook after installing cintiq 13HD?

    I used illustrator CC for a while and it was working fine. Then I got the cintiq 13HD and I setup eveything was required to make it work. I tried it with most of my applications specially photoshop, flash and even watched a movie on the cintiq and ev

  • Desperately Seeking Genius: iBook G4 won't go past gray screen w/ apple...

    Hi AppleHeads. I am looking for some assistance from a nice mac genius. I am trying to fix my sister's computer and am not sure exactly what to do here. Her laptop is an iBook g4 with 1.33GHz Power PC, G4 processor, 512 MB and 40 GB hard drive. She h

  • Problems with not in dates range

    I have a procedure that checks for business days but i want to alter it some. The code right now is holiday2 varchar2(1024); holiday2 := '2005-10-25' IF TO_CHAR (v_date, 'DY') NOT IN ('SAT', 'SUN') and to_char(v_date,'YYYY-MM-DD') not in (holiday2) T

  • Macbook Pro 15" Mid-2012 hard disk models?

    Hello, i am interested in buying the 2012 Macbook Pro 15 inch model and plan to upgrade the 750GB 5400rpm hard disk to a 7200rpm. Does anyone know what model is being used? Thankyou.

  • Lightroom recognition of folder source

    Recently I copied a large number of TIF and JPEG photos from 6 different EHDs into my HP Personal EHD that slips easily into the computer bay. In this way I had hoped to have all of these phtotos easily accessible and recognizable using LR 2.1 rather