FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Fix size and text distance by fra87 · Pull Request #212 · WhyNotHugo/python-barcode · GitHub

Fix size and text distance - #212

Open
fra87 wants to merge 3 commits into
WhyNotHugo:mainfrom
fra87:fix_size_and_text_distance
Open

Fix size and text distance#212
fra87 wants to merge 3 commits into
WhyNotHugo:mainfrom
fra87:fix_size_and_text_distance

Conversation

fra87 commented Aug 26, 2023

Copy link
Copy Markdown
Contributor

I spotted two problems while writing a program:

  1. text_distance is not applied if guardbar is on
  2. the height calculation is not correct (it only accounts for half of the font width), and this caused the images being too short

I fixed the two issues in this PR

Copy link
Copy Markdown
Owner

Needs rebase

fra87 force-pushed the fix_size_and_text_distance branch from 8800b41 to 32cb16f Compare August 27, 2025 20:59

fra87 commented Aug 27, 2025

Copy link
Copy Markdown
Contributor Author

Rebased on latest main

Copy link
Copy Markdown
Owner

the height calculation is not correct (it only accounts for half of the font width), and this caused the images being too short

Do you have an example that reproduces this problem?

I tried python-barcode create "123456789000" outfile -b ean --text "hello there", and the height is correct, the text fit fully.

Also tried generating a PNG (with pillow installed) with python-barcode create "123456789000" outfile -b ean --text "hello there" --type png. Text also fits fine.

fra87 commented Aug 28, 2025

Copy link
Copy Markdown
Contributor Author

I'll try to get something in the next days. Honestly I don't have the build system ready anymore since it was a small project of mine done 2 years ago, but I'll try to reproduce it with a simple example and write it here

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL