1
0
mirror of https://git.familie-radermacher.ch/linux/ptouch-print.git synced 2025-11-21 04:42:04 +00:00

prepare support for printers with other resolution than 180dpi

This commit is contained in:
Dominic Radermacher
2019-11-03 20:25:04 +01:00
parent badc152127
commit bc192e6e73
2 changed files with 34 additions and 27 deletions

View File

@@ -34,35 +34,36 @@
/* Print area width in 180 DPI pixels */
struct _pt_tape_info tape_info[]= {
{ 6, 32}, /* 6 mm tape */
{ 9, 52}, /* 9 mm tape */
{12, 76}, /* 12 mm tape */
{18, 120}, /* 18 mm tape */
{24, 128}, /* 24 mm tape */
{36, 192}, /* 36 mm tape */
{ 0, 0} /* terminating entry */
{ 6, 32, 1.0}, /* 6 mm tape */
{ 9, 52, 1.0}, /* 9 mm tape */
{12, 76, 2.0}, /* 12 mm tape */
{18, 120, 3.0}, /* 18 mm tape */
{24, 128, 3.0}, /* 24 mm tape */
{36, 192, 4.5}, /* 36 mm tape */
{ 0, 0, 0.0} /* terminating entry */
};
struct _pt_dev_info ptdevs[] = {
{0x04f9, 0x2007, "PT-2420PC", 128, FLAG_RASTER_PACKBITS}, /* 180dpi, 128px, maximum tape width 24mm, must send TIFF compressed pixel data */
{0x04f9, 0x202c, "PT-1230PC", 128, FLAG_NONE}, /* 180dpi, supports tapes up to 12mm - I don't know how much pixels it can print! */
{0x04f9, 0x2007, "PT-2420PC", 128, 180, FLAG_RASTER_PACKBITS}, /* 180dpi, 128px, maximum tape width 24mm, must send TIFF compressed pixel data */
{0x04f9, 0x202c, "PT-1230PC", 128, 180, FLAG_NONE}, /* 180dpi, supports tapes up to 12mm - I don't know how much pixels it can print! */
/* Notes about the PT-1230PC: While it is true that this printer supports
max 12mm tapes, it apparently expects > 76px data - the first 32px
must be blank. */
{0x04f9, 0x202d, "PT-2430PC", 128, FLAG_NONE}, /* 180dpi, maximum 128px */
{0x04f9, 0x2030, "PT-1230PC (PLite Mode)", 128, FLAG_PLITE},
{0x04f9, 0x2031, "PT-2430PC (PLite Mode)", 128, FLAG_PLITE},
{0x04f9, 0x2041, "PT-2730", 128, FLAG_NONE}, /* 180dpi, maximum 128px, max tape width 24mm - reported to work with some quirks */
{0x04f9, 0x202d, "PT-2430PC", 128, 180, FLAG_NONE}, /* 180dpi, maximum 128px */
{0x04f9, 0x2030, "PT-1230PC (PLite Mode)", 128, 180, FLAG_PLITE},
{0x04f9, 0x2031, "PT-2430PC (PLite Mode)", 128, 180, FLAG_PLITE},
{0x04f9, 0x2041, "PT-2730", 128, 180, FLAG_NONE}, /* 180dpi, maximum 128px, max tape width 24mm - reported to work with some quirks */
/* Notes about the PT-2730: was reported to need 48px whitespace
within png-images before content is actually printed - can not check this */
{0x04f9, 0x205f, "PT-E500", 128, FLAG_RASTER_PACKBITS},
{0x04f9, 0x205f, "PT-E500", 128, 180, FLAG_RASTER_PACKBITS},
/* Note about the PT-E500: was reported by Jesse Becker with the
remark that it also needs some padding (white pixels) */
{0x04f9, 0x2061, "PT-P700", 128, FLAG_RASTER_PACKBITS|FLAG_P700_INIT},
{0x04f9, 0x2064, "PT-P700 (PLite Mode)", 128, FLAG_PLITE},
{0x04f9, 0x2073, "PT-D450", 128, FLAG_RASTER_PACKBITS},
{0x04f9, 0x2061, "PT-P700", 128, 180, FLAG_RASTER_PACKBITS|FLAG_P700_INIT},
{0x04f9, 0x2064, "PT-P700 (PLite Mode)", 128, 180, FLAG_PLITE},
{0x04f9, 0x2073, "PT-D450", 128, 180, FLAG_RASTER_PACKBITS},
/* Notes about the PT-D450: I'm unsure if print width really is 128px */
{0,0,"",0,0}
//{0x04f9, 0x200d, "PT-3600", 384, 360, FLAG_RASTER_PACKBITS},
{0,0,"",0,0,0}
};
void ptouch_rawstatus(uint8_t raw[32]);
@@ -133,6 +134,7 @@ int ptouch_open(ptouch_dev *ptdev)
return -1;
}
(*ptdev)->h=handle;
(*ptdev)->devinfo->dpi=ptdevs[k].dpi;
(*ptdev)->devinfo->max_px=ptdevs[k].max_px;
(*ptdev)->devinfo->flags=ptdevs[k].flags;
return 0;