1 Reply Latest reply on Nov 25, 2012 7:15 PM by lizsterine

    StyleableTextField doesn't display fontWeight or fontStyle in iPad 3

    lizsterine

      I have some LabelItemRenderers in my app that have a few StyleableTextFields in them:

      • one to display a title in bold,
      • one to display a bit of content and
      • one to display a status in italics and another colour. 

       

      I apply the text stylings through setStyle() functions during the "set data" method as the heading style can slightly differ depending on data.  All fields use a system font.

       

      The different styles show up on iPad 1 correctly (and in the desktop emulator).  But, on iPad 3, the fontWeight and fontStyle settings don't render, but the text colour change does. 

       

      I've recently updated the AIR SDK to 3.3 and the problem still persists. 

       

      Dev info:

      • Using FlashBuilder 4.6 Professional
      • Flex SDK: 4.6
        AIR SDK: 3.3
      • Builds done with ANT script using MXMLC for swf compilation

       

       

      Any ideas? 

        • 1. Re: StyleableTextField doesn't display fontWeight or fontStyle in iPad 3
          lizsterine Level 1

          Finally had some time to try and trouble shoot this and figured it out.  As I am using a single code base for multiple project types (Mobile, Web and Desktop), my global CSS fontFamily declaration was a comma separated string. 

          Two factors I think were at play that made the styles fail to render on the mobile:

           

          1) Mobile apps can't use the comma separated string for fontFamily, only one entry can be used.

          2) The comma string names may have provoked the global style to use one of the embedded fonts that doesn't have bold or italics included.

           

          Whichever the reason, my solution was changing my default fontFamily for my mobile app to fontFamily: _sans; and styles now render correctly.