public static Graphics2D createGraphicsTextYCorrection( Graphics2D g ) {
		float yCorrection = computeTextYCorrection( g );
		if( yCorrection == 0 )
			return g;

		return new Graphics2DProxy( g ) {
			@Override
			public void drawString( String str, int x, int y ) {
				super.drawString( str, x, y + yCorrection );
			}

			@Override
			public void drawString( String str, float x, float y ) {
				super.drawString( str, x, y + yCorrection );
			}

			@Override
			public void drawString( AttributedCharacterIterator iterator, int x, int y ) {
				super.drawString( iterator, x, y + yCorrection );
			}

			@Override
			public void drawString( AttributedCharacterIterator iterator, float x, float y ) {
				super.drawString( iterator, x, y + yCorrection );
			}

			@Override
			public void drawChars( char[] data, int offset, int length, int x, int y ) {
				super.drawChars( data, offset, length, x, Math.round( y + yCorrection ) );
			}

			@Override
			public void drawBytes( byte[] data, int offset, int length, int x, int y ) {
				super.drawBytes( data, offset, length, x, Math.round( y + yCorrection ) );
			}

			@Override
			public void drawGlyphVector( GlyphVector g, float x, float y ) {
				super.drawGlyphVector( g, x, y + yCorrection );
			}

			@Override
			public void fillRect( int x, int y, int width, int height ) {
				// fix hard coded black color in HRuleView.paint() of '<hr noshade>'
				if( super.getColor() == Color.black &&
					StackUtils.wasInvokedFrom( "javax.swing.text.html.HRuleView", "paint", 4 ) )
				{
					super.setColor( FlatLaf.isLafDark() ? Color.lightGray : Color.darkGray );
					super.fillRect( x, y, width, height );
					super.setColor( Color.black );
				} else
					super.fillRect( x, y, width, height );
			}
		};
	}
Creates a graphics object and applies Y correction to string drawing methods.
If no Y correction is necessary, the passed in graphics object is returned.
flatlaf-core/src/main/java/com/formdev/flatlaf/util/HiDPIUtils.java