I just noticed today that the bold font used on Google search result pages is different on tip of tree (as of Friday sometime) than in the last released version (Safari 2.0.2, 416.13). It's much thicker and noticeably uglier, as if it's being programmatically bolded two times.
Created attachment 5147 [details] Picture showing a page in 2.0.2 and in tip of tree
This is probably happening all over the place, but it caught my eye on Google.
I think Darin landed some code a while back that bolded fonts that didn't have innate bold representations by just drawing them twice, offset by a pixel. That code might be at fault here.
This looks like what you'd see if the font were both normal bold and synthetic bold. I can't reproduce, either. I suspect a build problem -- make sure this persists after make clean.
I can't reproduce on my PowerBook, but I can on my G5. I did a clean build, but the problem persists.
Here's a reduction that continues to show the problem on my G5: <body style="font-family:arial"><b>This is too bold</b></body> If I change the family name to "times", the problem does not occur.
(In reply to comment #6) > Here's a reduction that continues to show the problem on my G5: > > <body style="font-family:arial"><b>This is too bold</b></body> > > If I change the family name to "times", the problem does not occur. Do you have Arial
Oops. I didn't mean to post comment #7. Sorry.
Using my reduction, in -[WebTextRendererFactory fontWithFamilies:traits:size:], the NSFont that's returned is: "Arial-BoldMS 16.00 pt. P [] (0x22c9ef40) fobj=0x222d6580, spc=4.45" However, [[NSFontManager sharedFontManager] traitsOfFont:font] returns 0. So this font is visually bold, and its name includes "Bold" (so it's obviously supposed to be bold), but NSFontManager doesn't think it's bold. That's why it's getting the syntheticBold bit applied and appearing doubly bold. Maybe this particular font is bad on my machine somehow. I don't know where it came from (installing some Microsoft product, presumably). I'll test what happens on my PowerBook in this same code.
Nothing obviously different about the font on my PowerBook, at least from po: "Arial-BoldMS 16.00 pt. P [] (0x0f123590) fobj=0x0f1de320, spc=4.45" However, here [[NSFontManager sharedFontManager] traitsOfFont:font] returns 0x100000a I'll have to find the font files on disk and see if they appear different.
On my G5 a Spotlight search for "arial" finds 22 fonts; on my Powerbook the same search finds 25 fonts. Some of the ones on my G5 show dates in the Spotlight window (in 2000 and 2001), but none of the ones on my Powerbook do. Bleah, I say.
Alexey Proskuryakov, Mitz Pettel, and others helped look into this. It seems that Microsoft Office X installs a version of Arial (2.90) where the bold variant is missing some bit somewhere that NSFontManager uses to determine that it's bold. So people who've installed this particular font can run into the problem. Alexey could reproduce after installing Arial from Microsoft Office X. However, my Powerbook has this same version of Arial as the active Arial Bold, and it does not have this problem, so there is still some mystery here. Also, this shows that problems with existing fonts in the field are going to make Safari look bad with our new synthetic bold and perhaps italic code.
Created attachment 5193 [details] Here's a copy of the offending font file, zipped Without zipping first, Safari says the file is empty, presumably because it is all resource fork.
Though the real problems here appear to be in either the font itself or ATS's handling of the font, this symptom makes WebKit look bad. I've coded a workaround to avoid this problem, will attach in a moment.
Created attachment 5194 [details] Patch that implement's Maciej's idea for a workaround.
Comment on attachment 5194 [details] Patch that implement's Maciej's idea for a workaround. Looks good, although that last if statement has braces and shouldn't. I'd also suggest adding one more blank line or removing a blank line or two inside the matchedFamily if statement to make the "paragraphing" more even. r=me
I had removed the extra braces already, but I added another blank line as suggested.
Removing keyword(s) cause bug is closed.
Removing keyword(s) since bug is fixed.
Removing Regression keyword from bugs already fixed.
*** Bug 12633 has been marked as a duplicate of this bug. ***