I have just posted the last 2 parts of a 3 part series (unless I come up
with more parts) on:

 

Changing embedded True Type fonts at Runtime in Flex Applications

 

1. Using loader:
http://blog.739saintlouis.com/2007/02/12/changing-embedded-true-type-fon
ts-at-runtime-in-flex-applications/

 

2. Using modules:
http://blog.739saintlouis.com/2007/02/23/using-modules-to-change-embedde
d-true-type-fonts-at-runtime-in-flex-applications/

 

3. Using Runtime CSS:
http://blog.739saintlouis.com/2007/02/23/using-runtime-css-to-change-emb
edded-true-type-fonts-at-runtime-in-flex-applications/

 

(Incidentally, Joan's post works for me and prompted me to finish off my
code and post it as a part of my "Runtime embedded fonts" series.

 

-Kyle

 

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Joan Lafferty
Sent: Friday, February 23, 2007 3:33 PM
To: [email protected]
Subject: RE: [flexcoders] Runtime CSS and embeded fonts not working

 

Hilary, 

 

This should work. I have created a very simple test and it works fine.
Here it is:

 

SimpleApp.mxml

<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; xmlns="*"

    creationComplete="initFont()">

 

    <mx:Script>

    <![CDATA[

        import mx.styles.StyleManager;

 

        private function initFont():void

        {

            StyleManager.loadStyleDeclarations("comicsans.swf");

        }

    ]]>

    </mx:Script>

 

<mx:Label fontWeight="bold" text="Runtime CSS: Using Embedded fonts"
fontSize="15" />

 

<mx:Panel title="Music Survey" >

            <mx:CheckBox label="I buy music from iTunes." />

            <mx:CheckBox label="I buy CDs at an online store." />

            <mx:CheckBox label="I buy CDs at a music store." />

            <mx:CheckBox label="I download music illegally." />

            <mx:Label text="other" />

            <mx:TextInput />

</mx:Panel>

 

</mx:Application>

 

comicsans.css

@font-face {

            src: url("assets/comic.ttf");

            fontWeight: "normal";

            fontFamily: "ComicSans";

}

 

@font-face {

    src: url("assets/comicbd.ttf");

    fontWeight: "bold";

    fontFamily: "ComicSans";

}

 

global {

   fontFamily: "ComicSans";

}

 

What is the difference with your application and this simple one? Did
you get any errors? How are you using they styles? Are they set
globally, using Type selectors or class selectors?  If you can show me a
simple sample where it is not working, maybe I can help more.

 

Thanks,

Joan 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Hilary Bridel
Sent: Thursday, February 22, 2007 7:44 PM
To: [email protected]
Subject: Re: [flexcoders] Runtime CSS and embeded fonts not working

 

Hi Bjorn,

No.

 

All I am doing is swapping a compile time css to a runtime css.

Hilary

 

--

On 2/23/07, Bjorn Schultheiss <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> > wrote: 

Hi Hilary, 


 

Does your app make use of Modules?


 


 

regards,


 

Bjorn


 

 

On 23/02/2007, at 1:28 PM, Hilary Bridel wrote:







 

Hi All,

I have a css file with embeded fonts that when loaded at compile time
works ok, but when compiled into a .swf runtime css file (with no
errors), does not render the embeded fonts. 

 

Is there a trick to runtime css and embeded fonts, or possibly a bug?

-- 
Hilary

--


 


 




-- 
Hilary

-- 

 

Reply via email to