public FormattedCharacterBuffer(String data,Font font,Color foreground,Color background){
  this(1,data.length());
  for (int i=0; i < numberOfLinesInBuffer * numberOfColumnsInBuffer; i++) {
    charBuffer[i]=(data.charAt(i) == '\n') ? '_' : data.charAt(i);
    perCharFonts[i]=font;
    perCharForegroundColor[i]=foreground;
    perCharBackgroundColor[i]=background;
  }
}

public FormattedCharacterBuffer ( String data , Font font , Color foreground , Color background ) { this ( 1 , data . length ( ) ) ; for ( int i = 0 ; i < numberOfLinesInBuffer * numberOfColumnsInBuffer ; i ++ ) { charBuffer [ i ] = ( data . charAt ( i ) == '\n' ) ? '_' : data . charAt ( i ) ; perCharFonts [ i ] = font ; perCharForegroundColor [ i ] = foreground ; perCharBackgroundColor [ i ] = background ; } }
create a single - line formatted character buffer . newlines are converted to underscores .
