# Shared Font Libraries & CSS

**URL:** <https://forum.kirupa.com/t/shared-font-libraries-css/182451>\
**Category:** flash\
**Created:** [March 18, 2006, 11:42am UTC](https://forum.kirupa.com/t/shared-font-libraries-css/182451 "2006-03-18T11:42:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Voetsjoeba](https://avatars.discourse-cdn.com/v4/letter/v/ac91a4/32.png) [@Voetsjoeba](https://forum.kirupa.com/u/Voetsjoeba)\
**Post date:** [March 18, 2006, 11:42am UTC](https://forum.kirupa.com/t/shared-font-libraries-css/182451/1 "2006-03-18T11:42:28Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![Voetsjoeba](https://avatars.discourse-cdn.com/v4/letter/v/ac91a4/32.png) [@Voetsjoeba](https://forum.kirupa.com/u/Voetsjoeba)\
**Post date:** [March 19, 2006, 9:10am UTC](https://forum.kirupa.com/t/shared-font-libraries-css/182451/2 "2006-03-19T09:10:42Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![scotty](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@scotty](https://forum.kirupa.com/u/scotty)\
**Post date:** [March 19, 2006, 9:17am UTC](https://forum.kirupa.com/t/shared-font-libraries-css/182451/3 "2006-03-19T09:17:04Z")

</div>

:lol: the example link was updated  
[http://gertdesign.info/client/example.swf](http://gertdesign.info/client/example.swf)

Here’s the updated zip as well;)

scotty(-:

---

<div class="post-metadata">

**Author:** ![rickface](https://avatars.discourse-cdn.com/v4/letter/r/7cd45c/32.png) [@rickface](https://forum.kirupa.com/u/rickface)\
**Post date:** [April 10, 2006, 7:24am UTC](https://forum.kirupa.com/t/shared-font-libraries-css/182451/4 "2006-04-10T07:24:31Z")

</div>

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:

```auto

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.

---

<div class="post-metadata">

**Author:** ![rickface](https://avatars.discourse-cdn.com/v4/letter/r/7cd45c/32.png) [@rickface](https://forum.kirupa.com/u/rickface)\
**Post date:** [April 12, 2006, 6:18am UTC](https://forum.kirupa.com/t/shared-font-libraries-css/182451/5 "2006-04-12T06:18:51Z")

</div>

still stuck on this one, anyone have any ideas? ☹

---

<div class="post-metadata">

**Author:** ![rickface](https://avatars.discourse-cdn.com/v4/letter/r/7cd45c/32.png) [@rickface](https://forum.kirupa.com/u/rickface)\
**Post date:** [April 12, 2006, 8:05am UTC](https://forum.kirupa.com/t/shared-font-libraries-css/182451/6 "2006-04-12T08:05:51Z")

</div>

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! 🙂

Thanks,  
ktz

---

<div class="post-metadata">

**Author:** ![scotty](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@scotty](https://forum.kirupa.com/u/scotty)\
**Post date:** [April 12, 2006, 9:19am UTC](https://forum.kirupa.com/t/shared-font-libraries-css/182451/7 "2006-04-12T09:19:46Z")

</div>

> [@rickface](#):
>
> …Anyone know why this is? Is the CSS sheet acting as the ‘embedFonts’ and telling the movie to  
> I need to know! 🙂
> 
> Thanks,  
> ktz

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

scotty(-:
