Skip to content
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

Merged
merged 13 commits into from
Aug 14, 2024
Merged

Space filling #4

merged 13 commits into from
Aug 14, 2024

Conversation

jimbarrett27
Copy link
Owner

No description provided.

@jimbarrett27 jimbarrett27 requested a review from naslundx August 13, 2024 20:39
Untitled.ipynb Outdated
@@ -0,0 +1,561 @@
{
Copy link
Collaborator

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)
Copy link
Collaborator

@naslundx naslundx Aug 14, 2024

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"
Copy link
Collaborator

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(
Copy link
Collaborator

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?

Copy link
Owner Author

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):
"""

Copy link
Collaborator

Choose a reason for hiding this comment

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

Good talk

@jimbarrett27 jimbarrett27 merged commit 2a1625b into main Aug 14, 2024
1 check passed
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