Merge lp:~philpem/ubuntu/trusty/ptouch-driver/fix-esc-i-a-for-pt-series into lp:ubuntu/trusty/ptouch-driver

Proposed by Phil Pemberton
Status: Merged
Merge reported by: Sebastien Bacher
Merged at revision: not available
Proposed branch: lp:~philpem/ubuntu/trusty/ptouch-driver/fix-esc-i-a-for-pt-series
Merge into: lp:ubuntu/trusty/ptouch-driver
Diff against target: 77 lines (+58/-0)
3 files modified
debian/changelog (+7/-0)
debian/patches/send-esc-i-A-for-QL-only.patch (+50/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp:~philpem/ubuntu/trusty/ptouch-driver/fix-esc-i-a-for-pt-series
Reviewer Review Type Date Requested Status
Till Kamppeter (community) Approve
Ubuntu branches Pending
Review via email: mp+209351@code.launchpad.net

Description of the change

The rastertoptch filter includes a patch which sends the "ESC i A" (enable cutter) command to any printer which uses this filter. Sadly, this command is only supported on the QL series, so this patch has the effect of breaking printing on most of Brother's P-Touch line (the entire "PT" series).

This branch includes a patch which modifies the code to check the printer command language which is in use. If it is anything other than "ULP" (the QL-series command set), the aforementioned command will not be sent.

To post a comment you must log in.
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Patch itself is OK (same as attached to https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=740789), I suggest to add "(Closes: #740789, LP: #1287971)" to debian/changelog to auto-close the bug reports.

review: Approve
Revision history for this message
Sebastien Bacher (seb128) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2013-09-12 21:32:52 +0000
3+++ debian/changelog 2014-03-04 23:18:29 +0000
4@@ -1,3 +1,10 @@
5+ptouch-driver (1.3-7ubuntu1) UNRELEASED; urgency=low
6+
7+ * Add send-esc-i-A-for-QL-only.patch which prevents rastertoptch from
8+ sending the "ESC i A" command to printers which do not support it.
9+
10+ -- Philip Pemberton <philpem@philpem.me.uk> Tue, 04 Mar 2014 23:04:13 +0000
11+
12 ptouch-driver (1.3-7) unstable; urgency=low
13
14 * Rebuild against pyppd >= 1.0.1
15
16=== added file 'debian/patches/send-esc-i-A-for-QL-only.patch'
17--- debian/patches/send-esc-i-A-for-QL-only.patch 1970-01-01 00:00:00 +0000
18+++ debian/patches/send-esc-i-A-for-QL-only.patch 2014-03-04 23:18:29 +0000
19@@ -0,0 +1,50 @@
20+Index: ptouch-driver/rastertoptch.c
21+===================================================================
22+--- ptouch-driver.orig/rastertoptch.c 2014-03-04 22:51:59.000000000 +0000
23++++ ptouch-driver/rastertoptch.c 2014-03-04 22:59:53.000000000 +0000
24+@@ -685,7 +685,8 @@
25+ inline void
26+ emit_feed_cut_mirror (bool do_feed, unsigned feed,
27+ bool do_cut,
28+- bool do_mirror) {
29++ bool do_mirror,
30++ xfer_t xfer_mode) {
31+ /* Determine feed nibble */
32+ unsigned feed_nibble;
33+ if (do_feed) {
34+@@ -698,7 +699,14 @@
35+ /* Determine mirror print bit*/
36+ unsigned char mirror_bit = do_mirror ? 0x80 : 0x00;
37+ /* Combine & emit printer command code */
38+- putchar (ESC); putchar ('i'); putchar ('A'); putchar ((char) (do_cut ? 0x01 : 0x00));
39++ if (xfer_mode == ULP) {
40++ /* ESC i A is Enable Cutter -- used for QL-560 only, according to
41++ * <http://www.undocprint.org/formats/page_description_languages/brother_p-touch>
42++ * The QL-560 (actually the whole QL series) uses ULP mode, so we check for that.
43++ * The PT2450DX uses RLE and throw an INTERFACE ERROR if it sees this command.
44++ */
45++ putchar (ESC); putchar ('i'); putchar ('A'); putchar ((char) (do_cut ? 0x01 : 0x00));
46++ }
47+ putchar (ESC); putchar ('i'); putchar ('M');
48+ putchar ((char) (feed & 0x1f) | auto_cut_bit | mirror_bit);
49+ }
50+@@ -807,7 +815,8 @@
51+ /* We only know how to feed after each page */
52+ emit_feed_cut_mirror (perform_feed == CUPS_ADVANCE_PAGE, feed,
53+ cut_media == CUPS_CUT_PAGE,
54+- mirror == CUPS_TRUE);
55++ mirror == CUPS_TRUE,
56++ job_options->pixel_xfer == ULP);
57+ /* Set media and quality if label preamble is requested */
58+ unsigned page_size_y = new_page_options->page_size [1];
59+ unsigned image_height_px = lrint (page_size_y * vres / 72.0);
60+@@ -1527,7 +1536,8 @@
61+ perform_feed == CUPS_ADVANCE_JOB,
62+ new_page_options->feed,
63+ cut_media == CUPS_CUT_PAGE || cut_media == CUPS_CUT_JOB,
64+- new_page_options->mirror == CUPS_TRUE);
65++ new_page_options->mirror == CUPS_TRUE,
66++ job_options->pixel_xfer);
67+ /* Emit eject marker */
68+ putchar (PTC_EJECT);
69+ }
70
71=== modified file 'debian/patches/series'
72--- debian/patches/series 2010-09-13 10:00:00 +0000
73+++ debian/patches/series 2014-03-04 23:18:29 +0000
74@@ -1,2 +1,3 @@
75 foomatic-data-fixes.patch
76 send-esc-i-A.patch
77+send-esc-i-A-for-QL-only.patch

Subscribers

People subscribed via source and target branches