-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Space filling #4
Conversation
Untitled.ipynb
Outdated
@@ -0,0 +1,561 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, maybe notebooks shouldn't be added to the repo (and in fact even added to .gitignore?)
@@ -34,8 +34,8 @@ def draw_text(canvas, img, rectangle, word, font, rotate=False): | |||
text_draw.text((0, 0), word, font=font, fill=FONT_COLOR) | |||
rotated_text_image = text_image.rotate(90, expand=True) | |||
img.paste(rotated_text_image, rectangle.xy) | |||
# canvas.rectangle(rectangle.corners) | |||
# canvas.rectangle(rectangle.xyrb) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if you merge my other PR this will simplify
EDIT: I take that back, I think this just shows up because it's not rebased, so nothing to be doen here.
pyproject.toml
Outdated
@@ -9,6 +9,7 @@ readme = "README.md" | |||
[tool.poetry.dependencies] | |||
python = "^3.9" | |||
pillow = "^10.4.0" | |||
numpy = "^2.0.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we talked about already - I think this is too heavyweight :)
@@ -47,9 +47,151 @@ def __repr__(self): | |||
return f"Rectangle(x={int(self.x)} y={int(self.y)} w={int(self.width)} h={int(self.height)})" | |||
|
|||
|
|||
def fill_remaining_space( | |||
def fill_remaining_space_horizontal( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you remove this in the previous commit, and re-add it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mayyyybe
I had removed it, but then the filling around the words tended to make too many long narrow rectangles, so I decided to keep the old way and then only use the text filling in the text_rectangle
wrdcld/font.py
Outdated
@@ -26,8 +26,12 @@ def find_fontsize_for_width(width, word): | |||
|
|||
|
|||
def draw_text(canvas, img, rectangle, word, font, rotate=False): | |||
""" | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good talk
No description provided.