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

Font size auto-adjust #45

Open
ghost opened this issue Dec 30, 2015 · 3 comments
Open

Font size auto-adjust #45

ghost opened this issue Dec 30, 2015 · 3 comments

Comments

@ghost
Copy link

ghost commented Dec 30, 2015

I'd really like it if you could have text auto-adjust its font-size depending on the area you want to fit it in.

@crobi
Copy link
Owner

crobi commented Dec 31, 2015

That would be a very useful feature. Unfortunately, this can't be done with HTML/CSS alone. The only way to find the optimal font size is to keep generating cards with differing font sizes until the text fits.

There's libraries to do this (like flowtype or fittext), but I'm not sure how well these would work with a tool that generates static HTML. If you know a good library, feel free to post a pull request!

@garylzimmer
Copy link
Contributor

How about http://jquery-textfill.github.io/ ?

@crobi
Copy link
Owner

crobi commented Sep 29, 2016

Same as the above mentioned libraries, this one generates text with different font sizes until it fits. There's other libraries like http://danielhoffmann.github.io/jquery-bigtext/ that guess the optimal font size without rendering it repeatedly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants