views:

987

answers:

1

Hi, I have the following project structure: - A Flex Project (SDK 3.3) - Multiple SWCs with grafics and textfields that are used as components in the Flex project.

Since I have a lot of SWCs that all use the same font in dynamic textfields, I do not want to embed the font in every SWC. Instead I want to have a library (RSL?) with the font from where all the SWCs load the font.

I tried to build a library file with the fonts using the "Export for runtime sharing" feature in Flash. While it works perfectly when I stay in Flash, Flex throws an "internal build error" when I try to use these SWCs in Flex.

Any ideas for a good strategy to load the fonts?

Thanks a lot, Kolt

+1  A: 

What I've done in the past was to use flash to create a swf file with the embedded fonts. see this if you're not sure what I mean for this) The link also provides other info you may find useful, its not the link I was trying to find but it covers the necessary.

Once you have your font SWF then you can just reuse this for each project. It's not a swc, but it’s as good as for the purpose of fonts. I've used CS3 to do this (I mention this as I tried the trial of CS4 and I think they may have changed the way you create embedded font swfs)

You can reference the font swf in your CSS file using something like

@font-face
{
  src: url("../theFolderWhereTheFileIs/YourFontFile.swf");
  fontFamily: "NameOfTheFontYouHaveEmbedded";
  font-weight : bold;
}

I create a separate swf file for each type of font and name it appropriately such as StoneSansSemiBold.swf or StoneSansItalic.swf

kenneth
thanks,but my problem is that I want to use the font-library in the other flash cs3 (or cs4) swc components, not in flex :(
kolt siewerts
Yeah, that's the standard way of embedding fonts. What I need to do is get a .swc component to use the font that I have already embedded in Flex.
Jim Carroll