Skip to content
This repository was archived by the owner on Mar 23, 2025. It is now read-only.

Conversation

gabrielgrant
Copy link
Contributor

@gabrielgrant gabrielgrant commented Jul 20, 2020

this class centers each line, rather than left-aligning. this allows for different sized lines of text to be centered together, for example

for a single text object spanning multiple lines, (eg if printing on a vertically-oriented label) it may make more sense to use an approach like this: https://gist.github.com/turicas/1455973

pos[1] += max(i.size[1] for i in line)

xdim, ydim = img.size
print("presize", xdim, ydim, height)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume you forgot you left these debug prints in

print("presize", xdim, ydim, height)
xdim = round((height / ydim) * xdim)

print("calcsize", xdim, ydim)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one too

@gabrielgrant
Copy link
Contributor Author

Ah, good catch(es). I had actually just copied most of the contents of that method (including those debug print statements) from the original Label class:

print("presize", xdim, ydim, height)
xdim = round((height / ydim) * xdim)
print("calcsize", xdim, ydim)

The new commit changes all of them over to debug logger statements

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants