double (double fontMetricsThickness, @NotNull Font font) { float fontScale = JBUIScale.getFontScale(font.getSize2D()); float normalizedFontScale = font.getSize2D() / UISettings.getDefFontSize(); if (normalizedFontScale > 1) { // k==1.0 with normalizedFontScale==1.0, k->0.5 fast enough with normalizedFontScale increasing double k = 1 / (Math.pow(normalizedFontScale, 2) + 1) + 0.5; fontScale *= k; } if (!JreHiDpiUtil.isJreHiDPIEnabled()) fontScale = Math.max(1, Math.round(fontScale)); return Math.max(fontMetricsThickness, fontScale); }