AS3 dynamic font embedding bug

Hi all,
Is there a known bug for the following case?
Case:
A project I'm working on doesn't seem to handle font embedding correctly when the font is added dynamically using actionscript. When I test my movie it does not display the embedded font at all. Curious about this is, that when I create an empty project using the same code and then embed the font and test the movie it displays the font without any problem.
Sometimes a reboot of the machine I'm working on will suffice to make the embedding work again, but sometimes is not all the time. So I was wondering if there was a memory related bug that causes this behavior. If so, is there any sight on a solution for this bug? It's more than annoying to reboot eight times a day, just to test a movie.
How did I embed the font:
1. Create a "New Font" in the Library, set the properties and give it a classname.
2. Using actionscript to embed the font in a dynamically generated TextField.
package{
import flash.display.MovieClip;
import flash.display.text.Font;
import flash.display.text.TextFormat;
import flash.display.text.TextField;
public class MyClass extends MovieClip{
var myFont:Font;
var myTextFormat:TextFormat;
var myTextField:TextField;
public function MyClass():void{
myFont = new Font1();
myTextFormat = new TextFormat();
myTextFormat.font = myFont.fontName;
myTextField = new TextField();
myTextField.defaultTextFormat = myTextFormat;
myTextField.embedFonts = true;
myTextField.text = "Lorem Ipsum...";
addChild(myTextField);
Cheers!
Do

I don't have Flash IDE on this machine so I cannot say for sure but try to register font:
public function MyClass():void {
     Font.registerFont(Font1);
     myFont = new Font1();
     // the rest...

Similar Messages

  • Dynamic Font Embedding

    My goal is to let the user of my flex/air application choose one of their system fonts from a drop down and then format text on the screen using that font.  The dropdown is built but I can't get it to change the font of the textbox and the font must be embedded in order for the rotate method to work properly on the textbox.  I get the following errors:
    "unable to resolve myvarrocks for transcoding"
    "Unable to transcode myvarrocks"
    Here is the code I was attempting to run.
    [Embed(source=myvarrocks,fontName="EmbedMyFont",mimeType="application/x-font")]
    Is there any way to do what I am attempting?   Thanks!
    varEmbedMyFont:Class;
    varEmbedMyFont:Class;
    Is there any way to do what I am attempting?   Thanks!

    In FP10, you can get reasonable rendering of rotated device fonts.
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • CSS & AS3 Font Embedding

    We have an application which is built like so:
    Framework SWC
    Application SWC
    - Sub-application for web
    - Sub-application for desktop
    - Unit test runner
    - etc.
    The applications all share a look and feel including fonts. This was easy to achieve with Flex 3 using the trick with placing a defaults.css file at the root of the Flex Library Project. This would apply the CSS in the defaults.css file as the default theme, and font embedding calls in the CSS could refer to font files in the Flex Library Project. It worked great because we are also using a Sprite-based custom label class which embeds its font using AS3.
    Now, the CSS font embed lines only work if we also place the fonts in the Sub-application. This means we have to have the fonts copied in every sub-application for the CSS as well as in the SWC for the AS3 embedded label class.
    Is there a better way to achieve this in Flex 4, if we want embedded fonts in AS3 as well as Spark components?
    Thanks!
    Patrick

    Flex harUI wrote:
    I'm not sure exactly why you can't use Label and RichEditableText.  You
    might want to revisit that decision.
    If the font is embedded in the main app SWF and is picked up by TextFormat,
    then the most common possibility is that somehow other SWFs are being used
    to factory the FTETextField.  Maybe since styles are now per-SWF that's what
    is going on.
    I cannot use Label or RichEditableText because that particular text is being displayed in a completely Sprite-based view. We feel for that portion of the view that it is worth giving up the advantages of UIComponent to get something lighter weight.
    The font for the Sprite-based text is embedded in the class for that text field. The font for the UIComponent-based text is embedded using CSS. Is there a way to use a single compiled SWF for both? Would the SWF just be a single class embedding the fonts? That way we could pull it in at runtime. Would that work for the TextFormat as well?
    Thanks,
    Patrick

  • Font Embedding in dynamic TLFTextField

    hi, how to get the same features of a static text field in TLF TextField dynamically;
    for eg. I kept a static text in stage with features like font family= "verdana", color="0x000000",  bold = true, font size =14.
    i created a TLF TextField  dynamically, with same features, but the UI is not exactly the same,
    can anyone help me to solve this,
    Thanks in advance.
    // Coding sample-------
    package com
    import fl.text.TLFTextField;
    import flash.text.TextFormat;
    import flash.text.Font;
    import flash.display.MovieClip;
    public class Document extends MovieClip
      private var format:TextFormat;
    //Stage size = 400*200 ( For Testing )
      public function Document()
       createFormat();
       var TLFText = createTLFTextField();
       TLFText.text = "Font Embedding Problem";
       TLFText.defaultTextFormat = format;
       TLFText.embedFonts = true;
      private function createTLFTextField():TLFTextField
       var txt:TLFTextField = new TLFTextField();
       txt.x = 250;
       txt.y = 200;
       txt.width = 250;
       txt.height = 30;
       txt.selectable = false;
       addChild(txt);
       return txt;
      private function createFormat():void
       var verdana:Font=new VerdanaClass();  
       format = new TextFormat();
       format.color = 0x000000;
       format.bold = true;
       format.font = verdana.fontName;
       //format.font = "Verdana";
       format.size = 14;

    Hi,
    thnks for ur solution. it s helpful.. but still i have one issue that. how to embed fonts and change from style .. like textfield.
                    if (label.toUpperCase() == "SMALL")
                        StyleManager.getStyleDeclaration(".heading").setStyle("fontSize", 21);
                          StyleManager.getStyleDeclaration(".subheading").setStyle("fontSize", 17);
                    else if (label.toUpperCase() == "MEDIUM")
                        StyleManager.getStyleDeclaration(".heading").setStyle("fontSize", 23);
                        StyleManager.getStyleDeclaration(".subheading").setStyle("fontSize", 19);
                    else if (label.toUpperCase() == "LARGE")
                        StyleManager.getStyleDeclaration(".heading").setStyle("fontSize", 25);
                        StyleManager.getStyleDeclaration(".subheading").setStyle("fontSize", 21);
    i need to to like this way  in TextLayout framework... any possiblity ..
    pls let me know...
    regards,
    sundarapandian.k

  • How to use dynamic loaded embeded font?

    I have loaded fonts.swf on startup. I don't use TextLayout
    Embeded fonts feature. Then i have loaded some xml and assign xml
    to TextLayout. How I can use loaded font for display?

    Are you using Flash CS4 or Flex?
    Check out the following blog post, it contains instructions
    for font embedding that may help you out:
    Embedded
    Font Subsetting Using DefineFont4

  • How do you define which character set gets embedded with a font embedded in the library (i.e. Korean)?

    I have project that uses a shared fonts. The fonts are all
    contained in a single swf ("fonts.swf"), are embedded in that swf's
    library and are set to export for actionscript and runtime sharing.
    The text in the project is dynamic and is loaded in from
    external XML files. The text is formatted via styles contained in a
    CSS object.
    This project needs to be localized into 20 or so different
    languages.
    Everything works great with one exception: I can’t
    figure out how to set which character set gets exported for runtime
    sharing. i.e. I want to create a fonts.swf that contains Korean
    characters, change the XML based text to Korean and have the text
    display correctly.
    I’ve tried changing the language of my OS (WinXP) and
    re-exporting but that doesn’t work correctly. I’ve also
    tried adding substitute font keys to the registry (at:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows
    NT\CurrentVersion\FontSubstitutes) as outlined here:
    http://www.quasimondo.com/archives/000211.php
    but the fonts I added did not show up in Flash's font menue.
    I’ve also tried the method outlined here:
    http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_16275
    to no avail.
    I know there must be a simple solution that will allow me to
    embed language specific character sets for the fonts embedded in
    the library but I have yet to discover what it is.
    Any insight would be greatly appreciated.
    http://www.quasimondo.com/archives/000211.php
    http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_16275

    Thanks Jim,
    I know that it is easy to specify the language you want to
    use when setting the embed font properties for a specific text
    field but my project has hundreds of text fields and I'm setting
    the font globally by referencing the font symbols in a single swf.
    I have looked at the info you've pointed out but wasn't
    helped by it. What I'd like to be able to do is to tell Flash to
    embed a language specific character-set for the font symbols in the
    library. It currently is only embedding Latin characters even
    though I know the fonts specified contains characters for other
    languages.
    For example. I have a font symbol in the libary named
    "Font1". When I look at its properties I can see it is spcified as
    Tahoma. I know the Tahoma font on my system contains the characters
    for Korean but when I compile the swf it only contains Latin
    characters (gylphs) - this corresponds to the language of my OS (US
    English). I want to know how to tell Flash to embedd the Korean
    language charaters rather than or as well as the Latin characters
    for any given FONT SYMBOL. If I could do that, then, when I enter
    Korean text into my XML files the correct characters will be
    available to Flash. As it is now, the characters are not available
    and thus the text doesn' t display.
    Make sense?
    Many thanks,
    Mike

  • Font embedding works in 1.8 preview, not in 1.7.2

    Hello,
    I'm currently creating epubs and testing them in ADE. I am embedding Google Webfonts.
    I'm finding that many fonts embedding using @font-face are ignored by ADE 1.7.2. However, ADE 1.8 preview appears to show them as intended. Incidentally, the fonts are always shown correctly on ibooks.
    Could you please let me know what is wrong - is it a bug with ADE 1.7.2, or would there be a reason why it would not 'like' my Webfont TTFs? I've found at least one other user having a similar problem, apparently: http://www.mobileread.com/forums/showpost.php?p=1725479&postcount=7
      @font-face {
      font-family : 'FanwoodItalic';
                                            src: url(fonts/Fanwood/Fanwood-Italic-webfont.ttf);
      font-style: normal;
                        h2 {
      font-family: 'FanwoodItalic';
    Thanks for your help.

    Are the fonts obfuscated? If so, using what method?

  • 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

  • Dynamic Fonts loading in CS4 vs CS3. What has changed?!

    Hi there,
    I've had BIG troubles loading dynamic fonts in CS4. Well I had a whole library written in AS3 for CS3 which works just fine. But the whole thing doesn't work anymore in CS4. The textfields are empty although the fonts are loaded and registered via Font.registerFont. So the loading process actually worked. But the text just doesn't appear anymore.
    In CS3 it works, in CS4 id doesn't work, with exactly the same FLA and AS files.
    The Font files were exported with CS3. Maybe there's the problem? There is another font-file I had to export with flex (due to the character limitations in the flash IDE), that actually does work(!)
    So what has changed between CS3 and CS4? There must be some reason why things don't work anymore like they did before.
    If someone is interested in the source... it's quite a lot just to get a font loaded.

    just out of curiosity -- did you update all of the applications?
    elaine

  • 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.

  • 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

  • Java Embedding bug in SOA Suite 11g BPEL??

    I am beginning to wonder if there is a 'bug' in the SOA Suite 11g, BPEL, Java Embedding activity? Need some help as soon as possible – does the Java Embedding activity work in SOA Suite 11g?
    Have tried the following on Jdev 11.1.1.1 and Jdev 11.1.1.3 – get the same error message (see below for error message).
    Thanks for any help - Casey
    I created a simple composite app by:
    1.     Created a Composite with BPEL Process
    2.     Created a BPEL variable by the name of Variable and a Simple Type of string      ({http://www.w3.org/2001/XMLSchema}string)
    3.     Added an Assign activity (Assign_1) and assigned the value of “Test Var” to the variable Variable using a Copy operation.
    4.     Then, after the assign activity, added a Java Embedding activity (Java_Embedding_1) with Java Version set to 1.5 and the following code:
    +try{+*
    String var;*
    var=(String)getVariableData(Variable);*
    System.out.println(var);*
    +}  // end try+
    +catch(Exception ex){+*
    System.out.println(ex.getMessage());*
    +}// end catch+
    Compiled and got the following error message:
    Error(23,34): Failed to compile bpel generated classes.*
    failure to compile the generated BPEL classes for BPEL process "BPELProcess1" of composite "default/Project1!1.0"*
    The class path setting is incorrect.*
    Ensure that the class path is set correctly. If this happens on the server side, verify that the custom classes or jars which this BPEL process is depending on are deployed correctly. Also verify that the run time is using the same release/version.*
    Code for the BPEL component is:
    +<?xml version = "1.0" encoding = "UTF-8" ?>+
    +<!--+
    +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+
    Oracle JDeveloper BPEL Designer
    Created: Tue Nov 09 13:01:49 CST 2010
    Author:
    Purpose: Asynchronous BPEL Process
    +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+
    -->
    +<process name="BPELProcess1"+
    targetNamespace="http://xmlns.oracle.com/TestgetVariable_jws/Project1/BPELProcess1"
    xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:client="http://xmlns.oracle.com/TestgetVariable_jws/Project1/BPELProcess1"
    xmlns:ora="http://schemas.oracle.com/xpath/extension"
    xmlns:bpelx="http://schemas.oracle.com/bpel/extension"
    xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
    xmlns:ns1="http://xmlns.oracle.com/pcbpel/adapter/file/TestgetVariable/Project1/FileW"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    +<!--+
    +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+
    PARTNERLINKS
    List of services participating in this BPEL process
    +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+
    -->
    +<partnerLinks>+
    +<!--+
    The 'client' role represents the requester of this service. It is
    used for callback. The location and correlation information associated
    with the client role are automatically set using WS-Addressing.
    -->
    +<partnerLink name="bpelprocess1_client" partnerLinkType="client:BPELProcess1" myRole="BPELProcess1Provider" partnerRole="BPELProcess1Requester"/>+
    +</partnerLinks>+
    +<!--+
    +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+
    VARIABLES
    List of messages and XML documents used within this BPEL process
    +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+
    -->
    +<variables>+
    +<!-- Reference to the message passed as input during initiation -->+
    +<variable name="inputVariable" messageType="client:BPELProcess1RequestMessage"/>+
    +<!-- Reference to the message that will be sent back to the requester during callback -->+
    +<variable name="outputVariable" messageType="client:BPELProcess1ResponseMessage"/>+
    +<variable name="Variable" type="xsd:string"/>+
    +</variables>+
    +<!--+
    +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+
    ORCHESTRATION LOGIC
    Set of activities coordinating the flow of messages across the
    services integrated within this business process
    +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+
    -->
    +<sequence name="main">+
    +<!-- Receive input from requestor. (Note: This maps to operation defined in BPELProcess1.wsdl) -->+
    +<receive name="receiveInput" partnerLink="bpelprocess1_client" portType="client:BPELProcess1" operation="process" variable="inputVariable" createInstance="yes"/>+
    +<!--+
    Asynchronous callback to the requester. (Note: the callback location and correlation id is transparently handled using WS-addressing.)
    -->
    +<assign name="Assign_1">+
    +<copy>+
    +<from expression='"test var"'/>+
    +<to variable="Variable"/>+
    +</copy>+
    +</assign>+
    +<bpelx:exec name="Java_Embedding_1" version="1.5" language="java">+
    +<![CDATA[/*Write your java code below e.g.+
    +     System.out.println("Hello, World");+
    +*/+
    +try{+
      +String var;+
      +var=(String)getVariableData(Variable);+
      +System.out.println(var);+
    +} // end try+
    +catch(Exception ex){+
    System.out.println(ex.getMessage());
    +}// end catch]]>+
    +</bpelx:exec>+
    +<invoke name="callbackClient" partnerLink="bpelprocess1_client" portType="client:BPELProcess1Callback" operation="processResponse" inputVariable="outputVariable"/>+
    +</sequence>+
    +</process>+

    Java Embedding bug in SOA Suite 11g BPEL??

  • Can not copy text from pdf with unicode font embedded.

    Hello,
    I have a pdf with unicode font embedded in it. The pdf has no restrictions. When i try to copy some text text fro m pdf and then paste itin word, the text is not the same which i copied from the pdf. it changes.
    I have tried multiple softwares which converts pdf to word or pdf to excel. but none can do my job. what should be the problem? Kindly guide me.
    Thanks & Regards-
    rashmi

    Thanks for your prompt reply.
    As i said i have the font installed on my system. for your reference,
    following is the link to the pdf file. also the second link is the link to
    the fonts used. Kindly help me to sort this issue.
    https://www.yousendit.com/download/T2dkcHBEVEh0QTIwYjhUQw
    https://www.yousendit.com/download/T2dkcHBFQXBrYUJYd3NUQw

  • Font embedding problem PPT plugin Acrobat 9 Pro

    Hi,
    having just updated to Acrobat 9 Pro I encounter a font embedding problem when using the PowerPoint plugin (PPT2007) to create a PDF of my presentation. I am working under Windows 7 (64Bit) and use fonts from Mathematica (Wolfram). The generated PDF shows problems displaying the fonts, indicating that they have not been embedded (although font embedding of these fonts is set in the options). The problem does not occur if I directly print to the PDF printer - here all Mathematica fonts are correctly embedded (but this has other disadvantages since videos/animations are not integrated). The problem seems to be specific to Acrobat 9 since under Acrobat 8 everything worked correctly as well.
    Any ideas/solutions for that issue?
    Thanks & best regards
    Ralf

    Perhaps you may need to upgrade to version 9.2 (Acrobat support of Windows 7 begins at this dot release)?
    Be well...

  • Embedding fonts in an existing pdf that does not have the fonts embedded

    Hi,
    I have an existing pdf that fails to open on my ereader.
    So I opened in acrobat x pro to see what might be the cause.
    Selecting "file"--> "properties" -->"font" ( fonts used in this document) I can see that this pdf uses multiple windows trueType fonts and that none of them are embedded in the pdf document.
    Now my ereader is linux bases, so I am guessing this might be a problem.
    Being an ereader I didn' give me much to go on.
    So i would like to embed all the fonts listed in this list into the pdf file and save it again with the fonts embedded.
    I went to "file"-->"save as optimized pdf" -->"font"
    But there both lists embedded and unembedded fonts are empty.
    Why is this and how can I embed the fonts shown in the document properties into the pdf?
    They seem standard windows fonts like e.g.  ArialNarrow

    I just looked a bit furder and actually checked wether the fonts existed and found the following:
    I am using windows vista.
    The fonts mentioned in the properties of the pdf actually exist in the windows installed fonts but
    in windows they are no longer TrueType but OpenType.
    So I am guessing this might be the reason they are not in the list of unembedded fonts in the optimizer window.
    Is there an easy way to say to acrobat to replace one font ( not found on this computer) with another font that does exist and also to embed that font in the pdf document?

Maybe you are looking for