TextCellRenderer calculats optimal width without applying font and format.
The getOptimalWidth() method should be something like
applyFont(gc);
String text = null;
if (format != null) {
try {
text = format.format(content);
} catch (Exception e) {
logger.warn("Error formating cell content:{} with {}", content, format);
}
}
int width = super.getOptimalWidth(gc, col, row, text == null ? content.toString() : text, fixed, model);
resetFont(gc);
return width;