1/20/2012 12:09:05 AM
Title:
Embedding font for bold text from swf into flex
I am able to embed font from swf into flex, but font is not embedding for bold text.Can you please tell me how to embed font for bold text also.
From swf,i am getting following attribiutes
font-name-Didact
font-style-regular
font-type-embedded
In CSS,
.title
{
color:#000000;
font-family:Didact;
font-weight:bold;
font-size:16;
}
Now,i need to embed Didact font to text styled .title based on css & without changing swf font as bold
1/20/2012 3:19:35 AM
bold fonts also needs to be embed. Bold fonts are a different set.
//to embed using css file
@font-face {
src: local("Verdana");
fontFamily: ArialEmbedded;
fontWeight: bold;
}
// to embed bold fonts in actionscript
[Embed(source='../assets/Verdanafont.ttf',
fontName='myVerdanaFont',
fontWeight="bold",
mimeType='application/x-font'
)]
1/20/2012 3:22:10 AM
check this link, to embed bod fonts in flash
http://heidibrebels.be/blog/archives/2006/flash-embed-font-bold
1/20/2012 3:40:15 AM
Thanks for ur replies.But i didnt find any solution.My code like this
var request:URLRequest = new URLRequest(languagecode);
var ldrContext:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain,__secDom);
ldrContext.applicationDomain = ApplicationDomain.currentDomain;
var ldr:Loader = new Loader();
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, onloadcomplete);
ldr.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,handleioerror);
ldr.load(request, ldrContext);
private function onloadcomplete(event:Event):void{
var appcls:Class = (event.target as LoaderInfo).applicationDomain.getDefinition(txt1.text) as Class;
Font.registerFont(appcls);
var obj:Object = new appcls();
textArea.setStyle("fontFamily", obj.fontName);
}
Here textarea text had some bold text.I need to embed font with boldness in flex without
modifying flash code.
Can we embed regular font of flash to bold text in flex.Can u please tell the solution
1/21/2012 12:05:26 AM
you cannot make an embedded font bold unless you have embedded it. You must embed the bold fonts along with the regular one else either the text won,t show up or the fonts wont appear bold. You can use either of the methods mentioned by Redbull , using css file or using actionscript