Search code examples
apache-flexfontsembeddingadvanceddatagridflex-mx

Embedded font in mx-AdvancedDataGridItemRenderer not working


I'm facing here really annoying issue when trying to embed custom font in AdvancedDataGridItemRenderer.

After some research I found this solution: http://www.webappsolution.com/wordpress/2011/01/20/getting-spark-mx-components-to-use-embedded-fonts/.

Somehow, and I guess it's because I'm using custom mx AdvancedDataGridItemRenderer, which overrids the fontFamily styling property, and I cannot see the embedded font.


Solution

  • Just figured....

    First of all some sharing, In order to embed my custom font for spark as well for mx components I used:

    s|global
        {
            fontFamily: [MY_CUSTOM_FONT];
            fontSize: 14;
            textFieldClass: ClassReference("mx.core.UIFTETextField");
        }
    

    This is works for most mx components.

    Now, we are using mx components AdvancedDatagrid and AdvancedDataGridItemRenderer (not MXAdvancedDataGridItemRenderer Which is actually a spark component).

    In that case I had to change my CustomAdvancedDataGridItemRenderer to extends FTEAdvancedDataGridItemRenderer instead of just AdvancedDataGridItemRenderer.

    Which solve the problem! Hurrah!