Skip to content

Commit 12148e1

Browse files
authored
Skip rendering text when font size would be zero (#218)
Refs #217
1 parent 6591846 commit 12148e1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

barcode/writer.py

+2
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,8 @@ def _paint_module(self, xpos, ypos, width, color):
448448

449449
def _paint_text(self, xpos, ypos):
450450
font_size = int(mm2px(pt2mm(self.font_size), self.dpi))
451+
if font_size <= 0:
452+
return
451453
font = ImageFont.truetype(self.font_path, font_size)
452454
for subtext in self.text.split("\n"):
453455
pos = (

0 commit comments

Comments
 (0)