center_text=False cuts off text at left when justifying barcode text in SVG output #145
Labels
No labels
api-inconsistency
automerge
bug
contributions welcome
documentation
duplicate
enhancement
good first issue
invalid
more-information-needed
question
sync
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
WhyNotHugo/python-barcode#145
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Barcode version: 0.13.1-py3
Python version: 3.7.3 (64 bit)
Platform: Windows 10 (20H2)
If the
center_text=Falseoption is used when writing a code128 (and possibly others) barcode in SVG format, the text under the barcode is justified beyond the left of the SVG. It appears that the justification is based on the center of the the SVG text, rather than its left edge.I am using this in an application that embeds these SVG images within a table in a webpage, and for the same code (97660) they appear as below:

A simplified extract of the code section being used to generate the SVG is below, however it uses the same writer options as my production code. I suspect that changes to the
quiet_zoneoption are not being accounted for in text positioning.Looked at the code. I see
quiet_zoneappears to be accounted for after all.Also in case it's relevant. browser is Chrome.