void (@NotNull Graphics g, CharSequence data, int start, int end, int x, int y, boolean drawWhitespace) { g.drawString(data.subSequence(start, end).toString(), x, y); if (drawWhitespace) { Color oldColor = g.getColor(); g.setColor(myScheme.getColor(EditorColors.WHITESPACES_COLOR)); final FontMetrics metrics = g.getFontMetrics(); for (int i = start; i < end; i++) { final char c = data.charAt(i); final int charWidth = isOracleRetina ? GraphicsUtil.charWidth(c, g.getFont()) : metrics.charWidth(c); if (c == ' ') { g.fillRect(x + (charWidth >> 1), y, 1, 1); } else if (c == IDEOGRAPHIC_SPACE) { final int charHeight = getCharHeight(); g.drawRect(x + 2, y - charHeight, charWidth - 4, charHeight); } x += charWidth; } g.setColor(oldColor); } }