static boolean advanceToFirstFont(AttributedCharacterIterator aci){
  for (char ch=aci.first(); ch != CharacterIterator.DONE; ch=aci.setIndex(aci.getRunLimit())) {
    if (aci.getAttribute(TextAttribute.CHAR_REPLACEMENT) == null) {
      return true;
    }
  }
  return false;
}

static boolean advanceToFirstFont ( AttributedCharacterIterator aci ) { for ( char ch = aci . first ( ) ; ch != CharacterIterator . DONE ; ch = aci . setIndex ( aci . getRunLimit ( ) ) ) { if ( aci . getAttribute ( TextAttribute . CHAR_REPLACEMENT ) == null ) { return true ; } } return false ; }
when this returns , the aci ' s current position will be at the start of the first run which does not contain a graphicattribute . if no such run exists the aci ' s position will be at the end , and this method will return false .
