Marcos is Currently...
- Working on J-E translation for http://jactionscripters.com, sorry @seagirl for taking so long! | Yesterday
- @cannuk Thanks! Please let me know if you find any issues. Havent done much testing, and I wouldnt be surprised if it breaks in old browsers | 2 weeks ago
- @keynesiandream woOt! Congrats!! When's the foundation day feast? I shall bring the goat. | 2 weeks ago
- Off on a surprise limo trip to Napa with Yumi for her birthday. Fun! http://bit.ly/WWleT | 2 weeks ago
- At obscura's party in SOMA. Pretty sweet stuff. | 2 weeks ago
shared items in Google Reader
- Workshop: Visualization on the Web – Join Me at VisWeek | 3 days ago
- NYTimes Michael Jackson's Billboard Rankings Over Time | 6 days ago
- TextExpander and XCode (and Pragmatic Screencasts) | 2 weeks ago
- In search of innovation | 2 weeks ago
- The node power outlet is a refreshingly simple alternative to the power strip | 2 weeks ago
recent photos on flickr
recent trips
- Returned from a trip to New York. | February 2009
- Started a trip to New York. | February 2009
- Returned from a trip to Rosario. | January 2009
- Started a trip to Rosario. | December 2008
- Returned from a trip to Seoul. | October 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);
}
}
}



















