Last Comment Bug 670072 - Font sizes smaller than 0.5px are not painted correctly under GDI
: Font sizes smaller than 0.5px are not painted correctly under GDI
Status: RESOLVED FIXED
: testcase
Product: Core
Classification: Components
Component: Layout: Text (show other bugs)
: Trunk
: All Other
: P3 normal (vote)
: ---
Assigned To: Jonathan Kew (:jfkthame)
:
Mentors:
http://www.rising-dead.com/Forums/vie...
Depends on: 691581
Blocks: 708162 693143
  Show dependency treegraph
 
Reported: 2011-07-07 20:59 PDT by Dragoș Valentin, Rădulescu
Modified: 2011-12-10 00:25 PST (History)
6 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Testcase (215 bytes, text/html)
2011-07-08 01:44 PDT, Mats Palmgren (:mats)
no flags Details
screenshot from comment 17 (30.45 KB, image/png)
2011-07-11 10:45 PDT, Kevin Brosnan [:kbrosnan]
no flags Details
patch, round font sizes to integers for GDI backend (733 bytes, patch)
2011-07-12 14:28 PDT, Jonathan Kew (:jfkthame)
jd.bugzilla: review+
Details | Diff | Splinter Review

Description Dragoș Valentin, Rădulescu 2011-07-07 20:59:08 PDT
User Agent: Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20100101 Firefox/5.0
Build ID: 20110615151330

Steps to reproduce:

Nothing. Just used the browser.


Actual results:

When i use font-size: 1% on a text. it looks all messed up.


Expected results:

When i use font-size: 1% on a text. it should be invisible. Nothing to see...
Comment 1 Dragoș Valentin, Rădulescu 2011-07-07 21:02:35 PDT
Please fix the bug. its annoying as i cant hide text, to add keywords
Comment 2 Kevin Brosnan [:kbrosnan] 2011-07-07 21:33:42 PDT
There is a lot of text on that page and I don't see any obvious problems. Would you attach a screenshot highlighting the problem text.
Comment 3 Dragoș Valentin, Rădulescu 2011-07-07 21:35:57 PDT
Please View this :
http://forums.mozillazine.org/viewtopic.php?f=38&t=2246843
Comment 4 Mats Palmgren (:mats) 2011-07-08 01:44:41 PDT
Created attachment 544750 [details]
Testcase

Extracted from the forums.mozillazine.org post
Comment 5 Mats Palmgren (:mats) 2011-07-08 01:47:01 PDT
The testcase works as expected on Linux, but not on Windows 7.
Maybe it's just that 1% rounds to zero on Linux but not on Windows.

Radulescu, why don't you simply use font-size:0 if that's what you want?
Comment 6 Dragoș Valentin, Rădulescu 2011-07-08 02:05:19 PDT
@Mats,

i am getting that issue on my phpbb board, as well as the phpbb 3.0.8 software itself. If i use [size=0]INVISIBLE TEXT[/size] The BBCode wont get Parsed. Even so, i wish to go by their software, and get the Firefox issue fixed.
Comment 7 Kevin Brosnan [:kbrosnan] 2011-07-08 09:02:48 PDT
I don't see any text in Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0a1) Gecko/20110708 Firefox/8.0a1

Graphics
Adapter Description NVIDIA GeForce GT 240M
Vendor ID 10de
Device ID 0a34
Adapter RAM 1024
Adapter Drivers nvd3dumx,nvwgf2umx,nvwgf2umx nvd3dum,nvwgf2um,nvwgf2umDriver Version8.17.12.7061
Driver Date 4-7-2011
Direct2D Enabled true
DirectWrite Enabled true (6.1.7601.17563)
ClearType Parameters DISPLAY1 [ Gamma: 2200 Pixel Structure: RGB ClearType Level: 100 Enhanced Contrast: 400 ] DISPLAY2 [ Gamma: 2200 Pixel Structure: RGB ClearType Level: 50 Enhanced Contrast: 200 ] 
WebGL Renderer Google Inc. -- ANGLE -- OpenGL ES 2.0 (ANGLE 0.0.0.686)
GPU Accelerated Windows 1/1 Direct3D 10
Comment 8 Dragoș Valentin, Rădulescu 2011-07-08 09:09:05 PDT
I do on Firefox 5
Mozilla/5.0 (Windows NT 5.1; rv:5.0) Gecko/20100101 Firefox/5.0
Comment 9 Kevin Brosnan [:kbrosnan] 2011-07-08 09:13:07 PDT
Please provide the graphics info from about:support. The testcase works for me in Firefox 5 as well.
Comment 10 Dragoș Valentin, Rădulescu 2011-07-08 09:17:40 PDT
Hello Kevin, thanks for this. Didnt knew about that address


