public void setAt(
      int lineIndex, int columnIndex, char value, Font font, Color foreground, Color background) {
    int writeIndex = (lineIndex * numberOfColumnsInBuffer) + columnIndex;
    charBuffer[writeIndex] = value;
    perCharFonts[writeIndex] = font;
    perCharForegroundColor[writeIndex] = foreground;
    perCharBackgroundColor[writeIndex] = background;
  }
Create a single-line formatted character buffer. Newlines are converted to underscores.
java/zylib/src/main/java/com/google/security/zynamics/zylib/gui/CodeDisplay/FormattedCharacterBuffer.java