code: private float  calculateTextWidth(TextContainer parentTextObj)
     {
        TextWidthCalculator  proc = new TextWidthCalculator();
        enumerateTextSpans(parentTextObj, proc);
        return proc.x;
     }
docs: /*
  Calculate the approximate width of this line of text.
  To simplify, we will ignore font changes and just assume that all the text
  uses the current font.