Graphics
Adapter: DescriptionATI Radeon HD 2400 Series AGP
Vendor: ID1002
Device: ID94c4
Adapter: RAMUnknown
Adapter: Driversati2dvag
Driver: Version8.501.0.0
Driver: Date6-2-2008
Direct2D Enabled: Blocked on your graphics driver. Try updating your graphics driver to version 10.6 or newer.
DirectWrite Enabled: false (0.0.0.0, font cache n/a)
WebGL Renderer:(WebGL unavailable)
GPU Accelerated Windows: 0/1
Comment 11 Kevin Brosnan [:kbrosnan] 2011-07-08 09:31:36 PDT
Try installing the latest Video drivers from AMD http://sites.amd.com/us/game/downloads/Pages/radeon_xp-32.aspx
Comment 12 Dragoș Valentin, Rădulescu 2011-07-08 09:33:57 PDT
TheIssue wasnt existing on the old 3.6.X
Can it be that my video driver isnt compatible with the browser?

Ill install the Driver, hope it wont cause trouble.
Comment 13 Dragoș Valentin, Rădulescu 2011-07-08 09:41:34 PDT
Just installed that, and the bug persists. its just a FF5 Issue imo
Comment 14 Dragoș Valentin, Rădulescu 2011-07-08 09:54:08 PDT
My Graphics details didnt changed at all between.
Comment 15 Dragoș Valentin, Rădulescu 2011-07-09 21:24:45 PDT
Well this is it, none replys?
Comment 16 Jonathan Kew (:jfkthame) 2011-07-11 07:29:59 PDT
Please attach a screenshot showing the problem you see (as requested in comment #2).

I notice that in the "Testcase" here (from comment #4), the "INVISIBLE TEXT" shows up perfectly readably in Safari on OS X (it looks like I'm getting 9pt Times Roman). In Firefox on OS X, it shows up as a few tiny black dots along the baseline - which is roughly what I'd expect "very very small" text to look like.

So it seems that this method of "hiding" text is not at all reliable across various browsers and systems - and I don't see why it should be. Small text is not the same thing as invisible text! Surely there are better methods available in CSS.
Comment 17 Dragoș Valentin, Rădulescu 2011-07-11 07:59:50 PDT
"it shows up as a few tiny black dots along the baseline - which is roughly what I'd expect "very very small" text to look like."

Yes, thats what it dos. I know it is not the same thing, but it was working perfectly on Firefox 3.6.X So it looks to me like a BUG !

I have just tested into IE8 And it shows very tiny text thats not disturbing. while this bug of FF Is...

If its small it should look small. not all messed up with the text lover, that gets highlighted. This method is fine with me. it just needs to be turn back to how it interpreted it on 3.6.X :D

cant figure out how to add the attachment ... heres the image

http://i44.servimg.com/u/f44/13/84/94/71/bug10.png
Comment 18 Jonathan Kew (:jfkthame) 2011-07-11 09:05:13 PDT
OK, it appears that under GDI, we've got a bug where the glyphs are painted much too big in this case, although they are spaced as if tiny (so they almost completely overprint each other).

This doesn't happen when hardware acceleration is enabled and we're using the DirectWrite+D2D backend.

The GDI issue does look like a regression, and we should try to fix it. Sizes smaller than 0.5px show the problem - probably because we round the font size to an integer number of pixels, getting zero, and then don't handle that correctly.

However, I still believe this is bad practice on the part of the site author. Aside from the fact that some browsers may display the "tiny" text much more visibly than you want (e.g. Safari, as noted in comment #16), there are other problems as well. What if the user has poor eyesight and has set a large minimum font size in the browser prefs? What if the user is blind and using a screen-reader? This is NOT a good way to "hide" text.
Comment 19 David Baron :dbaron: ⌚️UTC-7 (busy September 14-25) 2011-07-11 09:30:40 PDT
For the record, our minimum font size pref does not apply to fonts whose size is zero (but it does apply when they're very small).
Comment 20 Dragoș Valentin, Rădulescu 2011-07-11 09:39:37 PDT
Whats GDI?
How do i turn on Hardware Acceleration?

I dont care if the text is showing to be a bit smaller, we are discussing about the bug, not about how the user uses CSS.

The site is dedicated to a Game, and it will hardly get any of those, kind of blind peoples. And about the bad eye sight, im not great with it myself. but that dosnt matter.

Lets fix the bug and not talk about how we use that property :P

OH, And by the way, ive noticed that Firefox 4/5 has removed the Dotted border from it. Why? it is annoying as we use to hightlight links that way.
I have to use a alternative from the stylish addon in order to re add the border :(
Comment 21 Jonathan Kew (:jfkthame) 2011-07-11 10:08:40 PDT
I've confirmed the bug, and that it's something we should fix.

Meanwhile, you could avoid the issue by using more appropriate means to hide text (how about "display:none", for example?). Or if you insist on just making the text small rather than hiding it completely, even though this will give inconsistent results, you could use "font-size:1px".
Comment 22 Dragoș Valentin, Rădulescu 2011-07-11 10:15:52 PDT
Thank You Jonathan.

Nahh.. im not so crazy on hiding it for good, i might remove this things from a few posts. Adding display:none would require a new BBCode and i dont wish to add any more. I Just want it smaller :)

I do use font-size: 1%; as it was into the original title i gave.. read the topic from mozillazine.

I need to use font-size: 4%; to show the text small. if i use things under that, it gets the text all messed up >,<

Could you answer the question about the dotter border around links? or do i have to submit a separate bugreport/ticket
Comment 23 Kevin Brosnan [:kbrosnan] 2011-07-11 10:45:10 PDT
Created attachment 545207 [details]
screenshot from comment 17
Comment 24 Jonathan Kew (:jfkthame) 2011-07-11 10:59:15 PDT
(In reply to comment #22)
> I do use font-size: 1%; as it was into the original title i gave.. read the
> topic from mozillazine.
> 
> I need to use font-size: 4%; to show the text small. if i use things under
> that, it gets the text all messed up >,<

Why not simply use font-size:1px rather than a percentage (which means you'd need to figure out different values depending on the context where you use it).
 
> Could you answer the question about the dotter border around links? 

I assume that's a change in the browser's default styling, or perhaps a theme you're using. If you want to ensure links have borders, you should specify them in your CSS.

See also http://support.mozilla.com/en-US/questions/818975.
Comment 25 Dragoș Valentin, Rădulescu 2011-07-11 11:08:27 PDT
phpbb's font BBCode uses percentage, and not px :|
Im not sure about the change.
What theme are do you mean? im using FF's default theme.
They are specifyed in my css. i cant see the dotted border on EVERY SITES :(

Ive talked about this into this topic
http://forums.mozillazine.org/viewtopic.php?f=38&t=2216867
Comment 26 Jonathan Kew (:jfkthame) 2011-07-12 14:28:06 PDT
Created attachment 545482 [details] [diff] [review]
patch, round font sizes to integers for GDI backend

This resolves the problem with incorrect rendering of sizes < 0.5px, as they round to zero, which we then handle OK.
Comment 27 Dragoș Valentin, Rădulescu 2011-07-12 14:32:59 PDT
Sorry, but what do i do with that?
Is it just the code change for the next FF Versions, or do i have to edit some FF File in order to fix that?

Im not sure whats the code for...
Comment 28 Jonathan Kew (:jfkthame) 2011-07-12 14:37:55 PDT
It's a proposed patch for the source code; if it's reviewed and accepted, it will go into a future release and should fix the problem with tiny font sizes displaying incorrectly (they'll just disappear instead, as happened on older versions).

Until then, I think your best option is to use a different method for "hiding" text (as already suggested), or ensure that you use a minimum size of at least 0.5px for "very small but not completely invisible" text.
Comment 29 Dragoș Valentin, Rădulescu 2011-07-12 14:43:27 PDT
AWESOME !!! :D
Im more interested into fixing Mozilla's Bug, rather than hiding my text.
I just though and said to use font-size: 4%; to fix the issue.

Thank You for your help with this, and for your lastfast reply.
Would it be possible to have a look on the dotted border issue also?
Comment 30 Mats Palmgren (:mats) 2011-07-12 14:52:12 PDT
> Would it be possible to have a look on the dotted border issue also?

We handle one issue per bug report only (for tracking purposes), so please
file a separate bug.
Comment 31 Dragoș Valentin, Rădulescu 2011-07-12 14:53:10 PDT
Ok, thank you. I Will do that after i take a nap.
Comment 32 Jonathan Kew (:jfkthame) 2011-07-15 07:28:48 PDT
http://hg.mozilla.org/mozilla-central/rev/eb3a8761eac6
Comment 33 Dragoș Valentin, Rădulescu 2011-07-15 07:53:55 PDT
Hello, so was this approved into the next release?
Which will be the next release?
By the way, i have submited a new bug report. Could you review it please?

https://bugzilla.mozilla.org/show_bug.cgi?id=671850
Comment 34 Jonathan Kew (:jfkthame) 2011-07-15 08:16:36 PDT
(In reply to comment #33)
> Hello, so was this approved into the next release?
> Which will be the next release?

This fix just landed on mozilla-central, which means it should appear in Nightly builds starting from tomorrow, and then later in Aurora, Beta and Release channels, following the standard release schedule.

> By the way, i have submited a new bug report. Could you review it please?
> 
> https://bugzilla.mozilla.org/show_bug.cgi?id=671850

That's not an area I know anything about; I'm sure someone will look at it in due course.
Comment 35 Dragoș Valentin, Rădulescu 2011-07-15 08:46:56 PDT
Awesome !!!! :D
Im happy to be amomghst the ones that have contributed a bit, by improving Firefox ! :-)

Im not sure what you mean by nightly builds, and im not sure what aurora is. i think Firefox is under that name as phpbb3 is called olympus.

If its not too much, could you please let me know when this fix will be added?
Comment 36 Ekanan Ketunuti 2011-07-15 23:26:09 PDT
(In reply to comment #35)
> Awesome !!!! :D
> Im happy to be amomghst the ones that have contributed a bit, by improving
> Firefox ! :-)
> 
> Im not sure what you mean by nightly builds, and im not sure what aurora is.
> i think Firefox is under that name as phpbb3 is called olympus.
> 
> If its not too much, could you please let me know when this fix will be
> added?

Firefox nightly builds https://nightly.mozilla.org/
Firefox aurora https://www.mozilla.com/en-US/firefox/channel/

FYI, Mozilla Firefox: Development Specifics http://mozilla.github.com/process-releases/draft/development_specifics/
Comment 37 Dragoș Valentin, Rădulescu 2011-08-17 01:43:15 PDT
Bud, You said that this will be fixed into the next releases.
I Have tried 5.0.1 and now, 6.0 ..... The bug still persists !! -_-"
Comment 38 Kevin Brosnan [:kbrosnan] 2011-08-17 16:41:38 PDT
It will be fixed in Firefox 8.
Comment 39 Kevin Brosnan [:kbrosnan] 2011-08-17 16:42:45 PDT
Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:8.0a1) Gecko/20110815 Firefox/8.0a1
Comment 40 Dragoș Valentin, Rădulescu 2011-08-18 00:06:01 PDT
Allright. Thanks. Should have said that from the start :P
Comment 41 Jonathan Kew (:jfkthame) 2011-10-28 04:58:18 PDT
While looking into bug 691581, I found that although this bug is fixed for GDI rendering on Win7, it is not completely fixed under WinXP - tiny font sizes can still generate incorrect "garbage" on screen there. Results also vary depending whether the harfbuzz shaping path is used or not.

Re-opening for further investigation; apparently needs an additional fix for XP.
Comment 42 Dragoș Valentin, Rădulescu 2011-10-31 03:13:27 PDT
Thank you for re-opening it Jonathan. 
I thought it is going to get fixed in FF8 though..
Cant wait to finally see it working. I may even consider upgrading to Win7 as i got a new pc that supports it. Seems that u support better the New OSs
Comment 43 Dragoș Valentin, Rădulescu 2011-11-08 16:43:38 PST
You guys are really annoying... You said it will be fixed in Firefox 8. I have upgraded to that and the issue still persists.
Comment 44 Dragoș Valentin, Rădulescu 2011-11-09 15:45:44 PST
I have just installed Windows7 Ultimate and the issue is not present there. Its just that i see it on Windows XP SP2
Comment 45 John Daggett (:jtd) 2011-12-05 00:54:35 PST
The fix for this is causing a top crasher, bug 693143.  If we can't resolve that easily, I think the fix here should be backed out.
Comment 46 Dragoș Valentin, Rădulescu 2011-12-06 04:36:08 PST
I'm not sure what you are saying. The bug persists in XP SP2, on Win7 its not showing.
Comment 47 John Daggett (:jtd) 2011-12-08 03:33:47 PST
(In reply to Radulescu Dragos-Valentin from comment #46)
> I'm not sure what you are saying. The bug persists in XP SP2, on Win7 its
> not showing.

If you could, please confirm with the latest nightly, you shouldn't see drawing artifacts on either XP or Win7.
Comment 48 John Daggett (:jtd) 2011-12-08 18:30:48 PST
The fix for bug 693143 resolves the problem on XP.

Tested with:
Mozilla/5.0 (Windows NT 5.1; rv:11.0a1) Gecko/20111208 Firefox/11.0a1
Comment 49 Dragoș Valentin, Rădulescu 2011-12-10 00:25:12 PST
Sadly i dont use Win XP now, and i cannot confirm if the fix has worked. hope it did :)

Note You need to log in before you can comment on or make changes to this bug.