protected void paintBuffer(final Graphics2D context, int x, int y, int skipColumns) {
    context.setFont(perCharFonts[0]);
    FontMetrics fontMetrics = context.getFontMetrics();
    // Clear the context with the default background color.
    context.fillRect(
        0,
        0,
        numberOfColumnsInBuffer * fontMetrics.charWidth('a'),
        numberOfLinesInBuffer * fontMetrics.getHeight());

    for (int i = 0; i < numberOfLinesInBuffer; i++) {
      AttributedString stringToDraw = getAttributedStringForLine(i, skipColumns);
      // the +1 for the line index is necessary to avoid cutting off first line.
      context.drawString(stringToDraw.getIterator(), x, y + fontMetrics.getHeight() * (i + 1));
    }
  }
Paints the current buffer onto a given graphics context, skipping the first N character
columns.
java/zylib/src/main/java/com/google/security/zynamics/zylib/gui/CodeDisplay/FormattedCharacterBuffer.java