Custom justify in TextField

I want to make a custom justify method for textField (because I can’t use the allready existing of the textField, it’s not working exactly as I want).
Suppose I have a text field with 2 lines of text:
ab c
def g

(‘c’ is Bold)
Tha means I must increase the letter spacing between letters ‘b’ and ‘c’ of the first line, so that the width of the 1st line becomes equal to the width of the second line.
How do I calculate the width of the second line?
Is the width of the second line = textField.textWidth?
Should I use something like :


// find width of line in pixels
        var    lineWidthPixels = 0; var letterWidthPixels = 0;
        var metrics:Object = my_format.getTextExtent("");
        for(i = 0; i < lineLength; i++){    
            // Obtain metrics information for the text string
            // with the specified formatting.
            my_format = input_txt.getTextFormat(b + i)
            current_letter = input_txt.text.charAt(b + i);
            metrics = my_format.getTextExtent(current_letter);
            letterWidthPixels = metrics.textFieldWidth;
            lineWidthPixels += letterWidthPixels + my_format.letterSpacing;
        }