}
if (textRecord.document.isUseLinkColoring()) {
Color brokenLinkColor = textRecord.document.getUnresolvedLinkColor();
if (brokenLink && (brokenLinkColor != null)) {
// Add a text color function to color the link
TextColor textColor = new TextColor(brokenLinkColor);
// Preceding NUL
out.writeByte(0);
textColor.write(out);
linkColored = true;
} else if (linkColor != null) {
// Add a text color function to color the link
TextColor textColor = new TextColor(linkColor);
// Preceding NUL
out.writeByte(0);
textColor.write(out);
linkColored = true;
}
}
}
if (function instanceof TextColor) {
if (textRecord.document.isUseTextColors()) {
textRecord.currentTextColor = ((TextColor) function).getColor();
} else {
continue;
}
}
out.writeByte(0); // Preceding NUL
function.write(out);
if (function instanceof LinkEnd && linkColored) {
// Preceding NUL
out.writeByte(0);
if (textRecord.currentTextColor != null) {
new TextColor(textRecord.currentTextColor).write(out);
} else {
// Assume black
Functions.TEXT_COLOR_BLACK.write(out);
}
linkColored = false;