Font (@NotNull Font font, @NotNull char[] text) { if (!SystemInfoRt.isMac /* 'getFontWithFallback' does nothing on macOS */ && font.canDisplayUpTo(text, 0, text.length) != -1) { return getFontWithFallback(font); } else { return font; } }