Spoke too soon - converting the font to .ttf and then embedding it did
the trick:
[Embed(source="styles/assets/InterRegCom.ttf",
fontName="EmbeddedFont",
mimeType="application/x-font")]
private var EmbeddedFont:Class;
On Oct 7, 2009, at 7:06 PM, grimmwerks wrote:
Found this about embedding font families and how using the Embed tag
might not be seen by CSS:
http://www.kirupa.com/forum/archive/index.php/t-257913.html
On Oct 7, 2009, at 9:04 AM, artur_desig2dev wrote:
we are having the same issue but with applying styles to Interstate
Light:
but we're trying to get this to work in AS3 ..and not FLEX..
first we tried doing it this way..
[Embed(source="../fonts/Interstate-Light.ttf", fontName="Interstate-
Light", mimeType="application/x-font-truetype")]
public static const InterstateTTF:String;
[Embed(source="../fonts/Interstate-Bold.ttf", fontWeight="bold",
fontName="Interstate-Bold", mimeType="application/x-font-truetype")]
public static const InterstateBoldTTF:String;
[Embed(source="../fonts/Interstate-Italic.ttf", fontStyle="italic",
fontName="Interstate-Italic", mimeType="application/x-font-
truetype")]
public static const InterstateItalicTTF:String;
var defaultStyle:Object = new Object();
defaultStyle.fontFamily = "Interstate";
var style:StyleSheet = new StyleSheet();
style.setStyle(".defaultStyle", defaultStyle);
var t:TextField = new TextField();
t.embedFonts = true;
t.styleSheet = style;
t.htmlText = "<span class='defaultStyle'>My <b>bold</b> text</span>";
then we also tried it using CSS and embedding the font in a swf:
package
{
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.text.*;
[SWF(width='955', height='600', backgroundColor='#FFFFFF',
framerate='24')]
public class Index extends Sprite
{
[Embed(
source="font.swf",
symbol="InterstateLight"
)]
&nb sp; private var Interstate:Class;
public function Index()
{
Font.registerFont(Interstate-Light);
var style:StyleSheet = new StyleSheet();
var normal:Object = new Object();
normal.color = "#FF4900";
normal.fontFamily = "Interstate-Light";
&nbs p; normal.fontLeading = 2;
normal.fontSize = 11;
var bold:Object = new Object();
bold.color = "#FF4900";
bold.fontFamily = "Interstate-Bold";
bold.fontLeading = 2;
bold.fontSize = 11;
bold.fontWeight = "bold";
var italic:Object = new Object();
italic.color = "#FF4900";
italic.fontFamily = "Interstate-Italic";
italic.fontLeading = 2;
italic.fontSize = 11;
italic.fontStyle = "italic";
style.setStyle(".normal", normal);
style.setStyle(".italic", italic);
style.setStyle(".bold", bold);
var label:TextField = new TextField();
; label.antiAliasType = AntiAliasType.ADVANCED;
label.autoSize = TextFieldAutoSize.LEFT;
//label.embedFonts = true;
label.multiline = true;
label.styleSheet = style;
label.htmlText = "<span class='italic'>HOLA HOLA HOLA
HOLA HOLA<br>HOLASSSS DDDD DDD<br><font
color='#000000'>HOLAAAAAAAAAAAAAAAAAAAAAAA</font></span>";
addChild(label);
var tf:TextForm at = new TextFormat("Interstate-Light",
11)
var label1:TextField = new TextField();
label1.defaultTextFormat = tf;
label1.antiAliasType = AntiAliasType.ADVANCED;
label1.autoSize = TextFieldAutoSize.LEFT;
label1.embedFonts = true;
label1.multiline = true;
label1.htmlText = "HOLA HOLA HOLA HOLA HOLA";
label1.y = 100;
addChild(label1);
}
}
}
any ideas?!
time sensitive project.. thanks