What element-type are you opening your output file with? string-char or character? If it's string-char, that explains why your character styles are being discarded.