First pass for extracting common text renderer code.