A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: is it possible to specify more than one font per textbox?

  1. #1
    I'm not a vegetarian
    Join Date
    Sep 2001
    Posts
    498
    hi people

    basically im using text boxes with a certain font, lets say verdana, but im not embedding it because i dont want it to be anti aliased. therefore if someone has verdana on their machine it shows up (non anti aliased) - but i would like to be able to specify a second font or even just say "verdana or any sans serif", is this possible?

    thanks

  2. #2
    ism BlinkOk's Avatar
    Join Date
    Aug 2001
    Location
    , location, location
    Posts
    5,002
    I don't know if this is what your after but there is a font called _serif that uses the first available serif font on the target machine.
    Hope this helps!
    BlinkOk

  3. #3
    I'm not a vegetarian
    Join Date
    Sep 2001
    Posts
    498
    hi blink

    i actually want to specify my desired font first and then if the user didnt have that i would be willing to use something like the _sans font in flash. thats why i was asking if its possible to specify more than one font.

  4. #4
    ism BlinkOk's Avatar
    Join Date
    Aug 2001
    Location
    , location, location
    Posts
    5,002
    I just made a test .fla (Flash 5) using the hooge font and transfered it to another machine without the font and it automatically substituted a serif font! I dodn't have to do anything
    BlinkOk

  5. #5
    I'm not a vegetarian
    Join Date
    Sep 2001
    Posts
    498
    well it will always substitute it with something, i'd like to be sure that the user would see verdana, and if not then arial, and if not then any sans

  6. #6
    ism BlinkOk's Avatar
    Join Date
    Aug 2001
    Location
    , location, location
    Posts
    5,002
    Ok i tried this and i think it's working;
    I made the text Dynamic and I checked the html box. I called the textbox "text";
    The in frame one actions I added;
    Code:
    text = "<font face=\"Verdana, Arial, Helvetica, sans-serif\">TEXT</font>";
    I'm pretty sure it came up verdana but i'm a bit font blind, can't tell the difference between verdana and arial!
    Hope this helps!
    BlinkOk

  7. #7
    I'm not a vegetarian
    Join Date
    Sep 2001
    Posts
    498
    hi blink

    yes this works, but i dont want to always use a dynamic text box and specify fonts through html because i am loading a lot of the text from a database and its a bit of a pain to ensure everything gets put between a font tag, but thanks for all your help and suggestions so far.

  8. #8
    ism BlinkOk's Avatar
    Join Date
    Aug 2001
    Location
    , location, location
    Posts
    5,002
    Probably not a solution;
    But I think you can add the tags with code;
    Code:
    tag1 = "<font face=\"Verdana, Arial, Helvetica, sans-serif\">";
    tag2 = "</font>";
    text = tag1+loadedtext+tag2;
    There is also a script that can examine every variable on the main timeline so you could probably do it globally with the following script;
    This code will add the tags to ALL variables in _root (Main stage);
    Code:
    for (name in _root) { 
      if (typeof (name) == "string" && substring(name,1,3) != "tag" && substring(name,1,1) != "$" ) {
        _root[name] = tag1 + _root[name] + tag2;
      } 
    }


  9. #9
    I'm not a vegetarian
    Join Date
    Sep 2001
    Posts
    498
    thanks blink, i'll try using your code.

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