Looks like you'll have to re-build slide1.swf without -static-link-runtime-shared-libraries. MX+Spark project links in RSLs that might not be compatible with the RSLs that have been compiled into your embedded font SWF.
I'm curious, have you thought about using a CSS Module? (Right click a CSS file and choose "Compile to SWF).
After rebuilding the slide without parameters following warning is shown in the command prompt
Warning: This compilation unit did not have a factoryClass specified in Frame metadata to load the configured runtime shared libraries. To compile without runtime shared libraries either set the -static-link-runtime-shared-libraries option to true or remove the -runtime-shared-libraries option.
We can't use the CSS Module as the slide will not only contain the embedded fonts but also the visuals contained in the slide1.xml which are rendered at runtime when the slide1.swf is played in the container, which is the pure actionscript project.
Then use a normal module?
We have the following flow for the project using Flex SDK 4.1:--
1). First case which have no problem:--
UI is in Flash CS4 with document class written in FB4 Action script project. ---- A.swf
API controller written in FB4 Action script project. ---- B.swf
Slide renderer written in FB4 Action script project which loads & plays the slide1.swf. --- C.swf
A.swf communicates with B.swf through Local Connection. B.swf & C.swf have parent-child communication.
2). Second case where the problem is :--
We want UI as an mxml component to be used in existing Flex Project.
This component will work as A.swf and have the same communication flow.
The comminication is fine between all the swf's. Just can't show the embedded fonts using textLayout.
Fonts have to be embedded with embedAsCFF="true" for TLF. I'm not sure how that translates to Flash CS4.
Player UI design is in Flash. This has nothing to do with the embedded fonts.
We use this for fonts ---- textFormat.fontLookup = FontLookup.EmbedCFF;
For showing the fonts we use the line of code :--
textFlow.flowComposer.swfContext = new fontClass();
which throws an error
Error TypeError: Error #1034: Type Coercion failed: cannot convert Slide1@f56fce9 to mx.core.IFlexModuleFactory. !
Right. So the problem is that Slide1's root class is not what Flex expects it to be.
Can you try creating a separate project (MX+Spark) for Slide1 with Flash Builder rather than MXMLC? This is to avoid mismatch between any of the compiler settings that FB sets compared to MXMLC.
If that also yields no results, then you're better off posing this question on the Flex general discussion forum. They'll have a better idea about it.
Okay, If i comment the following line,
textFlow.flowComposer.swfContext = new fontClass(); // Where the exception occurs
there is no error and the slide is displayed with default fonts.