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

Similar Messages

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

  • 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

  • Can I embed fonts of all Dynamic Text objects in a Flash file?

    Hi there!
    I'm fairly new to Flash, so please bear with me.
    I have created a Flash file which will act as our company's standard presentation / portfolio of all previous projects.  I've pretty much got it running the way I want, but I've just tried it on a few different computers and realised that the fonts aren't embedded.  I've used our corporate font so it needs to look right.  Having read the following documentation (http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Liv eDocs_Parts&file=00000893.html) I now understand how to embed fonts for one dynamic text object at a time.  However, I have a lot of different dynamic text objects in the file and I would dearly love to embed them all in one step!  The same embedding options can be applied to just about all objects, as they're all the same size and font.
    I hope someone can help me.  If you are able to help please spell things out in simple steps!!  I am aware that I probably haven't yet grasped a number of the basics of Flash.
    Thanks in advance,
    Stuart

    Static text doesn't need to be embeded. So I'm not sure what the problem you are having is. The page you linked to is for making an embedded font in your library that can then be exported for actionscript and used by code and style sheets. If you are following the instructions on the page you liked to you only need to do that once. Which shouldn't be too hard.
    That is usually a different problem that having a bunch of different authortime created textfields that need to have characters embedded.
    As far as I know your only hope to change a bunch of authortime/library items is using JSFL. So even if the thing I pointed to isn't exactly what you need you could keep googling a bit or use that as a template.
    JSFL files are just text files so open it in note pad. Look for the line:
    if(it[i].itemType == "movie clip")
    and change it to this:
    if(it[i].itemType == "movie clip" || it[i].itemType=="button")
    Now it does buttons. You give up too easy.

  • 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

  • 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

  • Use 2 different fonts in a dynamic text field with tf.htmlText?

    i've got a dynamic text field on the screen and all of my
    fonts embedded. is it possible to use 2 different fonts when
    dynamically setting the fields text with the htmlText property?
    i've tried the <font> and the <textformat> tags and
    neither work. I can set it once via a texformat object, but that's
    it.
    thanks

    you're answering all of my questions today aren't you? :)
    right, i think this will be hard since my data is all comming
    from XML and i have no way to specifically set text ranges as
    different fonts within a string.
    i've told the developers to just use images for the special
    characters.

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

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

  • Font embedding problem in PDFs

    Since upgrading to Leopard from Tiger-
    We are losing fonts embedded into pdfs, either saved through Preview or Adobe Indesign CS3.
    The preview of pdfs, both in the finder windows and in Entourage email attachments are missing fonts too. Sometimes opening them resolves the issue, but not usually.
    This has occured to both User and System level fonts.
    We have cleaned the font caches, but this only provides a temporary fix.
    We have tried not using our Suitcase Fusion and just letting FontBook manage the fonts on this machine, the problem still manifests itself.
    The only change in the equation from a perfectly operational machine was the change from Tiger to leopard.
    Any thoughts/help = greatly appreciated.
    Matt

    Update: Reader 8 on a PC displays everything fine, so it's a matter of updating

  • Need all fonts embedded in my PDF.

    I converted a word document to pdf through pdf pack. How can I get the following fonts embedded in my pdf: arial MT, arial MT bold, and arial MT italic? Thanks.

    Hi Cyn Tarr,
    You can embed fonts using Adobe Acrobat.
    PDF Pack cannot accomplish this.
    Regards,
    Rave

  • How to extract Chinese text from font embedded text PDF?

    This is actually font embedded text PDF (Used: type 1 fonts & custom encoding) and not scanned PDF, however I am unable to extract the "Chinese language" text properly and found only the garbled text when "Copy & Paste" (or save as RTF). Kindly refer the sample PDF attached for your reference.
    Kindly advise how could I solve this problem.
    Thanks in advance for your better solution.

    As I was unable to upload the sample page PDF in my original thread, I have shared now in the following path. Kindly look into this and guide me how to extract the chinese text as UNICODE text.
    Downloading: Chinese_Text_Extraction.pdf - Uploadingit

Maybe you are looking for