0 Replies Latest reply on May 9, 2010 7:14 AM by Anton0x00

    jsfl: can't set a symbol's font face 'MyFont*' for text field

    Anton0x00

      Flash JavaScript, font symbol's name does not work in Flash CS4 and CS5 Professional.
      I have task to set 20 textfields symbol's font name like "MyFont*" in each of 20 fla files.

       

      But I can't set the font symbol's name "MyFont*" of the selected text field. I have created font symbol 'MyFont' in library, but jsfl command

      element.textRuns[0].textAttrs.face = "MyFont*"

      had NO effects.
      But it woks when I do it manually! This feature works ok in CS3! And it does not work in CS4 and CS5. I’m wondering - is it bug?

      Here are the results of experiments with history panel:

      1) set for text field font face "MyFont*" - ok
      fl.getDocumentDOM().setElementTextAttr('face', 'MyFont*');
      2) set for text field font face "Arial" - ok
      fl.getDocumentDOM().setElementTextAttr('face', 'ArialMT'); //but in the text field face input i see 'Arial' (!)
      3) replay in history panel action 1) - NO EFFECT
      fl.getDocumentDOM().setElementTextAttr('face', 'MyFont*');

      How can i set MyFont* font face? Can anyone help me please?

       

      Experiments with Font Family dropdown control:
      1) By default - there is no 'System Default Font' in the Font Family dropdown control

      1.png

       

      2) set for my MyFont font symbol font face '---'

      2.png

       

      3) Font Family dropdown control contains 'System Default Font'

      3.png

       

      4) choose it. There is Family name '()' in input control.

       

      5) use element.textRuns[0].textAttrs.face = "MyFont*"

      4.png

       

      Worked!

       

      But it is a manual way. Font face 'System Default Font' does not work in scripts too.