public int getFontNumber ( RtfFont font ) { if ( font instanceof RtfParagraphStyle ) { font = new RtfFont ( this . document , font ) ; } int fontIndex = - 1 ; for ( int i = 0 ; i < fontList . size ( ) ; i ++ ) { if ( fontList . get ( i ) . equals ( font ) ) { fontIndex = i ; } } if ( fontIndex == - 1 ) { fontIndex = fontList . size ( ) ; fontList . add ( font ) ; } return fontIndex ; }
Gets the index of the font in the list of fonts . If the font does not exist in the list it is added .