|
|
|
[
Permlink
| « Hide
]
Joan Lafferty - [10/09/07 01:27 PM ]
Drew, please provide the mxml and fla files that you used to produce this bug. Thanks.
I've attached a project archive which recreates the steps described above.
I've noticed that this same issue seems to happen w/ Beta 2 of Flex 3 as well.
The second embedded swf is overriding the font registered by the first swf. Since it was defined globally, the first one was not working.
Workaround is: defining Font Descriptor in the css file and then in the mxml using Font Descriptor in the stylename Css with font descriptor: @font-face { src: url("../assets/fonts.swf"); fontFamily: "Myriad Pro"; } .myfontdescriptor0{ fontFamily:Myriad Pro; fontSize:24 } mxml with styleName as font descriptor: <mx:Text text="Don't embed the 'TextMC' symbol to display this text. " styleName="myfontdescriptor0" color="0xFFFFFF"/> The following thread on ActionScript.org includes information about a similar issue with SWFs authored entirely in Flash CS3. Seems that this might be a player issue if they're related:
http://www.actionscript.org/forums/showthread.php3?t=149229 fonts.swf and graphics.swf both define a font "Myriad Pro". These are conflicting in the player. I noticed I wasn't able to use graphics.swf as a replacement for fonts.swf even when I only used the glyphs in the font. The font from graphics.swf is defined first in EmbeddedFontTest.swf and I suspect it is the winner of the conflict.
As a workaround I created a new mxml component for the embeded image: <?xml version="1.0" encoding="utf-8"?> <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="400" height="300"> <mx:Script> <![CDATA[ [Embed(source="../assets/graphics.swf", symbol="TextMC")] [Bindable] private var _textMC:Class; ]]> </mx:Script> <mx:Image id="textMC" source="{_textMC}"/> </mx:Canvas> and changed the application to look like this: <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" horizontalAlign="center" xmlns:local="*"> <mx:Style source="../src/mainStyle.css" /> <mx:Text text="Don't embed the 'TextMC' symbol to display this text. " fontSize="24" color="0xFFFFFF"/> <local:embeddedImage /> </mx:Application> The side effect of this change was to change the ordering of the fonts in the EmbeddedFontsTest.swf so the font from fonts.swf is defined first and becomes the font used by the application. Note that the work around that uses ".myfontdescriptor0{ fontFamily:Myriad Pro; fontSize:24 } " is not a true work around. If you rotate the text with the styleName "myfontdescriptor0", the text will disappear indicating that the font being used is actually a device font not an embedded font. The problem is "fontFamily:Myriad Pro" does not have quotes around the font name so Flex is turning the font name into "MyriadPro" (removing the space). The font name without the space was not matching any embedded font.
Darrell adds, if there were any problem with the workaround above, "I would have converted the component to its own application so it would be in its own swf. Then I would have loaded it into the application using swfloader. This would have worked no matter what because the conflicting fonts would be separated into different swfs. This is actually a more generic solution."
The workaround to make it a component doesn't work. The workaround to use a swfLoader works.
If someone from the community wants to contribute a small non-Flex test case we can transfer this issue to the Player team
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||