/ Published in: ActionScript 3

This describes how to embed font in to Flex(mxml) file without using the tag (fully AS3).
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
[Embed(source='assets/CALIBRII.TTF', fontName='fontCalibri', fontStyle='italic', fontWeight='light', mimeType='application/x-font')] textFormat = new TextFormat(); textFormat.color = 0xFFFFFF; textFormat.font = "fontCalibri"; textFormat.size = 11; textField = new TextField(); textField.embedFonts = true; textField.text = "Embeded Text"; textField.selectable = false; textField.background = true; textField.multiline = false; textField.backgroundColor = 0x000000; textField.setTextFormat(this.textFormat);
Comments
