Skip to content

Commit

Permalink
Fix text position
Browse files Browse the repository at this point in the history
With the anchor ms (middle baseline) the text is not exactly at the same
position than before. I changed it to md (middle descender) to have the
same position.
See
https://pillow.readthedocs.io/en/stable/handbook/text-anchors.html#text-anchors
  • Loading branch information
brvoisin committed Aug 4, 2022
1 parent 53b5235 commit e1de637
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion barcode/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ def _paint_text(self, xpos, ypos):
mm2px(ypos, self.dpi),
)
self._draw.text(
pos, subtext, font=font, fill=self.foreground, anchor="ms"
pos, subtext, font=font, fill=self.foreground, anchor="md"
)
ypos += pt2mm(self.font_size) / 2 + self.text_line_distance

Expand Down

0 comments on commit e1de637

Please sign in to comment.