1 Reply Latest reply on Feb 17, 2008 9:13 PM by ggshow

    superscript font for dynamic html text field

    stephan.k Level 1
      Hello Forum

      I am loading in a bunch of text and format them in flash into a newspaper-like layout.

      The problem I am running into and can't seem to solve are superscript characters. I've used the GG superscript fonts from this website: http://blog.ggshow.com/index.php/reference?cat=121

      Tthe example works fine. But once I try to implement it into my application it fails to work or simply doesn't show up.

      Here's my code:


      --------------------------------------------
      External XML file:
      --------------------------------------------
      [...]
      <item type="text"><![CDATA[.This is a sample text <i>Italic Font here shows up right</i><font face="GG Superscript">superscript here doesn't work</font>, ]]>
      </item>
      </p>
      [...]



      --------------------------------------------
      Reading the Texfield:
      --------------------------------------------
      [...]
      public static function getNodeContent(_xml:XML):String{
      return String(_xml.firstChild.nodeValue);
      }
      [...]

      --------------------------------------------------
      creating the textfield:
      --------------------------------------------------
      txtHolder = itemMC.createEmptyMovieClip("txt",1);
      Textfield.create(txtHolder,XmlArticleData.getNodeContent(itemNode),"articleText")



      --------------------------------------------------
      The Textfield class:
      -------------------------------------------------
      public static function create(_movieClip:MovieClip,_str:String,_type:String){
      switch (_type) {
      case "articleText":

      _movieClip.createTextField("txtMC", 1, 0,0, 1, 1);
      _movieClip.txtMC.autoSize = "left";
      _movieClip.txtMC.type = "dynamic";
      _movieClip.txtMC.border = false;
      _movieClip.txtMC.multiline = true;
      _movieClip.txtMC.html = true;
      _movieClip.txtMC.embedFonts = true;
      _movieClip.txtMC.selectable = false;
      _movieClip.txtMC.wordWrap = true;
      _movieClip.txtMC.antiAliasType = "advanced";
      _movieClip.txtMC.thickness = 1.2;
      _movieClip.txtMC.sharpness = 0;


      var fmt:TextFormat = new TextFormat();
      fmt.font = "ArticleTextFont";
      fmt.indent = 10;
      fmt.bold = false;
      fmt.italic = false;
      fmt.size = 11.5;
      fmt.leading = 10;
      fmt.color = 0x000000;
      fmt.align = "justify";
      }
      _movieClip.txtMC.htmlText = _str;
      _movieClip.txtMC.setTextFormat(fmt);



      -----------------------------------------------------------

      Any ideas?

      Thanks!

      Cheers

      StephanK