private int getCharWidth ( String text , Align align ) { final int width ; if ( align == Align . RIGHT ) { width = getTextWidth ( text ) ; } else if ( align == Align . CENTER ) { width = getTextWidth ( text ) / 2 ; } else { width = 0 ; } return width ; }
Get character width depending of alignment .