Take the 2-minute tour ×

I use a file for declaring CSS styles:

/* CSS file */
@namespace view "com.myviews.*";
@namespace comp "com.myviews.mycomponents.*"; 

@font-face {

@font-face {

global {
    font-family:arial_s; font-size:12.5;  

s|DropDownList {

Q1: I get this warning on the line above for s|DropDownList:

The CSS type selector 'spark.components.DropDownList' was not processed, because the type was not used in the application.

But it IS used in the application, and changing its value here DOES have an effect. Any idea why I'm getting this warning?

Q2: When I run the application in debug mode, I get the warning:

warning: incompatible embedded font 'arial_s' specified for mx.core::UITextFormat. This component requires that the embedded font be declared with embedAsCFF=false.

The warning is coming because I've used the global attribute for spark components above, and this causes it to be applied to all components including some mx components. The component of interest here is text in a DataGrid cell. I just need to figure out how to separately define the style for mx.core::UITextFormat. Any idea what the syntax is for this? I tried:

mx|UITextFormat {

but it doesn't work. Not sure what to do. http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/core/UITextFormat.html

share|improve this question
add comment

1 Answer

The docs for UITextFormat don't include any CSS styles.

This is just a hunch, but since UITextFormat is really just a format that is applied to a UITextField, maybe you can just apply the font style to the UITextField object:

mx|UITextField {

In regards to the first question regarding the DropDownList, is it possible that the DownDownList is in a library project and not actually in the application project? If so, you can create a defaults.css for the library project.


The font issue was bothering me :) I looked at DefaultGridItemRenderer: it extends UITextField. So for it to use an embedded font, it has to have it's embedFonts property set to true. It then also needs a UITextFormat object that refers to the embedded font.

You could extend the DefaultGridItemRenderer to do this, but I thought Adobe might have made this easier, and looked at the following DataGrid styles. For non-mobile apps, the DataGrid docs point you to ITextLayoutFormat, which is what I've linked to here:

I'm wondering if the embedded font is actually being used in your DataGrid, as it seems the default renderer won't use them (unless the DataGrid instructs it to).

In fact, your css is embedding the font twice (?) and I think you should only have to do that once -- by setting the styles appropriately on the DataGrid:

s|DataGrid {
    fontLookup: embeddedCFF;
    renderingMode: cff; 
share|improve this answer
Thanks Sunil, I tried the UITextField above as well as TextInput and some others and nothing changes. I'm not using a Library project here, but the data grid is in an mxml file inside com.myviews, but I tried using view|DropDownList{...} and it reports same warning. –  ggkmath May 23 '12 at 18:59
Hmm, the only other thing that comes to mind is to try cleaning the project. Sorry I couldn't help :) –  Sunil D. May 23 '12 at 19:15
I updated my answer, regarding the embedded font issue, hope that helps. –  Sunil D. May 23 '12 at 21:16
Thanks Sunil, I assumed I had to embed twice (once for spark and once more for mx; see font-family names are different) but perhaps there's a way to do this once by using a style name or something else in the CSS file, then refer to that style name to complete the embeddedCSF and rendering mode, etc., all within the CSS file. I'd rather do it once in the CSS file than throughout the application. –  ggkmath May 23 '12 at 22:05
add comment

Your Answer


