--- old/src/java.desktop/share/classes/javax/swing/text/Utilities.java 2018-06-06 12:26:20.669080700 +0530 +++ new/src/java.desktop/share/classes/javax/swing/text/Utilities.java 2018-06-06 12:26:19.704025500 +0530 @@ -526,7 +526,12 @@ } } } else { - nextX += getFontCharWidth(txt[i], metrics, useFPAPI); + // Use the floating point API directly as char width can be in + // floating point for non-integer window scale + Rectangle2D bounds = metrics.getFont(). + getStringBounds(new char[]{txt[i]}, 0, 1, + metrics.getFontRenderContext()); + nextX += (float) bounds.getWidth(); } if (x < nextX) { // found the hit position... return the appropriate side