@Override
	protected void paintIcon( Graphics g, JComponent c, Rectangle iconRect ) {
		// correct icon location when using bold font for default button
		int xOffset = defaultBoldPlainWidthDiff( c ) / 2;
		if( xOffset > 0 ) {
			boolean ltr = c.getComponentOrientation().isLeftToRight();
			switch( ((AbstractButton)c).getHorizontalTextPosition() ) {
				case SwingConstants.RIGHT:    iconRect.x -= xOffset; break;
				case SwingConstants.LEFT:     iconRect.x += xOffset; break;
				case SwingConstants.TRAILING: iconRect.x -= ltr ? xOffset : -xOffset; break;
				case SwingConstants.LEADING:  iconRect.x += ltr ? xOffset : -xOffset; break;
			}
		}

		super.paintIcon( g, c, iconRect );
	}
Similar to BasicButtonUI.paint(), but does not use zero insets for HTML text,
which is done in BasicButtonUI.layout() since Java 19.
See https://github.com/openjdk/jdk/pull/8407
and https://github.com/openjdk/jdk/pull/8407#issuecomment-1761583430
flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatButtonUI.java