private void writeContent(final ITreeWriter writer, final NodeModel node, final NodeStyleModel style,
final boolean forceFormatting) throws IOException {
if(! NodeWriter.shouldWriteSharedContent(writer))
return;
if (forceFormatting || style != null) {
final XMLElement fontElement = new XMLElement();
fontElement.setName("font");
boolean isRelevant = forceFormatting;
final String fontFamilyName = forceFormatting ? nsc.getFontFamilyName(node) : style.getFontFamilyName();
if (fontFamilyName != null) {
fontElement.setAttribute("NAME", fontFamilyName);
isRelevant = true;
}
final Integer fontSize = forceFormatting ? Integer.valueOf(nsc.getFontSize(node)) : style.getFontSize();
if (fontSize != null) {
fontElement.setAttribute("SIZE", Integer.toString(fontSize));
isRelevant = true;
}
final Boolean bold = forceFormatting ? Boolean.valueOf(nsc.isBold(node)) : style.isBold();
if (bold != null) {
fontElement.setAttribute("BOLD", bold ? "true" : "false");
isRelevant = true;
}
final Boolean italic = forceFormatting ? Boolean.valueOf(nsc.isItalic(node)) : style.isItalic();
if (italic != null) {
fontElement.setAttribute("ITALIC", italic ? "true" : "false");
isRelevant = true;
}
if (isRelevant) {
writer.addElement(style, fontElement);
}