Thanks for the tip!
its a pity there is no automatic way, since the length depends not
only on the number of letters, but on the chars use.
iiii
0000
these two strings have a length of 4, but the size of the second is
twice the first (on most fonts).
On the iPhone itself (Objective C) you can do something like this:
CGSize labelSize = [cellText sizeWithFont:cellFont
constrainedToSize:constraintSize
lineBreakMode:UILineBreakModeWordWrap];
to figure out the size of the text.
I was hoping to find the web-based version of this.
g.
On Apr 9, 9:06 am, Bruno Alexandre <[email protected]> wrote:
> you can always create your own method and call it at the end of the
> load.
>
> just do it by calculation:
>
> function reduceFontSize() [
> $("all my tags that I want to check").each( function(e) {
>
> var len = $(this).text().length;
> if( len > 30 ) $(this).attr("style", "font-size:12px");
> if( len >= 30 && len < 40 ) $(this).attr("style", "font-size:11px");
> if( len >= 40 && len < 50 ) $(this).attr("style", "font-size:10px");
>
> });
> }
>
> then apply it.
>
> reduceFontSize();
>
> Bruno Alexandre
> [web]www.balexandre.com
> [twitter]http://twitter.com/balexandre
>
> my Widgets for iPhone Web Development
> [iCal widget for jQTouch]http://code.google.com/p/jqtouch-ical/
--
You received this message because you are subscribed to the Google Groups
"iPhoneWebDev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/iphonewebdev?hl=en.