private RectF calcTextBounds(String _text,Paint _textPaint,RectF _textBounds){
  Rect textBoundsTmp=new Rect();
  _textPaint.getTextBounds(_text,0,_text.length(),textBoundsTmp);
  float width=textBoundsTmp.left + textBoundsTmp.width();
  float height=textBoundsTmp.bottom + textBoundsTmp.height() * 0.93f;
  RectF textRect=new RectF();
  textRect.left=(_textBounds.left + ((_textBounds.width() - width) / 2));
  textRect.top=_textBounds.top + ((_textBounds.height() - height) / 2);
  textRect.right=textRect.left + width;
  textRect.bottom=textRect.top + height;
  return textRect;
}

private RectF calcTextBounds ( String _text , Paint _textPaint , RectF _textBounds ) { Rect textBoundsTmp = new Rect ( ) ; _textPaint . getTextBounds ( _text , 0 , _text . length ( ) , textBoundsTmp ) ; float width = textBoundsTmp . left + textBoundsTmp . width ( ) ; float height = textBoundsTmp . bottom + textBoundsTmp . height ( ) * 0.93f ; RectF textRect = new RectF ( ) ; textRect . left = ( _textBounds . left + ( ( _textBounds . width ( ) - width ) / 2 ) ) ; textRect . top = _textBounds . top + ( ( _textBounds . height ( ) - height ) / 2 ) ; textRect . right = textRect . left + width ; textRect . bottom = textRect . top + height ; return textRect ; }
returns the bounding rectangle of the given _text , with the size and style defined in the _textpaint centered in the middle of the _textbounds
