public static int getStandardAscent(@NotNull Font font, @NotNull Graphics g) {
    FontRenderContext context = ((Graphics2D)g).getFontRenderContext();
    char[] chars = {'G', 'l', 'd', 'h', 'f'};
    double y = font.layoutGlyphVector(context, chars, 0, chars.length, Font.LAYOUT_LEFT_TO_RIGHT).getVisualBounds().getY();
    return Math.toIntExact(Math.round(Math.ceil(-y)));
  }
public static int getStandardAscent(@NotNull Font font, @NotNull Graphics g)