From 6b2096cea7d6ee1dfe139c612fe8d78d355eec3a Mon Sep 17 00:00:00 2001 From: Dominic Radermacher Date: Thu, 28 Mar 2019 16:10:54 +0100 Subject: [PATCH] generate the cutmark as image instead of ptouch-commands, so it can be saved as png, too --- include/ptouch.h | 1 - src/libptouch.c | 28 ---------------------------- src/ptouch-print.c | 26 +++++++++++++++++++++++++- 3 files changed, 25 insertions(+), 30 deletions(-) diff --git a/include/ptouch.h b/include/ptouch.h index 41ddc05..b1cc7ad 100644 --- a/include/ptouch.h +++ b/include/ptouch.h @@ -81,7 +81,6 @@ int ptouch_send(ptouch_dev ptdev, uint8_t *data, int len); int ptouch_init(ptouch_dev ptdev); int ptouch_lf(ptouch_dev ptdev); int ptouch_ff(ptouch_dev ptdev); -int ptouch_cutmark(ptouch_dev ptdev); int ptouch_eject(ptouch_dev ptdev); int ptouch_getstatus(ptouch_dev ptdev); int ptouch_getmaxwidth(ptouch_dev ptdev); diff --git a/src/libptouch.c b/src/libptouch.c index cedbec8..7883a12 100644 --- a/src/libptouch.c +++ b/src/libptouch.c @@ -189,34 +189,6 @@ int ptouch_eject(ptouch_dev ptdev) return ptouch_send(ptdev, (uint8_t *)cmd, strlen(cmd)); } -/* print a "cut here" mark (it's just a dashed line) */ -#define CUTMARK_SPACING 5 -int ptouch_cutmark(ptouch_dev ptdev) -{ - uint8_t buf[32]; - int i,len=16; - - for (i=0; i\n", progname); @@ -442,7 +464,9 @@ int main(int argc, char *argv[]) gdImageDestroy(im); } } else if (strcmp(&argv[i][1], "-cutmark") == 0) { - ptouch_cutmark(ptdev); + im=img_cutmark(tape_width); + out=img_append(out, im); + gdImageDestroy(im); } else { usage(argv[0]); }