Device Fonts are Always Black in Flash

Post your questions here and we'll all try to help.
Post Reply
DonMoir
Posts: 12
Joined: Mon Dec 14, 2009 21:06

Device Fonts are Always Black in Flash

Post by DonMoir »

When using Flash in Resolume, the Text is always black when using a device font.

Why is that ?

Does not occur with embedded font or outside of Resolume.

Note that in Flash 10, device fonts can be rotated etc, just like an embedded font.

Don

DonMoir
Posts: 12
Joined: Mon Dec 14, 2009 21:06

Re: Device Fonts are Always Black in Flash

Post by DonMoir »

Here is a sample swf file that shows the problem.

This first line of text is using a device font. (Arial)

The second line of text is using Arial as an embedded font.

They are both supposed to be white. Note that in resolume that the first line of text is black. If you run the swf outside of resolume they will both be white.

This is an issue for us because we have an outside C++ app sending font information to the flash app. The DJ can choose whatever (device) font he likes. As it is this will not work for resolume flash content.

Here's the sample:

http://sms.pangolin.com/resolume/TestFonts.zip

Will someone please let me know the status of this. Will it be fixed ? I will need to make other plans if this will not be fixed.

Don

edwin
Team Resolume
Posts: 1207
Joined: Thu Oct 07, 2004 10:40

Re: Device Fonts are Always Black in Flash

Post by edwin »

I think i saw this problem myself as well, i can't remember what i did to fix this (embed or not). Does it work when you make the textfield a Graphic. Maybe it happens because the text is selectable or because we draw the Flash file with alpha channel (try putting a graphic as background instead of a color). We'll put it on our todo-list if it remains an issue, but it doesn't sound like a problem we could fix from our end, and if we could it won't have top priority. So i guess you'll we need to find a workaround.
The files you send do work fine in OSX, so i guess this is a Windows only issue.

DonMoir
Posts: 12
Joined: Mon Dec 14, 2009 21:06

Re: Device Fonts are Always Black in Flash

Post by DonMoir »

Hello edwin,

Why this occurs is a mystery. As you said, since it works in osx, this is related to windows, but the problem only occurs in resolume and nowhere else, so I am assuming you can do something about it.

I am well versed in windows, C++, and flash so if you can give me some hints on how you are handling flash for display purposes, maybe I can help pin this down. I already have a C++ app that can contain swf files.

Here is one hint for you. The thumbnail has specks of color in it. The text is mostly black but does have some color. It's almost like the anti-aliasing is showing up but not the main color. In the Output Monitor window, the text is completely black, no specks of color at all.

In the meantime I do seem to have a workaround.

If you set the cacheAsBitmap property to true for the textfield or any parent of the textfield, it works. You lose some smoothness in the anti-aliasing. This also forces flash to regenerate the bitmap each time the textfield changes. Which is our case, the textfields will be changing frequently.

So really, it would be best to find the cause of this.

DonMoir
Posts: 12
Joined: Mon Dec 14, 2009 21:06

Re: Device Fonts are Always Black in Flash

Post by DonMoir »

Using cacheAsBitmap is not such a good workaround. It forces flash to do more work and can produce a jerky display.

This problem is being caused by the alpha channel. In flash, TextFields don't have an alpha value. They are always opaque. For whatever reason, resolume picks up rendered device fonts as having an alpha of zero or whatever. Nothing that I have tried changes this, except cacheAsBitmap or to use embedded fonts. Neither of these is a good option for us.

When I turn the alpha channel off, all the text is displayed normally.

It looks like resolume always assumes that swf files have an alpha channel. Your swf samples seem to work pretty much the same with the alpha channel on or off. One difference I see is that anti-aliasing is effected to some degree. With alpha channel on it seems to lose some of the anti-aliasing bits.

What might be good if you would add a external call so that the flash app can tell you whether it has an alpha channel or not. like hasAlphaChannel () : Boolean This would be very simple for you to implement.

Let the default be as it is if you have a need for it. We do not have a need for it as we will have backgrounds with voting and text information on it.

It might be you could always assume that swf's don't have an alpha channel as I cannot see a difference but there might be.

Since swf files are like 'smart movies' please let them be a little smarter with the communciation to resolume.

We need to be able to use device fonts in windows. The above solution seems to be a good deal.

DonMoir
Posts: 12
Joined: Mon Dec 14, 2009 21:06

Re: Device Fonts are Always Black in Flash

Post by DonMoir »

This also occurs with rss.swf when the RSS URL link cannot connect and you display the error message. Since with the error message you are using a device font.

steps:

o - Let rss.swf start normally

o - change the link to something that cannot connect.

The error message will be black. You can see it when the original yellow text scrolls under it or you hit the alpha button. The error messages are never removed either. They keep piling up until you deselect rss.swf

windows xp

edwin
Team Resolume
Posts: 1207
Joined: Thu Oct 07, 2004 10:40

Re: Device Fonts are Always Black in Flash

Post by edwin »

Thanx Donmoir,
We will certainly going to have a proper look now when we get back to work next week.
Thanx for the extensive testing and explanation, we appreciate that.
We'll probably would like to send you a test version once we have done some work on it. Please send us an email at mail AT resolume DOT com to remind us to this.

Post Reply