Simplified write_text.