header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
K.V.S.Neelima
Points:0
Posts:0

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
RedBull
Points: 930
Posts:0
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'  
    )] 


2
Troy
Points: 820
Posts:0
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

3
Neelima
Points: 0
Posts:0
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

4
Troy
Points: 820
Posts:0
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


Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 4+3 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions