Revert "Add Chinese support"
This reverts commit 110200dde678a165062707e8ccb985c837ed6f68.
This commit is contained in:
parent
b1f677f64d
commit
3dc88794c2
@ -501,7 +501,7 @@ class Escpos(object):
|
||||
image = my_code.writer._image
|
||||
self.image(image, impl=impl)
|
||||
|
||||
def text(self, txt, chinese=False):
|
||||
def text(self, txt):
|
||||
""" Print alpha-numeric text
|
||||
|
||||
The text has to be encoded in the currently selected codepage.
|
||||
@ -510,14 +510,10 @@ class Escpos(object):
|
||||
:param txt: text to be printed
|
||||
:raises: :py:exc:`~escpos.exceptions.TextError`
|
||||
"""
|
||||
if chinese:
|
||||
txt = txt.encode('GB18030')
|
||||
self._raw(txt)
|
||||
else:
|
||||
txt = six.text_type(txt)
|
||||
self.magic.write(txt)
|
||||
|
||||
def textln(self, txt='', chinese=False):
|
||||
def textln(self, txt=''):
|
||||
"""Print alpha-numeric text with a newline
|
||||
|
||||
The text has to be encoded in the currently selected codepage.
|
||||
@ -526,7 +522,7 @@ class Escpos(object):
|
||||
:param txt: text to be printed with a newline
|
||||
:raises: :py:exc:`~escpos.exceptions.TextError`
|
||||
"""
|
||||
self.text('{}\n'.format(txt), chinese=chinese)
|
||||
self.text('{}\n'.format(txt))
|
||||
|
||||
def ln(self, count=1):
|
||||
"""Print a newline or more
|
||||
@ -539,7 +535,7 @@ class Escpos(object):
|
||||
if count > 0:
|
||||
self.text('\n' * count)
|
||||
|
||||
def block_text(self, txt, font=None, columns=None, chinese=False):
|
||||
def block_text(self, txt, font=None, columns=None):
|
||||
""" Text is printed wrapped to specified columns
|
||||
|
||||
Text has to be encoded in unicode.
|
||||
@ -550,7 +546,7 @@ class Escpos(object):
|
||||
:return: None
|
||||
"""
|
||||
col_count = self.profile.get_columns(font) if columns is None else columns
|
||||
self.text(textwrap.fill(txt, col_count), chinese=chinese)
|
||||
self.text(textwrap.fill(txt, col_count))
|
||||
|
||||
def set(self, align='left', font='a', bold=False, underline=0, width=1,
|
||||
height=1, density=9, invert=False, smooth=False, flip=False,
|
||||
|
Loading…
x
Reference in New Issue
Block a user