zprinter.py
def print_title(self, text_list, override_exit=False):
        """ Print maximum size text on a label.
        """
        if type(text_list) == str:
            text_list = [text_list]

        font_size = 5
        for i, string in enumerate(text_list, start=1):

            # Crop text to what will fit on the label
            character = Text("C", font_size=font_size)
            string = string[:int(self.label.width_dot / character.width_dot)]

            objText = Text(string, font_size=font_size)

            # Position the title in the centre
            xpos, ypos = self.align(objText, x_align="centre", y_align="middle")

            self.commander.encode_text(objText.text,
                                       start_x=xpos, start_y=ypos,
                                       font_size=objText.font_size)
            self.commander.next_label()

        # If next_label has not been issued 'self.columns' times, then
        # force the printer to move to the next row.
        if not override_exit and i % self.columns != 0:
            self.commander.encode_print_label()
            self.commander.send_command()
 Print maximum size text on a label.
        
Print maximum size text on a label.
Print maximum size text on a label .
def print_title(self, text_list, override_exit=False):
        if type(text_list) == str:
            text_list = [text_list]
        font_size = 5
        for i, string in enumerate(text_list, start=1):
            character = Text("C", font_size=font_size)
            string = string[:int(self.label.width_dot / character.width_dot)]
            objText = Text(string, font_size=font_size)
            xpos, ypos = self.align(objText, x_align="centre", y_align="middle")
            self.commander.encode_text(objText.text,
                                       start_x=xpos, start_y=ypos,
                                       font_size=objText.font_size)
            self.commander.next_label()
        if not override_exit and i % self.columns != 0:
            self.commander.encode_print_label()
            self.commander.send_command()
def print_title ( self , text_list , override_exit = False ) : if type ( text_list ) == str : text_list = [ text_list ] font_size = 5 for i , string in enumerate ( text_list , start = 1 ) : character = Text ( "C" , font_size = font_size ) string = string [ : int ( self . label . width_dot / character . width_dot ) ] objText = Text ( string , font_size = font_size ) xpos , ypos = self . align ( objText , x_align = "centre" , y_align = "middle" ) self . commander . encode_text ( objText . text , start_x = xpos , start_y = ypos , font_size = objText . font_size ) self . commander . next_label ( ) if not override_exit and i % self . columns != 0 : self . commander . encode_print_label ( ) self . commander . send_command ( )
Print maximum size text on a label.
Print maximum size text on a label .
""" Print maximum size text on a label.
        """ # Crop text to what will fit on the label # Position the title in the centre # If next_label has not been issued 'self.columns' times, then # force the printer to move to the next row.
self
text_list
override_exit