def set(self, align='<STR_LIT:left>', font='<STR_LIT:a>', bold=False, underline=<NUM_LIT:0>, width=<NUM_LIT:1>,<EOL>height=<NUM_LIT:1>, density=<NUM_LIT:9>, invert=False, smooth=False, flip=False,<EOL>double_width=False, double_height=False, custom_size=False):
if custom_size:<EOL><INDENT>if <NUM_LIT:1> <= width <= <NUM_LIT:8> and <NUM_LIT:1> <= height <= <NUM_LIT:8> and isinstance(width, int) andisinstance(height, int):<EOL><INDENT>size_byte = TXT_STYLE['<STR_LIT:width>'][width] + TXT_STYLE['<STR_LIT>'][height]<EOL>self._raw(TXT_SIZE + six.int2byte(size_byte))<EOL><DEDENT>else:<EOL><INDENT>raise SetVariableError()<EOL><DEDENT><DEDENT>else:<EOL><INDENT>self._raw(TXT_NORMAL)<EOL>if double_width and double_height:<EOL><INDENT>self._raw(TXT_STYLE['<STR_LIT:size>']['<STR_LIT>'])<EOL><DEDENT>elif double_width:<EOL><INDENT>self._raw(TXT_STYLE['<STR_LIT:size>']['<STR_LIT>'])<EOL><DEDENT>elif double_height:<EOL><INDENT>self._raw(TXT_STYLE['<STR_LIT:size>']['<STR_LIT>'])<EOL><DEDENT>else:<EOL><INDENT>self._raw(TXT_STYLE['<STR_LIT:size>']['<STR_LIT>'])<EOL><DEDENT><DEDENT>self._raw(TXT_STYLE['<STR_LIT>'][flip])<EOL>self._raw(TXT_STYLE['<STR_LIT>'][smooth])<EOL>self._raw(TXT_STYLE['<STR_LIT>'][bold])<EOL>self._raw(TXT_STYLE['<STR_LIT>'][underline])<EOL>self._raw(SET_FONT(six.int2byte(self.profile.get_font(font))))<EOL>self._raw(TXT_STYLE['<STR_LIT>'][align])<EOL>if density != <NUM_LIT:9>:<EOL><INDENT>self._raw(TXT_STYLE['<STR_LIT>'][density])<EOL><DEDENT>self._raw(TXT_STYLE['<STR_LIT>'][invert])<EOL>
Set text properties by sending them to the printer

        :param align: horizontal position for text, possible values are:

            * 'center'
            * 'left'
            * 'right'

            *default*: 'left'

        :param font: font given as an index, a name, or one of the
            special values 'a' or 'b', referring to fonts 0 and 1.
        :param bold: text in bold, *default*: False
        :param underline: underline mode for text, decimal range 0-2,  *default*: 0
        :param double_height: doubles the height of the text
        :param double_width: doubles the width of the text
        :param custom_size: uses custom size specified by width and height
            parameters. Cannot be used with double_width or double_height.
        :param width: text width multiplier when custom_size is used, decimal range 1-8,  *default*: 1
        :param height: text height multiplier when custom_size is used, decimal range 1-8, *default*: 1
        :param density: print density, value from 0-8, if something else is supplied the density remains unchanged
        :param invert: True enables white on black printing, *default*: False
        :param smooth: True enables text smoothing. Effective on 4x4 size text and larger, *default*: False
        :param flip: True enables upside-down printing, *default*: False

        :type font: str
        :type invert: bool
        :type bold: bool
        :type underline: bool
        :type smooth: bool
        :type flip: bool
        :type custom_size: bool
        :type double_width: bool
        :type double_height: bool
        :type align: str
        :type width: int
        :type height: int
        :type density: int