Opened 15 years ago
Closed 11 years ago
#11727 closed enhancement (wontfix)
Tag cloud widget - font size
Reported by: | tin68 | Owned by: | nacin |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.9.1 |
Component: | Widgets | Keywords: | |
Focuses: | Cc: |
Description
Hi
Not really a bug - but more a question.
The tag cloud widget displays the tags with different font sizes - this works correctly on my blog.
But I don't understand and I think it doesn't make sense to set the font-size with a decimal number:
eg. of HTML code
style='font-size: 9.3582089552239pt;'
An integer value of 8 to 22 should be correct in my opinion.
Change History (9)
#2
@
15 years ago
But tag cloud is using not "em" but "pt".
Open Source project are great ;-) I made now a little patch to category-template.php file, line 684 is changed now to:
( round( $smallest + ( ( $count - $min_count ) * $font_step ) ) )
#3
@
15 years ago
The tag cloud widget uses wp_tag_cloud() with default args (with the 'widget_tag_cloud_args' filter applied). But wp_generate_tag_cloud() can accept a unit.
While I perhaps see the case for rounding, round() creates an integer unless you include a precision argument.
Honestly, I'm not sure it is necessary. Maybe with a precision of at least 4.
#4
@
15 years ago
Sorry, which browser can display the difference of font-size 9.4545 and 9.4546 ? No - precision of 4 is useless. Perhaps precision 1 makes sense - then to browser an round it up or down.
#5
@
15 years ago
9.4545 might be displayed differently than 9.4546 due to screen resolutions and how the pixels fall.
That's not the point I was trying to make though. The point is that we can't round it to 0 or 1, as the unit may rely heavily on decimals, such as em.
A little rounding wouldn't be a bad idea, but a float is valid here. wp_tag_cloud() can accept a smallest value, largest value, and a unit. Browsers do use or even rely on floats for some units, take em for example.