A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Dynamic Text Box and Embedded Fonts

  1. #1
    Flash Developer
    Join Date
    May 2002
    Posts
    89

    Dynamic Text Box and Embedded Fonts

    Question:

    I am working on a project to make a scrollable text box that can have an embedded font. Another trick is to be able to dynamically fill the text box with HTML data using FlashVars. One of the hiccups I'm running into is that the BOLD tag does not work when the font is embedded. That seems to be the only tag that does not work.

    Has anyone run into this problem before? Is it my version of Flash MX? Has Flash MX 2004 enhanced embedded fonts and rendering of HTML in a dynamic text box?

    Thanks,
    Flashtech2K
    Flashtech2K

  2. #2
    Flashkit historian Frets's Avatar
    Join Date
    Oct 2000
    Location
    flashkit
    Posts
    8,797
    Interesting.

    Perhaps bold is listed as another font altogether.

    Have you tried placing a bold version font into the movie
    elsewhere and seen if the swf picks it up?

  3. #3
    Flash Developer
    Join Date
    May 2002
    Posts
    89

    The problem

    To restate the problem in a different way, the BOLD tag DOES work when I use DEVICE fonts but when I select an embedded font, the BOLD tag does not work at all. In fact, all text within the BOLD tags does not appear on the screen.

    Concerning your reply, I'm not quite sure what you mean. Are you trying to say that I need to embed the BOLD version of the font that I am currently embedding?
    Flashtech2K

  4. #4
    Flash Developer
    Join Date
    May 2002
    Posts
    89

    The answer/solution

    The answer: I found the answer to my problem in a Colin Moock book, Actionscript Language Reference. It says, "Every variation of a font must be embedded individually. If we use Courier New in bold, italic and bold italic in a text field, then we must embed all three font variations." I simply was not embedding the bold variation so it did not render at all in the text box.

    The solution: In the dynamic text box, I place three letters in bold, italic and bold italic (using the font that I want to embed, of course). This way Flash knows to export all the font variations. Then when I load the SWF file at runtime, those letters are automatically replaced when I load the FlashVars that feeds the dynamic text box. Needless to say, Flash can render the bold text because the bold variation was embedded in the SWF file.

    The reason why I am embedding fonts is because I am creating web pages that will have graphics with specific font treatments. If I can have text that will match, the page will look much better. It is all about looks in this case. A good reason to use Flash and not Javascript to make a scrolling text box.
    Flashtech2K

  5. #5
    Flashkit historian Frets's Avatar
    Join Date
    Oct 2000
    Location
    flashkit
    Posts
    8,797
    That was my suggestion.
    Have you tried placing a bold version font into the movie
    elsewhere and seen if the swf picks it up?

  6. #6
    Flash Developer
    Join Date
    May 2002
    Posts
    89

    You're right

    you did point me in the right direction. I just did not understand your answer at the time but after reading my Moock book, I started to understand more.

    Thanks,
    Flashtech2K

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