A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Dynamic Font Embed at Compile Time

  1. #1
    rabid_Delineator AttackRabbit's Avatar
    Join Date
    Dec 2003
    Location
    Orlando, Florida
    Posts
    481

    Dynamic Font Embed at Compile Time

    Hey everyone. I have been using the embed feature of flex to embed fonts at compile time. This works great I have used both these syntax :

    Code:
    [Embed(systemFont='Arial'
    [Embed(source='somefolder/somefont.tty'
    I realize this isnt the entire line. Im just putting in the pertinent parts.
    Either one works fine. My question is , what if I dont know what font i need where this line exists. For example let say i want to instantiate a new object of type SomeField. And as an arguement i want to pass in a string , an associative id of the system font, like "Arial" or "Tahoma". Then inside the SomeField class where the :

    Code:
    [Embed(systemFont='Arial'
    line exists , i want to assign the variable as the system font used.

    so something like

    Code:
    [Embed(systemFont=$SomeVar
    where $Some var is a string assigned by the caller of the child. The idea is to have the developer be able to import a class , create a new instance of that class , and pass in a string , being the name of the font theyd like to dynamically embed. All this could be done without ever having to go into the acutal class defintion for the object and manually chaning the 'systemFont' or 'source' linakge.

  2. #2
    rabid_Delineator AttackRabbit's Avatar
    Join Date
    Dec 2003
    Location
    Orlando, Florida
    Posts
    481
    Not that anyone every participates in this forum, but I posted this problem in the adobe forums, and received an answer that , this cannot be done. So unfortunately , if you make the param value a variable , it is seen by the compiler a preprocess directive, so i would have to use ant , or something to write to a dynamic file. bleh.

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