Merge branch 'master' into add-slip-support
This commit is contained in:
commit
c2ec6051d7
1
.mailmap
1
.mailmap
@ -13,6 +13,7 @@ csoft2k <csoft2k@hotmail.com>
|
||||
Sergio Pulgarin <sergio.pulgarin@gmail.com>
|
||||
reck31 <rakesh.gunduka@gmail.com>
|
||||
Alex Debiasio <alex.debiasio@thinkin.io> <alex.debiasio@studenti.unitn.it>
|
||||
白月秋见心 <ourweijiang@gmail.com>
|
||||
Maximilian Wagenbach <maximilian.wagenbach@native-instruments.de>
|
||||
<belono@users.noreply.github.com> <tiotil.lindeman@gmail.com>
|
||||
belono <belono@users.noreply.github.com> Benito López <belono@users.noreply.github.com>
|
||||
|
1
AUTHORS
1
AUTHORS
@ -45,3 +45,4 @@ Thijs Triemstra
|
||||
Thomas van den Berg
|
||||
Yaisel Hurtado
|
||||
ysuolmai
|
||||
白月秋见心
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 3612db407d02a08acd93a1540f2b4823be3f020e
|
||||
Subproject commit 190a96db4b90425b99fbb4f034c04a36cf1c2bf7
|
@ -607,19 +607,16 @@ class Escpos(object):
|
||||
)
|
||||
)
|
||||
|
||||
# Render the barcode to a fake file
|
||||
# Render the barcode
|
||||
barcode_class = barcode.get_barcode_class(barcode_type)
|
||||
my_code = barcode_class(data, writer=image_writer)
|
||||
|
||||
with open(os.devnull, "wb") as nullfile:
|
||||
my_code.write(
|
||||
nullfile,
|
||||
{
|
||||
"module_height": module_height,
|
||||
"module_width": module_width,
|
||||
"text_distance": text_distance,
|
||||
},
|
||||
)
|
||||
my_code.render(
|
||||
writer_options={
|
||||
"module_height": module_height,
|
||||
"module_width": module_width,
|
||||
"text_distance": text_distance,
|
||||
}
|
||||
)
|
||||
|
||||
# Retrieve the Pillow image and print it
|
||||
image = my_code.writer._image
|
||||
|
@ -18,6 +18,7 @@ from .constants import CODEPAGE_CHANGE
|
||||
from .exceptions import Error
|
||||
from .codepages import CodePages
|
||||
import six
|
||||
import re
|
||||
|
||||
|
||||
class Encoder(object):
|
||||
@ -252,6 +253,10 @@ class MagicEncode(object):
|
||||
self.write_with_encoding(self.encoding, text)
|
||||
return
|
||||
|
||||
if re.findall(r"[\u4e00-\u9fa5]", text):
|
||||
self.driver._raw(text.encode("GB18030"))
|
||||
return
|
||||
|
||||
# See how far we can go into the text with the current encoding
|
||||
to_write, text = split_writable_text(self.encoder, text, self.encoding)
|
||||
if to_write:
|
||||
|
Loading…
x
Reference in New Issue
Block a user