private static Font createFontEx( String family, int style, int size ) {
		for(;;) {
			Font font = FlatLaf.createCompositeFont( family, style, size );

			if( Font.DIALOG.equals( family ) )
				return font;

			// if the font family does not match any font on the system, "Dialog" family is returned
			if( !Font.DIALOG.equals( font.getFamily() ) ) {
				// check for font problems
				// - font height much larger than expected (e.g. font Inter; Oracle Java 8)
				// - character width is zero (e.g. font Cantarell; Fedora; Oracle Java 8)
				FontMetrics fm = StyleContext.getDefaultStyleContext().getFontMetrics( font );
				if( fm.getHeight() > size * 2 || fm.stringWidth( "a" ) == 0 )
					return FlatLaf.createCompositeFont( Font.DIALOG, style, size );

				return font;
			}

			// find last word in family
			int index = family.lastIndexOf( ' ' );
			if( index < 0 )
				return FlatLaf.createCompositeFont( Font.DIALOG, style, size );

			// check whether last work contains some font weight (e.g. Ultra-Bold or Heavy)
			String lastWord = family.substring( index + 1 ).toLowerCase( Locale.ENGLISH );
			if( lastWord.contains( "bold" ) || lastWord.contains( "heavy" ) || lastWord.contains( "black" ) )
				style |= Font.BOLD;

			// remove last word from family and try again
			family = family.substring( 0, index );
		}
	}
Create a font for the given family, style and size.
If the font family does not match any font on the system,
then the last word (usually a font weight) from the family name is removed and tried again.
E.g. family 'URW Bookman Light' is not found, but 'URW Bookman' is found.
If still not found, then font of family 'Dialog' is returned.
flatlaf-core/src/main/java/com/formdev/flatlaf/LinuxFontPolicy.java