-
Notifications
You must be signed in to change notification settings - Fork 863
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Armenian language #780
Comments
Hi @levon1991 - any solution involving printer profiles will be highly printer-specific, can you share some information about which hardware and OS you are using? I can basically confirm that this example will only get you a string of "??????" on the default profile, which is what you would use for Epson printers. <?php
/* Call this file 'hello-world.php' */
require __DIR__ . '/vendor/autoload.php';
use Mike42\Escpos\PrintConnectors\FilePrintConnector;
use Mike42\Escpos\Printer;
$connector = new FilePrintConnector("php://stdout");
$printer = new Printer($connector);
$printer -> text("Կրնամ ապակի ուտել և ինծի անհանգիստ չըներ\n");
$printer -> cut();
$printer -> close(); However, if you need this to work and are prepared to work with something that is prototype-quality, then I would suggest reading this blog post. I have never finished working on custom font support, but you can absolutely print Armenian on a good ESC/POS printer. You can clone the code here, and get unifont here. You need to locate You then set a path and some text - diff --git a/unifont-bitmap-font/unifont-example.php b/unifont-bitmap-font/unifont-example.php
index 374431c..e1ef080 100644
--- a/unifont-bitmap-font/unifont-example.php
+++ b/unifont-bitmap-font/unifont-example.php
@@ -515,7 +515,7 @@ class UnifontCodeSource implements ColumnFormatGlyphFactory {
}
public function __construct() {
- $unifont = "/usr/share/unifont/unifont.hex";
+ $unifont = "unifont-12.1.03.hex";
$this -> unifontFile = explode("\n", file_get_contents($unifont));
}
@@ -722,11 +722,11 @@ class UnicodePrintBuffer implements PrintBuffer {
}
}
-$text = file_get_contents("php://stdin");
+$text = "Հայերեն ֏55,000\n";
$connector = new FilePrintConnector("php://stdout");
$printer = new Printer($connector);
$printer -> text($text);
$printer -> cut();
$printer -> close();
-?>
\ No newline at end of file
+?> And you can go printing receipts with basically any character set on them, just without image, correct spacing, or other luxuries :)
This is all on an Epson TM-T20II on Debian, but maybe it will also be useful in your setup. |
I try to run this script and want to print in terminal but it printed this levon@debian:/var/www/html/models/print_test/escpos-snippets/unifont-bitmap-font$ php unifont-example.php if it can't print in termianl I assume it wouldn't print in pos printer to. I change this
and this |
@levon1991 - The command I ran redirected that binary to Can you share some information about the type of printer you have, and how it is connected? I should be able to point you in the right direction if it's something common. |
Cuting head of text it's depend on type of printer or it's libery problem? |
@levon1991 Hello, did you solve the cut head problem? |
Hi Mike
When will you add support Armenian language?
I read about that in your forum
receipt-print-hq/escpos-printer-db#31
but it is 2 year ago.
The text was updated successfully, but these errors were encountered: