public static float computeTextYCorrection( Graphics2D g ) {
		if( !useTextYCorrection() || !SystemInfo.isWindows )
			return 0;

		if( !SystemInfo.isJava_9_orLater ) {
			// Java 8
			float scaleFactor = getUserScaleFactor();
			if( scaleFactor > 1 ) {
				switch( g.getFont().getFamily() ) {
					case "Segoe UI":
					case "Segoe UI Light":
					case "Segoe UI Semibold":
						return -((scaleFactor == 2.25f || scaleFactor == 4f ? 0.875f : 0.625f) * scaleFactor);

					case "Noto Sans":
					case "Open Sans":
						return -(0.3f * scaleFactor);

					case "Verdana":
						return -((scaleFactor < 2 ? 0.4f : 0.3f) * scaleFactor);
				}
			}
		} else {
			// Java 9 and later

			// Text is painted at slightly different Y positions depending on scale factor
			// and Y position of component.
			// The exact reason is not yet known (to me), but there are several factors:
			// - fractional scale factors result in fractional component Y device coordinates
			// - fractional text Y device coordinates are rounded for horizontal lines of characters
			// - maybe different rounding methods for drawing primitives (e.g. rectangle) and text
			// - Java adds 0.5 to X/Y positions before drawing string in BufferedTextPipe.enqueueGlyphList()

			// this is not the optimal solution, but works very good in most cases
			// (tested with class FlatPaintingStringTest on Windows 11)

			switch( g.getFont().getFamily() ) {
				case "Segoe UI":
				case "Segoe UI Light":
				case "Segoe UI Semibold":
				case "Verdana":
				case Font.DIALOG:
				case Font.SANS_SERIF:
					return correctionForScaleY( g, CORRECTION_SEGOE_UI );

				case "Tahoma":
					return correctionForScaleY( g, CORRECTION_TAHOMA );

				case "Inter":
				case "Inter Light":
				case "Inter Semi Bold":	// Inter v3
				case "Inter SemiBold":	// Inter v4
				case "Roboto":
				case "Roboto Light":
				case "Roboto Medium":
					return correctionForScaleY( g, CORRECTION_INTER );

				case "Noto Sans":
				case "Open Sans":
					return correctionForScaleY( g, CORRECTION_OPEN_SANS );
			}
		}

		return 0;
	}
When painting text on HiDPI screens and the JRE scales, then the text is
painted too far down on some operating systems.
The higher the system scale factor is, the more.
<p>
This method computes a correction value for the Y position.
flatlaf-core/src/main/java/com/formdev/flatlaf/util/HiDPIUtils.java