escpos-php
|
This class renders text to small images on-the-fly. More...
Public Member Functions | |
flush () | |
Cause the buffer to send any partial input and wait on a newline. More... | |
getPrinter () | |
Used by Escpos to check if a printer is set. | |
setPrinter (Printer $printer=null) | |
Used by Escpos to hook up one-to-one link between buffers and printers. More... | |
writeText (string $text) | |
Accept UTF-8 text for printing. More... | |
writeTextRaw (string $text) | |
Accept 8-bit text in the current encoding and add it to the buffer. More... | |
setFont (string $font) | |
Set path on disk to TTF font that will be used to render text to image, or 'null' to use a default. More... | |
setFontSize (int $fontSize) | |
Numeric font size for rendering text to image. | |
This class renders text to small images on-the-fly.
It attempts to mimic the behaviour of text output, whilst supporting any fonts & character encodings which your system can handle. This class currently requires Imagick.
Mike42\Escpos\PrintBuffers\ImagePrintBuffer::flush | ( | ) |
Cause the buffer to send any partial input and wait on a newline.
If the printer is already on a new line, this does nothing.
Implements Mike42\Escpos\PrintBuffers\PrintBuffer.
Mike42\Escpos\PrintBuffers\ImagePrintBuffer::setFont | ( | string | $font | ) |
Set path on disk to TTF font that will be used to render text to image, or 'null' to use a default.
ImageMagick will also accept a font name, but this will not port as well between systems.
string | $font | Font name or a filename |
Mike42\Escpos\PrintBuffers\ImagePrintBuffer::setPrinter | ( | Printer | $printer = null | ) |
Used by Escpos to hook up one-to-one link between buffers and printers.
Printer | null | $printer | New printer |
Implements Mike42\Escpos\PrintBuffers\PrintBuffer.
Mike42\Escpos\PrintBuffers\ImagePrintBuffer::writeText | ( | string | $text | ) |
Accept UTF-8 text for printing.
string | $text | Text to print |
Implements Mike42\Escpos\PrintBuffers\PrintBuffer.
Mike42\Escpos\PrintBuffers\ImagePrintBuffer::writeTextRaw | ( | string | $text | ) |
Accept 8-bit text in the current encoding and add it to the buffer.
string | $text | Text to print, already the target encoding. |
Implements Mike42\Escpos\PrintBuffers\PrintBuffer.