| |||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| I'll do it Technical Services | Calculations for tag cloud Hello, ![]() I have a problem Here is the scenario. There is a predefined width and height. Lets assume 200 x 400 Now I have some text which is like tag cloud. What I want to do it fit it as perfectly as possible into the 200x400 box. Issues: 1) Tags vary in length...... 2) Tags font size is also variant. 3) Wordwrap messes up the number of lines and thus messes up the height. I have been doing the calculations based on fontsize occupying the number of pixels and then deducting those pixels from the total area. Yet the randomness of the data which is fed to it is not allowing to get much accuracy. Some ideas would be appreciated. Thanks.
__________________ Vhuv|Delq|Fhur|Twut|Tluz|Kegh|Vhir|Juhy|Ruuz|Jyos|Jupt|Vhek Webmaster Blog | Software Downloads Sponsor Ads at SponAds.com |
| |
| | #2 (permalink) |
| DNOA Member | Might be easier to use Flash or something where you can morph the text...
__________________ codeboards A high-quality community of programmers -- Join today and post! We want new members! |
| |
| | #3 (permalink) |
| I'll do it Technical Services | I have came up with one algo for time being..... http://www.keralpatel.com/research/t...ght-in-pixels/ But I might improve it later.... Right now it is getting what it wanted
__________________ Vhuv|Delq|Fhur|Twut|Tluz|Kegh|Vhir|Juhy|Ruuz|Jyos|Jupt|Vhek Webmaster Blog | Software Downloads Sponsor Ads at SponAds.com |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |