public int nextFontRunIndex(CodePointIterator iter){
  int cp=iter.next();
  int fontIndex=1;
  if (cp != CodePointIterator.DONE) {
    fontIndex=getFontIndex(cp);
    while ((cp=iter.next()) != CodePointIterator.DONE) {
      if (getFontIndex(cp) != fontIndex) {
        iter.prev();
        break;
      }
    }
  }
  return fontIndex;
}

public int nextFontRunIndex ( CodePointIterator iter ) { int cp = iter . next ( ) ; int fontIndex = 1 ; if ( cp != CodePointIterator . DONE ) { fontIndex = getFontIndex ( cp ) ; while ( ( cp = iter . next ( ) ) != CodePointIterator . DONE ) { if ( getFontIndex ( cp ) != fontIndex ) { iter . prev ( ) ; break ; } } } return fontIndex ; }
determines the font index for the code point at the current position in the iterator , then advances the iterator to the first code point that has a different index or until the iterator is done , and returns the font index .
