From 159344852921967140b44de91e1eb717f23f6cde Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Thu, 8 Mar 2018 16:53:10 +0200 Subject: Implement print buffer and utf8 Now just raster modes and it's done. --- src/bin/escpos2raster.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/bin') diff --git a/src/bin/escpos2raster.c b/src/bin/escpos2raster.c index e4c9708..4eaafe1 100644 --- a/src/bin/escpos2raster.c +++ b/src/bin/escpos2raster.c @@ -54,16 +54,18 @@ int main(int argc, char *argv[]) { { -#define CANVAS_W 256 +#define CANVAS_W 267 * 2 #define CANVAS_H 1024 - char window[4096]; - uint8_t canvas_data[CANVAS_W * CANVAS_H]; + char window[4096], var[256]; + uint8_t canvas_data[CANVAS_W * CANVAS_H], print_buffer[CANVAS_W * ESCPOS_PRINT_BUFFER_MAX_HEIGHT]; struct parser p = { .parser = { .read = escpos_read, .write = escpos_write, .canvas = { .data = canvas_data, .w = CANVAS_W, .h = CANVAS_H }, - .window = { .data = window, sizeof(window) }, + .print_buffer = { .data = print_buffer, .w = CANVAS_W, .h = ESCPOS_PRINT_BUFFER_MAX_HEIGHT }, + .window = { .data = window, .len = sizeof(window) }, + .var = { .data = var, .len = sizeof(var) }, }, .input = (argc >= 2 ? fopen_or_die(argv[1], "rb") : stdin), .output = (argc >= 3 ? fopen_or_die(argv[2], "wb") : stdout), -- cgit v1.2.3-70-g09d2