2 Replies Latest reply on Sep 29, 2008 4:39 AM by COKFlex

    how to adjust the height of the label based on the font

    COKFlex Level 1
      Hi All,

      Kindly see below the code attached. If I choose the Comic Sans MS as the fontFamily in the label, the output was fine. But If I choose Times New Roman or Arial or Courier New as the fontFamily, I am getting lots of blankspace after the second line "HELLO HOW ARE YOU".

      But my requirement was at any point of time, the space above the first line and the space after the second line should be the same.

      Any help would be appreciated.

      Thanks.
        • 1. Re: how to adjust the height of the label based on the font
          SujitG Level 2
          Hi,

          I think the space is always same, it is because the other fonts are comparatively smaller in nature than Comic Sans MS and the height of the Label component is fixed you are getting the gap. The font is occupying lesser space and so the rest is left blank.

          Try using mx:Text instead of Label so that you need not have the height constant to render multiple line text.

          Hope this helps.
          • 2. Re: how to adjust the height of the label based on the font
            COKFlex Level 1
            Hi Sujit,

            Thanks for the solution. I was struggling to get rid of this issue for the past two weeks. Infact I tried using mx:Text earlier. the issue what I faced was different in that case.

            Say I need to display 3 rows of text, the first two rows displayed properly. The thrid row is always not displayed fully. what I found was, if the actuall row height should 50, then the last/final rowheight is only 20 (30 less than the actual). so I am getting only half of the text is visible.

            Any way of refreshing the textheight or display? Or any other suggestions for this issue?