davatron5000 / FitText.js

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

working with fontawesome? #42

Closed ghost closed 11 years ago

ghost commented 11 years ago

I would like to work with fontawesome icons, but have a hard time with it.

Should it work like any other font ? Will it make difference that fontawesome uses ?

Thanks

davatron5000 commented 11 years ago

Do you have a reduced test case you can supply? Something like http://codepen.io or http://jsbin.com? This helps me debug and see what you're doing.

ghost commented 11 years ago

Well by the time I created an example online, and clean up all the code, it seems to work fine but if I have 2 instance of fontawesome it seems to break the fitText. Not really a problem for my site but it might be something to consider:

http://www.ponnuki.net/font_test/garry/test.html

davatron5000 commented 11 years ago

Hrm... it looks like you have 2 elements with the ID of #fittext1 (the icon and the first H1).

Then, it probably doesn't have a width because .icon-camera-retro is an inline-block so it technically doesn't have a width. Gets a little complicated from there. But I suppose the best thing you could do is target only block elements or the fontawesome parent element.

ghost commented 11 years ago

Yes I see that now - to use one one id per target and to target the parent element! all working now (not the test page anyhow)

Thanks!