Search code examples
actionscript-3apache-flexactionscriptflex4

leading for a Flex mx TextArea


When I set leading to 0 for a Flex mx TextArea I get strange results: fontsize -> space between baselines 20 - 25 is 125% 25 - 31 is 124% shouldn't all of these be the same (should only be 100%)? Or least follow a pattern, because I can't se any. When i set leading to 0, the space between my baselines should be the same as the font size/height. This is not the case here. How do I know how to get the space between the baseline to be equal to the height of the font?


Solution

  • var ttLnHt:Number = _textArea.myUITextField.getLineMetrics(0).height; // guessPerc is variable for calculation = (100/(font size))*(total height of line);

    var guessPerc:Number = (100/(textSize))*ttLnHt;