Embedded font warning: Bold and italic require separate fonts : text format « TextField « Flash / Flex / ActionScript






Embedded font warning: Bold and italic require separate fonts

 

package{
  import flash.display.Sprite;
  import flash.text.*;  
  public class Main extends Sprite{
    public function Main(){
        var t:TextField = new TextField(  );
        t.text = "hello world";
        
        var fontFormat:TextFormat = new TextFormat(  );
        fontFormat.font = "Courier New";
        var boldFormat:TextFormat = new TextFormat(  );
        boldFormat.bold = true;
        
        t.setTextFormat(fontFormat, 0, 11);
        t.setTextFormat(boldFormat, 6, 11);
        addChild(t);
    }
  }
}

        








Related examples in the same category

1.Change Text format
2.Formatting User-Input Text
3.Formatting a Portion of Existing Text
4.Setting a Text Field's Font
5.Use the TextFormat object's color and underline properties
6.setTextFormat( ) does not apply to future text assignments
7.To set the alignment for the first paragraph in the text field only, we apply the format to the first character in the first paragraph, which resides at index 0:
8.To set the alignment for the second paragraph only, we apply the format to the first character in the second paragraph, which resides at index 23:
9.To set the alignment for a range of paragraphs, we apply the format using beginIndex and endIndex arguments that include the desired paragraphs:
10.Apply alignment formatting to the entire span of characters in the second paragraph.
11.Retrieving formatting information for a span of characters
12.If a specific format (e.g., font, bold, or italic) is not the same for all characters in a specified span, the corresponding variable of the TextFormat object for that span will be null
13.Default formatting for text fields
14.Set text format by searching the substring in textfield
15.The format for an empty TextField object is specified by assigning a TextFormat object to the TextField object's defaultTextFormat variable
16.Two formats