--- old/src/java.desktop/share/classes/sun/font/FontDesignMetrics.java 2017-12-07 12:22:09.292742514 -0800 +++ new/src/java.desktop/share/classes/sun/font/FontDesignMetrics.java 2017-12-07 12:22:09.120742519 -0800 @@ -33,6 +33,7 @@ import java.awt.GraphicsEnvironment; import java.awt.geom.AffineTransform; import java.awt.geom.NoninvertibleTransformException; +import java.awt.geom.Rectangle2D; import java.awt.font.FontRenderContext; import java.awt.font.TextLayout; @@ -519,6 +520,28 @@ } /** + * This method is called from java.awt.Font only after verifying + * the arguments and that the text is simple and there are no + * layout attributes, font transform etc. + */ + public Rectangle2D getSimpleBounds(char data[], int off, int len) { + + float width = 0; + int limit = off + len; + for (int i=off; i < limit; i++) { + char ch = data[i]; + if (ch < 0x100) { + width += getLatinCharWidth(ch); + } else { + width += handleCharWidth(ch); + } + } + + float height = ascent + descent + leading; + return new Rectangle2D.Float(0f, ascent, width, height); + } + + /** * Gets the advance widths of the first 256 characters in the * {@code Font}. The advance is the * distance from the leftmost point to the rightmost point on the