Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support PT(PT-P750W) series label printer #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions brother_ql_web.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from PIL import Image, ImageDraw, ImageFont

from brother_ql.devicedependent import models, label_type_specs, label_sizes
from brother_ql.devicedependent import ENDLESS_LABEL, DIE_CUT_LABEL, ROUND_DIE_CUT_LABEL
from brother_ql.devicedependent import ENDLESS_LABEL, DIE_CUT_LABEL, ROUND_DIE_CUT_LABEL, PTOUCH_ENDLESS_LABEL
from brother_ql import BrotherQLRaster, create_label
from brother_ql.backends import backend_factory, guess_backend

Expand Down Expand Up @@ -192,7 +192,7 @@ def print_text():
im = create_label_im(**context)
if DEBUG: im.save('sample-out.png')

if context['kind'] == ENDLESS_LABEL:
if context['kind'] in (ENDLESS_LABEL, PTOUCH_ENDLESS_LABEL):
rotate = 0 if context['orientation'] == 'standard' else 90
elif context['kind'] in (ROUND_DIE_CUT_LABEL, DIE_CUT_LABEL):
rotate = 'auto'
Expand All @@ -201,7 +201,11 @@ def print_text():
red = False
if 'red' in context['label_size']:
red = True
create_label(qlr, im, context['label_size'], red=red, threshold=context['threshold'], cut=True, rotate=rotate)
compress = False
if CONFIG['PRINTER']['MODEL'] == 'PT-P750W':
compress = True

create_label(qlr, im, context['label_size'], red=red, threshold=context['threshold'], cut=True, rotate=rotate, compress=compress)

if not DEBUG:
try:
Expand Down
4 changes: 2 additions & 2 deletions views/labeldesigner.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
</select>
<label for="orientation" style="margin-top: 10px; margin-bottom: 0">Label Orientation:</label>
<div class="radio" style="margin-top: 5px;">
<label><input type="radio" onchange="preview()" name="orientation" value="standard" {% if default_orientation == 'standard' %}checked{% endif %}>Standard</label>
<label><input type="radio" onchange="preview()" name="orientation" value="standard" {% if label.DEFAULT_ORIENTATION == 'standard' %}checked{% endif %}>Standard</label>
</div>
<div class="radio">
<label><input type="radio" onchange="preview()" name="orientation" value="rotated" {% if default_orientation == 'rotated' %}checked{% endif %}>Rotated</label>
<label><input type="radio" onchange="preview()" name="orientation" value="rotated" {% if label.DEFAULT_ORIENTATION == 'rotated' %}checked{% endif %}>Rotated</label>
</div>
</div> <!-- class="chooser panel-body" -->
</div>
Expand Down