Open
Bug 589779
Opened 14 years ago
Updated 2 years ago
Extract generic id even from font-family values that have things other than a generic
Categories
(Core :: CSS Parsing and Computation, defect)
Tracking
()
NEW
People
(Reporter: drice, Unassigned)
References
()
Details
Attachments
(1 file)
198.19 KB,
image/png
|
Details |
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.8) Gecko/20100723 Ubuntu/8.04 (hardy) Firefox/3.6.8 Build Identifier: 3.6.8 In Firefox 3.6.8 on Ubuntu from package Firefox 3.6.8+build1+nobinonly-0ubuntu0.8.04.1 (hardy-updates) If all font-family entries given are not found, the final generic-family is not used, at least for monospace. Reproducible: Always Steps to Reproduce: 1. System without Lucida Console, with Courier. 2. View https://developer.mozilla.org/samples/cssref/font-family.html 3. Fixed width is rendered properly in Courier. 4. Edit style/dom (or save locally, edit, and view locally) by removing "Courier, " so that the font-family style reads: .examplemonospace { font-family: "Lucida Console",monospace; } 5. See fixed width example NOT in fixed width. Actual Results: .examplemonospace is rendered in serif. Expected Results: .examplemonospace should be rendered as if it was given font-family:monospace, I'd put this as a low priority / minor bug, but I think that it's important to a lot of web apps that want to render fixed width fonts that they can trust font-family: ...., monospace; will always render in fixed width.
Reporter | ||
Comment 1•14 years ago
|
||
This does not happen on my Window's 3.6.8
Comment 2•14 years ago
|
||
Derrick, what does your OS report when you run: fc-match "Lucida Console",monospace ?
Reporter | ||
Comment 3•14 years ago
|
||
$ fc-match "Lucida Console",monospace DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book" Same when quoted $ fc-match '"Lucida Console",monospace' DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book"
Reporter | ||
Comment 4•14 years ago
|
||
didn't mean to hit save change so quickly.. $ fc-match '"Lucida Console",Courier,monospace' n022003l.pfb: "Nimbus Mono L" "Regular" $ fc-match 'monospace' DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book" Note that 'monospace' gives the same result as '"Lucida Console",monospace' but renders differently in Firefox.
Comment 5•14 years ago
|
||
Hmm. That's really odd.. Karl, any idea what's going on here? Derrick, what's your font preference set to for the monospace font?
Reporter | ||
Comment 6•14 years ago
|
||
In Gnome's System > Preferences > Appearance, I have Fixed width font set to "Monospace" size 10. in about:config for all font.name.monospace.* I have "monospace". I have one user-set font.name.* value: font.name.serif.x-western: "Times New Roman" *** Resetting that to default clears this bug *** bizarre.
Comment 7•14 years ago
|
||
That's.... really odd, yes. Does setting it back via about:config cause the bug to reappear? What about via the prefs dialog?
Comment 8•14 years ago
|
||
Confirmed with openSUSE 11.2's 3.6.8 using http://fm.no-ip.com/Auth/Tmp/font-family589779b.html fc-match reports andalemo.ttf: "Andale Mono" "Normal" FF 4b2 behaves as expected on same system.
Comment 9•14 years ago
|
||
Clearing in about:config font.name.serif.x-western: "Sans Serif" to blank fixes it here too.
Reporter | ||
Comment 10•14 years ago
|
||
Yes, changing the font.name.serif.x-western value causes the bug to reappear in real-time. When property is reset (no bug): Firefox Preferences > Content Default font: serif 16 (advanced...) Fonts for Western: Porportional: Serif 16 Serif: serif Sans-serif: sans-serif Monospace: monospace 12 Minimum font size: None (checked) Allow pages to choose their own fonts, instead of my selections above Default Character Encoding: Western (ISO-8859-1) With property set to Times New Roman (bug appears) Firefox Preferences > Content Default font: Times New Roman 16 (advanced...) Fonts for Western: Porportional: Serif 16 Serif: Times New Roman Sans-serif: sans-serif Monospace: monospace 12 Minimum font size: None (checked) Allow pages to choose their own fonts, instead of my selections above Default Character Encoding: Western (ISO-8859-1)
Comment 11•14 years ago
|
||
Oops. s/font.name.serif.x-western:/font.default.x-western/
Comment 12•14 years ago
|
||
Felix, Derrick, do you see the bug with a mozilla.org 3.6.8 as well? It not happening with 4.0b2 for Felix is interesting.
Reporter | ||
Comment 13•14 years ago
|
||
(In reply to comment #1) > This does not happen on my Window's 3.6.8 Even with new information, I cannot reproduce this on Windows 3.6.8. I tried changing the property from the default TImes New Roman to Arial and using a test style of "garbledigook", monospace and it properly rendered in monospace.
Reporter | ||
Comment 14•14 years ago
|
||
Reproduced off a fresh download: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
Reporter | ||
Comment 15•14 years ago
|
||
(In reply to comment #14) > Reproduced off a fresh download: > > Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.8) Gecko/20100722 > Firefox/3.6.8 Also reproduced in 3.5.11 Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.11) Gecko/20100701 Firefox/3.5.11
Comment 16•14 years ago
|
||
With Mozilla.org's 3.6.6 and the same profile as 11.2's 3.6.8 the bad behavior is restored by going into preferences and selecting sans serif for proportional.
Comment 17•14 years ago
|
||
Ok. So sounds like this is just something that got fixed between 3.6 and current trunk? And the question is whether to backport the fix? Felix, are you willing to figure out when this got fixed on trunk?
Updated•14 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 18•14 years ago
|
||
I was mistaken in comment 8. This brokenness was made from Mozilla.org's Firefox 4.0b2 on openSUSE 11.2/KDE3.
Comment 19•14 years ago
|
||
What's happening here is that nsStyleContext::GetStyleFont()->mFont is returning a font with two generic families in the name: "Lucida Console",monospace,serif gfxPangoFontGroup is broken when there are two generic families. That's a bug that's not simple to fix. The computed style one has a single generic: font-family: "Lucida Console",monospace; Where did "serif" come from?
Comment 20•14 years ago
|
||
(In reply to comment #19) > gfxPangoFontGroup is broken when there are two generic families. > That's a bug that's not simple to fix. Actually, I can probably fix that by just ignoring any specified families after the first generic. But I'm still curious as to why there are two generics?
Comment 21•14 years ago
|
||
Looks like the two generics might be from this code (though I haven't debugged): http://hg.mozilla.org/mozilla-central/annotate/f0af50ab4215/layout/style/nsRuleNode.cpp#l3361 http://hg.mozilla.org/mozilla-central/annotate/f0af50ab4215/layout/style/nsRuleNode.cpp#l3001 Seems a bit strange to have two generics, but I need to fix gfxPangoFontGroup for bug 546315 when there are non-generics after the generic family anyway. This bug can either be marked a dupe of bug 546315, or used to investigate whether two generics in family list is reasonable (and possibly whether generics in author family should affect mGenericID).
Comment 22•14 years ago
|
||
There is probably a performance cost to adding extra generic families, on Linux at least, so, if the style system will continue to have two generics, then perhaps gfxPangoFontGroup should remove the second. There may be some value in having a second generic though: for languages which are not supported by any monospace fonts, a second generic will give the preferred choice between sans-serif and serif (if that means anything for that language).
Comment 23•14 years ago
|
||
Now that font families is actually a list, not a flat string, we should be able to look for individual generics in it, no? So fix that XXX comment in ComputeFontData. Seems like a good idea to track that in this bug.
Summary: font-family doesn't use generic-family if family-name fonts not found → Extract generic id even from font-family values that have things other than a generic
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•