John John
John John

Reputation: 4575

Embedded font in Alert font-family property doesn't working in Flex 4

I'm using Flex 4. I'm trying to apply a embedded font in all Alert components of the application, to get the same style that all the app, of course.

I code in my CSS file:

@font-face
{ 
fontFamily: "Trebuchet MS";
src: url("resources/Trebuchet MS.ttf");
embedAsCFF: true;
}
mx|Alert{   
font-family: "Trebuchet MS";
} 
s|ButtonBase, s|TextBase, s|TextInput, mx|Label{
font-family: "Trebuchet MS";
color:"#000000";
}

The font-family worked to all componentes, but not to the Alert component. In alert the text message and title got unvisible. If I change to other font-family it works correctly, just the embedded font doesn't work on Alert component. Anyone got this problem?

Obs: The embedded font worked in all the app, just the Alert no.

Upvotes: 3

Views: 1534

Answers (1)

Florian F
Florian F

Reputation: 8875

Notice that Alert is a MX component, not a Spark component. MX components don't handle Device 4 fonts by default.

To make it work, you have to change the textFieldClass for MX components :

mx|global
{
    textFieldClass: ClassReference("mx.core.UIFTETextField");
}

Upvotes: 5

Related Questions