private static Object parseFont( String value )
		throws IllegalArgumentException
	{
		Object font = fontCache.get( value );
		if( font != null )
			return font;

		int style = -1;
		int styleChange = 0;
		int absoluteSize = 0;
		int relativeSize = 0;
		float scaleSize = 0;
		List<String> families = null;
		String baseFontKey = null;

		// use StreamTokenizer to split string because it supports quoted strings
		StreamTokenizer st = new StreamTokenizer( new StringReader( value ) );
		st.resetSyntax();
		st.wordChars( ' ' + 1, 255 );
		st.whitespaceChars( 0, ' ' );
		st.whitespaceChars( ',', ',' ); // ignore ','
		st.quoteChar( '"' );
		st.quoteChar( '\'' );

		try {
			while( st.nextToken() != StreamTokenizer.TT_EOF ) {
				String param = st.sval;
				switch( param ) {
					// font style
					case "normal":
						style = 0;
						break;

					case "bold":
						if( style == -1 )
							style = 0;
						style |= Font.BOLD;
						break;

					case "italic":
						if( style == -1 )
							style = 0;
						style |= Font.ITALIC;
						break;

					case "+bold":   styleChange |= Font.BOLD; break;
					case "-bold":   styleChange |= Font.BOLD << 16; break;
					case "+italic": styleChange |= Font.ITALIC; break;
					case "-italic": styleChange |= Font.ITALIC << 16; break;

					default:
						char firstChar = param.charAt( 0 );
						if( Character.isDigit( firstChar ) || firstChar == '+' || firstChar == '-' ) {
							// font size
							if( absoluteSize != 0 || relativeSize != 0 || scaleSize != 0 )
								throw new IllegalArgumentException( "size specified more than once in '" + value + "'" );

							if( firstChar == '+' || firstChar == '-' )
								relativeSize = parseInteger( param );
							else if( param.endsWith( "%" ) )
								scaleSize = parseInteger( param.substring( 0, param.length() - 1 ) ) / 100f;
							else
								absoluteSize = parseInteger( param );
						} else if( firstChar == '$' ) {
							// reference to base font
							if( baseFontKey != null )
								throw new IllegalArgumentException( "baseFontKey specified more than once in '" + value + "'" );

							baseFontKey = param.substring( 1 );
						} else {
							// font family
							if( families == null )
								families = Collections.singletonList( param );
							else {
								if( families.size() == 1 )
									families = new ArrayList<>( families );
								families.add( param );
							}
						}
						break;
				}
			}
		} catch( RuntimeException | IOException ex ) {
			throw new IllegalArgumentException(  "invalid font '" + value + "' (" + ex.getMessage() + ")" );
		}

		if( style != -1 && styleChange != 0 )
			throw new IllegalArgumentException( "invalid font '" + value + "': can not mix absolute style (e.g. 'bold') with derived style (e.g. '+italic')" );
		if( styleChange != 0 ) {
			if( (styleChange & Font.BOLD) != 0 && (styleChange & (Font.BOLD << 16)) != 0 )
				throw new IllegalArgumentException( "invalid font '" + value + "': can not use '+bold' and '-bold'" );
			if( (styleChange & Font.ITALIC) != 0 && (styleChange & (Font.ITALIC << 16)) != 0 )
				throw new IllegalArgumentException( "invalid font '" + value + "': can not use '+italic' and '-italic'" );
		}

		font = new FlatLaf.ActiveFont( baseFontKey, families, style, styleChange, absoluteSize, relativeSize, scaleSize );
		fontCache.put( value, font );
		return font;
	}
Syntax: [normal] [bold|+bold|-bold] [italic|+italic|-italic] [<size>|+<incr>|-<decr>|<percent>%] [family[, family]] [$baseFontKey]
flatlaf-core/src/main/java/com/formdev/flatlaf/UIDefaultsLoader.java