How to embed fonts from a library SWC in Flex 3 5
The problem:
You have two or more Flex projects that you want to share fonts between.
Solution:
Add the fonts to a shared library project then reference them in your css… right?
- create a new library project
create an assets folder?This won’t work!- you have to add your fonts directly under the src folder
Add the fonts to the swc’s build path:
go to Project Properties > Flex Library Build Path > Assets and check the checkbox next to the font files.
in your project you want to use the font in link to the library project:
go to project properties > Flex Build Path > Library Path > Add Project
The rub:
For some reason Flex Builder can’t seem to find the fonts in the library project if they are in any directory BUT src?!
Usage:
You will then be able to reference your fonts in the linked projects css like so:
@font-face {
src:url("MyriadPro.ttf");
fontFamily: MyriadPro;
}
Hopefully this saves someone some time.

Now that’s practical knowledge straight from the trenches. thanks!
Thanks for this post. I’m also using a .swf file as the application’s backgroundImage, set the css.
It seems the .swf also to be directly under the src folder.
Thanks dude, really useful spot on that src directory thing for fonts.
This is the greatest topic I have read today
I think this is one of the most important information for me. And i’m glad reading your article. But wanna remark on few general things, The website style is great, the articles is really excellent. Good job, cheers