0 Replies Latest reply on Feb 29, 2008 2:35 PM by lotfe

    Chinese & Japanese embed font

    lotfe
      Hi,

      I've a big problem of showing asian fonts. Somes of them appeared like squares. I've used an embedded font and It doesn't work.

      Someone could help me ?

      Here is the code.

      public static function createAreaText (
      param_clip:MovieClip,
      param_text:String,
      param_font:String,
      param_size:Number,
      param_color:Number,
      param_depth:Number,
      param_x:Number,
      param_y:Number,
      param_width:Number,
      param_height:Number,
      param_name:String,
      param_align:String,
      param_letterSpacing:Number,
      param_leading:Number):TextField {
      if (param_depth == undefined) param_depth = param_clip.getNextHighestDepth();
      if (param_x == undefined) param_x = 0;
      if (param_y == undefined) param_y = 0;
      if (param_width == undefined) param_width = 250;
      if (param_color == undefined) param_color = 0x000000;
      if (param_font == undefined) param_font = "mainFont";
      if (param_name == undefined) param_name = "textObject";
      if (param_align == undefined) param_align = "left";

      if (_root.lang == "ch") {
      param_font = "MS Mincho";
      }

      var my_textField = param_clip.createTextField(param_name, param_depth, param_x, param_y, param_width, 100);
      my_textField.html = true;
      my_textField.embedFonts = true;
      my_textField.multiline = true;
      my_textField.wordWrap = true;
      my_textField.selectable = false;

      my_textField.htmlText = param_text;
      my_textField.htmlText = my_textField.text;

      var my_textFormat = new TextFormat(param_font, param_size, param_color);
      my_textFormat.align = param_align;
      my_textFormat.letterSpacing = param_letterSpacing;
      my_textFormat.leading = param_leading;
      my_textField.setTextFormat(my_textFormat);

      if (param_height != undefined) my_textField._height = param_height;
      else my_textField._height = my_textField.textHeight + 5;

      return my_textField;
      }

      Thanks,
      Lotfe