Fri, 25 Sep 2009 10:50:44 +0100
added dots-per-inch to status readback
src/ptouch.c | file | annotate | diff | revisions | |
src/ptouch.h | file | annotate | diff | revisions |
1.1 --- a/src/ptouch.c Thu Sep 24 22:29:12 2009 +0100 1.2 +++ b/src/ptouch.c Fri Sep 25 10:50:44 2009 +0100 1.3 @@ -115,6 +115,10 @@ 1.4 dev->phaseLo = buf[21]; 1.5 dev->notification = buf[22]; 1.6 1.7 + // Set DPI 1.8 + dev->dpiPrinthead = 180; 1.9 + dev->dpiLabel = 180; 1.10 + 1.11 // Set pixel width (label width in pixels) 1.12 if (dev->mediaWidth >= 24) { 1.13 // Label tape is 24mm or wider. Print head is 128 dots at 180dpi, 1.14 @@ -127,7 +131,7 @@ 1.15 // floating point to convert from inches to mm. The -2 is a 1.16 // safety margin -- one pixel on either side of the label. 1.17 // This is far closer than Brother suggest, but hey-ho. 1.18 - dev->pixelWidth = ((dev->mediaWidth * 180 * 10) / 254) - 2; 1.19 + dev->pixelWidth = ((dev->mediaWidth * dev->dpiPrinthead * 10) / 254) - 2; 1.20 } 1.21 1.22 // Operation succeeded
2.1 --- a/src/ptouch.h Thu Sep 24 22:29:12 2009 +0100 2.2 +++ b/src/ptouch.h Fri Sep 25 10:50:44 2009 +0100 2.3 @@ -46,6 +46,11 @@ 2.4 /// Notification number 2.5 int notification; 2.6 2.7 + /// Dots per inch -- print head 2.8 + int dpiPrinthead; 2.9 + /// Dots per inch -- "label length" direction 2.10 + int dpiLabel; 2.11 + 2.12 /// Print parameter: autocutter enable 2.13 int autocut; 2.14 /// Print parameter: mirror printing enable