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