// Check the text has the newline
assertEquals(text, richTextString.getString());
// Apply the font
richTextString.applyFont(0, 3, font1);
cell.setCellValue(richTextString);
// To enable newlines you need set a cell styles with wrap=true
CellStyle cs = wb.createCellStyle();
cs.setWrapText(true);