protected int getTextFontWidth ( byte textType , String text ) { if ( text == null ) return 0 ; FontMetrics fontMetrics = g2 . getFontMetrics ( getTextFont ( textType ) ) ; return fontMetrics . stringWidth ( text ) ; }
Returns width of string rendered in the textType font .