}
return;
}
case LwgElement.CHUNK:
{
Chunk chunk = (Chunk) element;
// if the chunk contains an image, return the image representation
LwgImage image = chunk.getImage();
if (image != null) {
write(image, indent);
return;
}
if (chunk.isEmpty()) return;
HashMap attributes = chunk.getAttributes();
if (attributes != null && attributes.get(Chunk.NEWPAGE) != null) {
return;
}
boolean tag = isOtherFont(chunk.getFont()) || markup.size() > 0;
if (tag) {
// start span tag
addTabs(indent);
writeStart(HtmlTags.SPAN);
if (isOtherFont(chunk.getFont())) {
write(chunk.getFont(), null);
}
writeMarkupAttributes(markup);
os.write(GT);
}
if (attributes != null && attributes.get(Chunk.SUBSUPSCRIPT) != null) {
// start sup or sub tag
if (((Float)attributes.get(Chunk.SUBSUPSCRIPT)).floatValue() > 0) {
writeStart(HtmlTags.SUP);
}
else {
writeStart(HtmlTags.SUB);
}
os.write(GT);
}
// contents
write(HtmlEncoder.encode(chunk.getContent()));
if (attributes != null && attributes.get(Chunk.SUBSUPSCRIPT) != null) {
// end sup or sub tag
os.write(LT);
os.write(FORWARD);
if (((Float)attributes.get(Chunk.SUBSUPSCRIPT)).floatValue() > 0) {