fitty icon indicating copy to clipboard operation
fitty copied to clipboard

Add container height as part of the calculation

Open tanc opened this issue 4 years ago • 8 comments

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

tanc avatar Jan 02 '21 18:01 tanc

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 avatar Jan 04 '21 19:01 rikschennink

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.

rikschennink avatar Mar 02 '21 09:03 rikschennink

@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

cwdott avatar May 13 '21 18:05 cwdott

@cwdott see my last reply.

rikschennink avatar May 17 '21 09:05 rikschennink

@cwdott see my last reply.

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

cwdott avatar May 17 '21 10:05 cwdott

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

rikschennink avatar May 17 '21 10:05 rikschennink