11-20-2010 11:47 AM
Apparently the alpha setting of a Label control does not work in the simulator:
var label :Label = new Label(); label.x = 10; label.y = 10; label.text = 'HELLO'; label.alpha = 0.20; label.format = new TextFormat( 'Arial', 18, 0xFFFFFF ); this.addChild( label );
As a normal AIR application, it looks like this:
In the simulator, it looks like this:
Bug or feature?
11-20-2010 11:53 PM
This is a feature of Flash Player.
You can' t use alpha, mask or rotation when the TextField (used in Label) renders the text with system fonts.
You need to embed fonts in class definition like this:
[Embed(systemFont="Arial", fontName="Arial", mimeType="application/x-font", embedAsCFF="false")] private static var font:Class;
and set the embedFonts on Label to true:
label.embedFonts = true;
You can get more info on embedding fonts at:
11-21-2010 09:19 AM - edited 11-21-2010 09:20 AM
11-22-2010 02:12 PM
11-22-2010 02:49 PM
I can confirm this works:
var l1:Label = new Label();
l1.text = "test1";
[Embed(systemFont="Arial", fontName="Arial", mimeType="application/x-font", embedAsCFF="false")]
var l2:Label = new Label();
l2.text = "test2";
l2.format =new TextFormat("Arial");
Renders as follows:
11-22-2010 03:47 PM
11-22-2010 06:44 PM
Assuming things work like they did years ago when I did Flash (before Flex came along), font embedding embeds the font as a shape. Therefore it's not being rendered as text, but by drawing a shape like any other. That might explain the differences. The fact that you don't have the BB fonts installed on the computer you're compiling on would be why they don't embed properly.
Of course it's possible Adobe uses a more sophisticated font embedding system these days, but this was how it worked several years ago. Wouldn't be surprised if it's still true today.