davatron5000 / FitText.js

A jQuery plugin for inflating web type
http://fittextjs.com
6.76k stars 1.39k forks source link

allow flexible text length #80

Open ericdum opened 11 years ago

ericdum commented 11 years ago

no matter what the text is, do fitText(), it's will fit to 100% width automatticly

davatron5000 commented 11 years ago

Can you better describe the problem you're trying to fix? Also, we now require educed test cases. It looks like you're just injecting a bunch of CSS that may or may not be necessary.

ericdum commented 11 years ago

Please take a look the example.html.

I just added a longer text:

<h1 id="fittext4">Squeeze with FitText For Long String</h1>

And execute following code:

$("#fittext4").fitText();

Before this version, the text will break the line.

This version will automatically fit the width.

Just put it on the browser and check it out.

dominikwilkowski commented 10 years ago

:+1: I was looking for this. Thanks

davatron5000 commented 10 years ago

FitText was designed to work with multiple lines of text. So I'm not really sure that this fits that use case. Maybe putting this functionality behind a noBreak: true option is something to consider.