public static int calcTextHeight(Paint paint,String demoText){
  Rect r=mCalcTextHeightRect;
  r.set(0,0,0,0);
  paint.getTextBounds(demoText,0,demoText.length(),r);
  return r.height();
}

public static int calcTextHeight ( Paint paint , String demoText ) { Rect r = mCalcTextHeightRect ; r . set ( 0 , 0 , 0 , 0 ) ; paint . getTextBounds ( demoText , 0 , demoText . length ( ) , r ) ; return r . height ( ) ; }
calculates the approximate height of a text , depending on a demo text avoid repeated calls ( e . g . inside drawing methods )
