1 Reply Latest reply on Nov 5, 2009 3:40 PM by shintashi

    Embedding Japanese characters at runtime?

    shintashi Level 1

      So I've got a basic actionscript text generator:

       

       

      Additional details:

      (you'll probably need japanese font loaded to read this)

      what is supposed to look like "The sign reads 酒店" instead loads as "The sign reads □□"

       

      I don't understand why the english aspect of the fonts are loading but the Japanese symbols are failing - even if I set up an off stage textbox with the same kanji symbols embedded.

       

       

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

      this.createTextField("tLabel", this.getNextHighestDepth(), pointx, pointy, 280, 70);
      this.createTextField("aLabel", this.getNextHighestDepth(), pointx, pointy + 75, 220, 50);
      this.createTextField("bLabel", this.getNextHighestDepth(), pointx + 80, pointy + 75, 220, 50);
      tLabel.textColor = 0xFFFFFF;
      tLabel.embedFonts = true;
      aLabel.textColor = 0xFFFFFF;
      aLabel.embedFonts = true;
      bLabel.textColor = 0xFFFFFF;
      bLabel.embedFonts = true;

       

      tLabel.text = question;
      aLabel.text = answerA;
      bLabel.text = answerB;
      tLabel.multiline = true;
      aLabel.multiline = false;
      aLabel.wordWrap = false;
      aLabel.selectable = true;
      tLabel.wordWrap = true;
      tLabel.selectable = false;
      bLabel.multiline = false;
      bLabel.wordWrap = false;
      bLabel.selectable = true;

       


      var style_fmt:TextFormat = new TextFormat();
      style_fmt.font = "Monotype Corsiva";
      style_fmt.size = 18;
      style_fmt.align = "center";
      tLabel.setTextFormat(style_fmt);
      aLabel.setTextFormat(style_fmt);
      bLabel.setTextFormat(style_fmt);
      var glow2:GlowFilter = new GlowFilter(0xFFFFFF, 0.3, 5, 5, 2, 2);
      import flash.filters.DropShadowFilter;
      var shdw:DropShadowFilter = new DropShadowFilter(2, 45, 0x000000, 0.45, 0, 0, 2, 2);
      var filterList:Array = tLabel.filters;
      filterList[0] = shdw;
      filterList[1] = glow2;
      tLabel.filters = filterList;
      var filterList2:Array = aLabel.filters;
      filterList2[0] = shdw;
      filterList2[1] = glow2;
      aLabel.filters = filterList2;
      var filterList3:Array = bLabel.filters;
      filterList3[0] = shdw;
      filterList3[1] = glow2;
      bLabel.filters = filterList3;
      tLabel._alpha = 100;   
      aLabel._alpha = 100;
      bLabel._alpha = 100;

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

       

      I would also like to have Japanese characters ( kanji and hiragana ) appear. Is there a specific font I have to add besides

      style_fmt.font = "Monotype Corsiva" ?

       

      is it impossible?