Shared Font Libraries & CSS

Hi everyone,

I’ve got a question regarding Shared Font Libraries and the use of CSS. I’m building an application that requires one textfield to display multiple font faces (bold, coloured, etc). For that, I have a CSS file that specifies some classes that can be used in the textfield which is HTML enabled and has the CSS file applied.

The textfield would also need to be able to be scrolled, and some of the fonts used are non-regular fonts as well, so embedding fonts was a must. But because the font faces were mixed, I figured I needed the fonts to be put into the library and export them for AS. Now the problem with that is, that it screws up preloaders.

So what I tried is to use Shared Font Libraries. I created a fla with my fonts in the Library (Futura Md BT, Futura Lt BT, Verdana and VerdanaBold), and set them to export for runtime sharing and actionscript as fontLibrary.swf. Compiled movie. Then copied them over to my working fla, and changed them to be imported from fontLibrary.swf.

But the problem is now that my CSS styles don’t seem to have any effect anymore. Or at least: the font-family directive no longer does, because colours are displayed fine. Text no longer appears bolded as it should, and the text uses the font the textfield was set to in the authoring environment, not the one from the CSS style it has.

So my question is: how do I combine several font faces in one textfield, use CSS classes to define and apply them using fonts that were imported from a shared library, and embed them while I’m at it ?

I’ve downloaded the example again but nothing seems to have changed …

:lol: the example link was updated
http://gertdesign.info/client/example.swf

Here’s the updated zip as well;)

scotty(-:

hey Scotty,

I have a question regarding this one as well! I have been struggling with the same issue for a while, except mine has a extremely bizarre twist.

I have a textfield (shown in the attachment) in which I’m using different fonts and css to style them. The fonts are embedded on my root document so, correct me if I am wrong, they should available to any swf that is loaded into the root.

The textfield pictured is loaded in and strangely enough, one styles works and some styles doesnt, but this text field only uses one font :? If you notice in the picture the green font and the white font are both Helvetica 35 Thin.

Any ideas as to why this may be?
My CSS looks like this for each of the styles used:


p {
  font-family: Helvetica 35 Thin;
  color: #FFFFFF;	
  font-size: 7px;
  display: inline;
  letter-spacing: 1px;
}
.alt {
  font-family: Helvetica 35 Thin;
  color: #99FF99;
  font-size: 9px;
  display: inline;
}

and my text (loaded in from XML) looks like this:

<![CDATA[<p><span class=‘alt’>FINALLY!! THE NEW SITE IS LAUNCHED!</span> Well, I must say…

Any suggestions would be greatly appreciated!
Thanks in advance.

still stuck on this one, anyone have any ideas? :frowning:

Well, funny enough, just a few minutes after my last post I figured it out.

Apparently I needed to embed a font in the to the text field that the style is being applied to, but you dont have to tell it to use the embedded fonts. :?

So to recap, I ousted myText.embedFonts=true; and embedded the font on the textfield, and everything is cool.

Anyone know why this is? Is the CSS sheet acting as the ‘embedFonts’ and telling the movie to
I need to know! :slight_smile:

Thanks,
ktz

Sorry I don’t know, maybe the .embedFonts only work with dynamic created textfields?

scotty(-: