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