public static Font[] filterMonospaced(Font... fonts){
  List<Font> result=new ArrayList<Font>(fonts.length);
  for (  Font font : fonts) {
    if (isFontMonospaced(font)) {
      result.add(font);
    }
  }
  return result.toArray(new Font[result.size()]);
}

public static Font [ ] filterMonospaced ( Font ... fonts ) { List < Font > result = new ArrayList < Font > ( fonts . length ) ; for ( Font font : fonts ) { if ( isFontMonospaced ( font ) ) { result . add ( font ) ; } } return result . toArray ( new Font [ result . size ( ) ] ) ; }
given an array of fonts , returns another array with only the ones that are monospaced . the fonts in the result will have the same order as in which they came in . a font is considered monospaced if the width of ' i ' and ' w ' is the same .
