Correct me if I am wrong, but don't font embed references have to
match the names exactly?
case sensitive as well? What is on the stage, the font name and
library item name?
Karl
On Sep 22, 2010, at 8:05 PM, Kerry Thompson wrote:
I've been banging my head up against this for 4 hours, and the client
has to ship tonight.
FlashBuilder 4, Windows 7.
I am just trying to make a little demo of how to embed a font, but
when I pull together code that has worked before into one simple
class, it doesn't show the text. It draws the outline of the text
field, but there is no text. When I comment out one line,
textField.embedFonts = true, it works, but not with the embedded font.
I've tried different fonts, and can't get any of them to work. Can
somebody spot what I'm doing wrong?
Cordially,
Kerry Thompson
public class FontEmbedding extends Sprite
{
public function FontEmbedding()
{
showText();
}
/**
* Embeds the Garamond 3 font
*/
[Embed(
source='../fonts/GaramThrSC.ttf',
fontName='Garamond3'
)]
private static var Garamond3Embedded: Class;
private function showText():void
{
var textFormat:TextFormat;
var textField:TextField;
registerFonts();
textFormat = new TextFormat();
textFormat.color = 0x000000;
textFormat.font = "Garamond3Embedded";
textFormat.align = "left";
textField = new TextField();
textField.defaultTextFormat = textFormat;
textField.border = (true);
textField.embedFonts = true;
textField.text = "Hello Autovod!";
textField.width = 100;
textField.height = 30;
addChild(textField);
textField.x = 100;
textField.y = 60;
}
public static function registerFonts(): void
{
Font.registerFont(Garamond3Embedded);
}
}
}
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Karl DeSaulniers
Design Drumm
http://designdrumm.com
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders