Marcos is Currently...
- @s9i これは見てないでしょ: http://snurl.com/62ibe | 17 hours ago
- About to present at fitc unconference at max | Yesterday
- @ Max, keynote is rocking. Our demo is about to go live. | 3 days ago
- Setting up our demos backstage of MAX. Whole setup and logistics for this event are quite impressive. | 5 days ago
- lovin' ajax. hacked up a dojo livesearch widget in no time. will post source soon. | 4 weeks ago
shared items in Google Reader
- John Oliver and John King’s Magic Wall | Yesterday
- Google Hosts 10 Million Historic Time-Life Photos [Google] | 2 days ago
- Emergence Project: Representing a Textual Discourse | 2 days ago
- fLux Binary Waves: Urban Visualization Installation | 2 days ago
- Let the computer figure out your cutlist | 3 days ago
recent photos on flickr
recent trips
- Returned from a trip to Seoul. | last month
- Started a trip to Seoul. | last month
- Finished a trip to Toronto. | April 2008
- Started a trip to Toronto. | April 2008
- Finished a trip to Montevideo. | March 2008
news / Embedding fonts in AS3
October 29, 2005
Embedding fonts in AS3
I love this! ... library, be-gone!
package {
import flash.util.describeType;
import flash.display.MovieClip;
import flash.display.TextField;
import flash.text.TextFormat;
import flash.text.AntiAliasType;
public class Test extends MovieClip {
// be sure this is pointing to a ttf font in your hardrive
[Embed(source="C:\WINDOWS\Fonts\somefont.ttf", fontFamily="foo")]
public var bar:String;
public function Test() {
var format:TextFormat = new TextFormat();
format.font = "foo";
format.color = 0xFFFFFF;
format.size = 130;
var label:TextField = new TextField();
label.embedFonts = true;
label.autoSize = TextFieldAutoSize.LEFT;
label.antiAliasType = AntiAliasType.ADVANCED;
label.defaultTextFormat = format;
label.text = "Hello World!";
addChild(label);
}
}
}



















