Skip to content

Conversation

fra87
Copy link
Contributor

@fra87 fra87 commented Aug 26, 2023

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

@WhyNotHugo
Copy link
Owner

Needs rebase

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

fra87 commented Aug 27, 2025

Rebased on latest main

@WhyNotHugo
Copy link
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
Copy link
Contributor Author

fra87 commented Aug 28, 2025

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

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