@@ -353,10 +353,10 @@ def set_defaults(self):
353
353
self .double_width = False
354
354
self .strike = False
355
355
self .bold = False
356
- self .set_line_height (30 )
357
- self .set_barcode_height (50 )
358
- self .set_charset ()
359
- self .set_code_page ()
356
+ self ._set_line_height (30 )
357
+ self ._set_barcode_height (50 )
358
+ self ._set_charset ()
359
+ self ._set_code_page ()
360
360
361
361
def justify_left (self ):
362
362
"""Set left justification of text."""
@@ -470,7 +470,7 @@ def has_paper(self):
470
470
return False
471
471
return not status [0 ] & 0b00000100
472
472
473
- def set_line_height (self , height ):
473
+ def _set_line_height (self , height ):
474
474
"""Set the line height in pixels. This is the total amount of space
475
475
between lines, including the height of text. The smallest value is 24
476
476
and the largest is 255.
@@ -479,34 +479,28 @@ def set_line_height(self, height):
479
479
self ._line_spacing = height - 24
480
480
self .send_command ('\x1B 3{0}' .format (chr (height ))) # ESC + '3' + height
481
481
482
- def set_barcode_height (self , height ):
482
+ def _set_barcode_height (self , height ):
483
483
"""Set the barcode height in pixels. Must be a value 1 - 255."""
484
484
assert 1 <= height <= 255
485
485
self ._barcode_height = height
486
486
self .send_command ('\x1D h{0}' .format (chr (height ))) # ASCII GS + 'h' + height
487
487
488
- def set_charset (self , charset = 0 ):
488
+ def _set_charset (self , charset = 0 ):
489
489
"""Alters the character set for ASCII characters 0x23-0x7E. See
490
490
datasheet for details on character set values (0-15). Note this is only
491
491
supported on more recent firmware printers!
492
492
"""
493
493
assert 0 <= charset <= 15
494
494
self .send_command ('\x1B R{0}' .format (chr (charset ))) # ESC + 'R' + charset
495
495
496
- def set_code_page (self , code_page = 0 ):
496
+ def _set_code_page (self , code_page = 0 ):
497
497
"""Select alternate code page for upper ASCII symbols 0x80-0xFF. See
498
498
datasheet for code page values (0 - 47). Note this is only supported
499
499
on more recent firmware printers!
500
500
"""
501
501
assert 0 <= code_page <= 47
502
502
self .send_command ('\x1B t{0}' .format (chr (code_page ))) # ESC + 't' + code page
503
503
504
- def set_char_spacing (self , spacing = 0 ):
505
- """Set the character spacing (in pixels). Note this is only supported
506
- on more recent firmware printers!"""
507
- assert 0 <= spacing <= 255
508
- self .send_command ('\x1B {0}' .format (chr (spacing ))) # ESC + ' ' + spacing
509
-
510
504
def tab (self ):
511
505
"""Print a tab (i.e. move to next 4 character block). Note this is
512
506
only supported on more recent firmware printers!"""
0 commit comments