History | Log In     View a printable version of the current page.  
Issue Details (XML)

Key: SDK-11246
Type: Bug Bug
Status: Closed Closed
Resolution: Deferred
Priority: C C
Assignee: Brent Baker
Reporter: Drew Shefman
Votes: 11
Watchers: 8
Operations

If you were logged in you would be able to see more operations.
Flex SDK

embedded font with same embedded font in swf asset collision

Created: 06/11/07 10:02 AM   Updated: 05/14/09 05:13 PM
Component/s: Embedded Fonts
Security Level: Public (All JIRA Users )

File Attachments: 1. Zip Archive EmbeddedFontsTest.zip (48 kb)


Severity: Incorrectly Functioning with Workaround
Reproducibility: Every Time
Discoverability: Medium
Found in Version: SDK Flex2.0.1 English (Released)
Affected OS(s): Windows - XP
Steps to Reproduce:
Steps to reproduce:
1. Create flash swf with dynamic text fields with Embedded font (used Arial)
2. Embed fonts using CSS into Flex project
3. Create a new flash swf with a graphic asset that uses a static text field with the same font (Arial) (like an icon with a letter)
4. Embed the graphical asset into the flex project
 
 Actual Results:
 none of the flex text fields that use the embedded font show any text
 
 Expected Results:
 The flex text fields as well as the graphic assets would display the fonts correctly
 
 Workaround (if any):
Convert the component to its own application so it would be in its own swf. Then load it into the application using swfloader. This would work no matter what because the conflicting fonts would be separated into different swfs. This is actually a more generic solution.

or

break apart the text in the graphical assets to shapes
 
 
Language Found: English
Bugbase Id: none
Triaged: Yes
Regression: No
QA Owner: Brent Baker
Resolved by: Lauren Park
Participants: Alex Harui, Brent Baker, Darrell Loverin, Drew Shefman, Gaurav Jain, Joan Lafferty, Josh Buhler, Josh Tynjala, Lauren Park and Steve Breinberg


 All   Comments      Sort Order:
Joan Lafferty - [10/09/07 01:27 PM ]
Drew, please provide the mxml and fla files that you used to produce this bug. Thanks.

Lauren Park - [10/13/07 07:22 PM ]
Re-assigned to Gaurav.

Josh Buhler - [10/15/07 05:40 PM ]
I've attached a project archive which recreates the steps described above.

Josh Buhler - [10/15/07 05:41 PM ]
I've noticed that this same issue seems to happen w/ Beta 2 of Flex 3 as well.

Gaurav Jain - [10/16/07 12:35 PM ]
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"/>

Josh Tynjala - [10/16/07 06:02 PM ]
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

Lauren Park - [10/18/07 07:48 PM ]
Invstigate - Darrell.

Darrell Loverin - [10/23/07 10:11 PM ]
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.

Darrell Loverin - [10/23/07 10:18 PM ]
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.

Steve Breinberg - [10/24/07 03:14 PM ]
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."

Gaurav Jain - [10/25/07 09:22 PM ]
The workaround to make it a component doesn't work. The workaround to use a swfLoader works.

Lauren Park - [10/30/07 03:40 PM ]
Deferred.

Lauren Park - [11/06/07 01:54 AM ]
Closing.

Alex Harui - [05/14/09 05:13 PM ]
If someone from the community wants to contribute a small non-Flex test case we can transfer this issue to the Player team