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

Add container height as part of the calculation #69

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from

Conversation

tanc
Copy link

@tanc tanc commented Jan 2, 2021

Restrict by height as well as width when calculating the font size to ensure fonts fit within a container, for example when rotated or using a top to bottom language.

This limit may not be what the majority of users want so a possible update could be to add an option to restrict by height and width, only width or only height.

Closes #9

Codesandbox: https://codesandbox.io/s/fitty-horizontal-vertical-wq7qn

Restrict by height as well as width when calculating
@rikschennink
Copy link
Owner

Thanks, I'll try to look into this as soon as possible but I'm swamped with other work right now, hope to have some more time in february.

@rikschennink
Copy link
Owner

Appreciate the PR, but I've decided to leave this out for now, as I feel it's probably not what most devs need, if that changes then I'll reconsider. Will leave open.

@cwdott
Copy link

cwdott commented May 13, 2021

@rikschennink as per issue #9 there appears to be longstanding interest in functionality to scale text by the parent container's vertical size. This PR seems to address that issue, and would meet the needs of all those other devs. I'd like to also add my voice to this, and encourage you to reconsider merging this PR

@rikschennink
Copy link
Owner

@cwdott see my last reply.

@cwdott
Copy link

cwdott commented May 17, 2021

@cwdott see my last reply.

From 3 months ago, just above mine? That's the one I was addressing in my comment 😊

@rikschennink
Copy link
Owner

rikschennink commented May 17, 2021

@cwdott see my last reply.

From 3 months ago, just above mine? That's the one I was addressing in my comment 😊

No, I mean in #9 :)

shulhi added a commit to usestencil/fitty that referenced this pull request Dec 19, 2022
@sean-mcl
Copy link

Thanks for this PR, really appreciate it. Its exactly what I needed.

Maybe we can integrate it into the main branch, but disable it per default to prevent breaking changes. Would be nice!

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.

Fit to container height
5 participants