I guess that because your printing a receipt and you don't need an images, TEXT would probably be the best option (If it works just as well). Faster printing would indicate it's doing less work which can't be a bad thing.
You could use the function
file_get_contents($filename) to get the contents of the file as a string. Try something like the following code:
$text_to_print = file_get_contents('receipt.txt');
//Use this next line only if it doesn't work without it,
//ie prints "Text \n\nTo print" instead of "Text \nTo print"
$text_to_print = str_replace('\n', '\r\n', $text_to_print);
//yada yada, printer stuff
printer_write($handle, $text_to_print);
//yada yada, more printer stuff
That should all work I reckon, I reckon.
BTW, when do you write the contents to the file
receipt.txt ? If it's earlier on in the script and you don't need to keep
receipt.txt then you may as well skip that process. For example:
$text_to_print = '';
//load mysql info into an array using:
$data = mysql_fetch_array($result, MYSQL_ASSOC);
$text_to_print .= "Name: $data['name']\r\n";
$text_to_print .= "Date: $data['date']\r\n";
//etc.
php.net is the best place to get help on any specific function in my humble opinion.