public float getWidth ( int startIdx , int lastIdx ) { char c = 0 ; PdfChunk ck = null ; float width = 0 ; for ( ; startIdx <= lastIdx ; ++ startIdx ) { boolean surrogate = Utilities . isSurrogatePair ( text , startIdx ) ; if ( surrogate ) { width += detailChunks [ startIdx ] . getCharWidth ( Utilities . convertToUtf32 ( text , startIdx ) ) ; ++ startIdx ; } else { c = text [ startIdx ] ; ck = detailChunks [ startIdx ] ; if ( PdfChunk . noPrint ( ck . getUnicodeEquivalent ( c ) ) ) continue ; width += detailChunks [ startIdx ] . getCharWidth ( c ) ; } } return width ; }
Gets the width of a range of characters .