davatron5000 / FitText.js

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

error in code and EM use #51

Closed photoman closed 11 years ago

photoman commented 11 years ago

The sampe code shows: minFontSize: 50, maxFontSize: '75px'

but the documentation shows:

minFontSize: '20px', maxFontSize: '40px'

As for EM use -- can the "000px" be replace with "000em"

Thanks.

sushantchavan commented 11 years ago

on using em in minFontSize and maxFontSize, the browser still considers it as px.

davatron5000 commented 11 years ago

This issue was fixed in e291b8acaed29c8b9eb5c46d44133b29f3fce8b3

@sushantchavan - Right now FitText only supports px values. If you'd like to use Em values, then you'll need to Bring Your Own em-calculator. It could be simple or complex. Here's an example of how I'd calculate things on the fly:

$('.mything').fitText(1, { 
  minFontSize: $('body').css('font-size'),
  maxFontSize: $('body').css('font-size') * 2
}