sorccu/cufon — pull request #237 by sang-yup (2012-03-22 05:21:12+00:00)
Title: Prevent occurring of 'invalid argument' error in IE7&8

'invalid argument' error's occurred when the converted shape width is NaN.

following part of code has been changed.

Size: function(value, base) {

this.value = parseFloat(value);
this.unit = String(value).match(/[a-z%]*$/)[0] || 'px';

this.convert = function(value) {
return (base * this.value != 0) ? value / base * this.value : 0; //originally 'return value / base * this.value';
};

this.convertFrom = function(value) {
return (this.value * base != 0) ? value / this.value * base : 0; // similar to above
};

this.toString = function() {
return this.value + this.unit;
};

},