void (ScaleContext ctx) { // The test may depend on a physical font which may vary b/w platforms. By this reason, there's a preset map // b/w ScaleContext's and the tested string with. If the font on this platform doesn't fit the preset, // then the test silently interrupts. Font font = JBFont.create(JBFont.label().deriveFont((float)ctx.apply(FONT_SIZE, DerivedScaleType.EFF_USR_SCALE))); int width = TestScaleHelper.createComponent(ctx).getFontMetrics(font).stringWidth(TEXT); assumeTrue(CTX_TO_SIZE.containsKey(ctx), "unexpected ScaleContext: " + ctx); assumeTrue(CTX_TO_SIZE.get(ctx) == width, "unexpected text width: " + width); }