private String getFontName ( TermList list , CSSProperty . FontWeight weight , CSSProperty . FontStyle style ) { for ( Term < ? > term : list ) { Object value = term . getValue ( ) ; if ( value instanceof CSSProperty . FontFamily ) return ( ( CSSProperty . FontFamily ) value ) . getAWTValue ( ) ; else { String name = lookupFont ( value . toString ( ) , weight , style ) ; if ( name != null ) return name ; } } //nothing found, use Serif return java . awt . Font . SERIF ; }
Scans a list of font definitions and chooses the first one that is available