Re-added text-mode printing code