Skip to content

Fix TextBox line height type#34

Merged
simonhamp merged 2 commits intosimonhamp:mainfrom
nicoverbruggen:main
Mar 11, 2025
Merged

Fix TextBox line height type#34
simonhamp merged 2 commits intosimonhamp:mainfrom
nicoverbruggen:main

Conversation

@nicoverbruggen
Copy link
Copy Markdown
Contributor

@nicoverbruggen nicoverbruggen commented Mar 11, 2025

\Intervention\Image\Typography\FontFactory lets you call lineHeight with a float for more line height flexibility. Currently, the package only lets you provide a custom line height as an int. Since the default value is 1.6, this seems like an oversight.

This fix lets you set it to e.g. 1.8, which may be better if you are using a custom font or want to have more granular control over the layout that is being rendered, which is my own use case.

(Unsure why one of the tests fails, by the way. Runs fine locally, but guessing it's because you're doing some HTTP requests that may not work correctly on one of the runners here?)

\Intervention\Image\Typography\FontFactory lets you call `lineHeight`
with a float for more line height options. Currently, the package
only lets you provide a custom line height as an int.

Since the default value is 1.6, this fix lets you set it to e.g. 1.8,
which may be better if you are using a custom font or want to have
more granular control over the layout that is being rendered.
@simonhamp
Copy link
Copy Markdown
Owner

@nicoverbruggen looks like this changes some images generated during the tests and now they don't match the snapshots. Could you update the snapshots and commit them?

@nicoverbruggen
Copy link
Copy Markdown
Contributor Author

nicoverbruggen commented Mar 11, 2025

@simonhamp Shouldn't all of the checks for all of the PHP versions fail if that's the case? If I run the tests locally everything passes on my end!

(Edit: Since I'm running this on PHP 8.4 I've also added that version to the test matrix.)

@simonhamp
Copy link
Copy Markdown
Owner

You're right. I just looked at those failures and can see it's something else... not sure what

Copy link
Copy Markdown
Owner

@simonhamp simonhamp left a comment

Choose a reason for hiding this comment

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

Well, they all passed this time 🤷🏼

@simonhamp simonhamp merged commit 82236ea into simonhamp:main Mar 11, 2025
6 checks passed
@kevindierkx
Copy link
Copy Markdown
Contributor

@simonhamp This is the same snapshot that fails for #33

For whatever reason the snapshot uses a variant of the Cover placement, but the test essentially renders it with the default background placement of Repeat.

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.

3 participants