Added text preview function on behalf of w0bni