rpg-cards
rpg-cards copied to clipboard
Font size auto-adjust
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.
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!
How about http://jquery-textfill.github.io/ ?
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.