'Always use my font choices' doesn't respect monospace

Bug #888814 reported by Cris Dywan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Midori Web Browser
Fix Released
Undecided
Unassigned

Bug Description

The feature introduced in bug 826441 and bug 883879 respectively allows me to have my favourite font even if the website tries to ignore it. The problem is monospaced fonts are also overridden, which is very annoying with source code, release notes and other bits which are intentionally monospaced.

Some example cases:

http://wiki.xfce.org/midori/faq
http://fpaste.org/ABhI/raw/
http://bugzilla-attachments.gnome.org/attachment.cgi?id=171763
http://qdb.us/306522
http://docs.fedoraproject.org/en-US/Fedora/15/html/Installation_Guide/ch-new-users.html#sn-which-download-bt
http://stackoverflow.com/questions/638251/how-to-emit-cross-thread-signal-in-qt

In all cases you can see text paragraphs or individual occurences of text which are monospaced *unless* Midori is asked to use your fonts.

Revision history for this message
Cris Dywan (kalikiana) wrote :
description: updated
Revision history for this message
Cris Dywan (kalikiana) wrote :
Revision history for this message
gue5t gue5t (gue5t) wrote :

A few notes on the new CSS:
WebCore/css/html.css (the "user agent stylesheet" in the inspector) has the following rules which serve as a pretty good guideline to which elements should be monospaced:

tt, code, kbd, samp {
    font-family: monospace
}

pre, xmp, plaintext, listing {
    display: block;
    font-family: monospace;
    white-space: pre;
    margin: 1__qem 0
}

So I'd suggest using those sets of elements for monospace, and using just "body" for proportional, as body * will only apply to subelements of the body, but not text in the body itself.

Revision history for this message
Cris Dywan (kalikiana) wrote :

The above elements are not all standard afair, namely kbd, samp, xmp, plaintext and listing. I pondered making some exceptions since many sites grossly disregard semantic markup but that would require site-specific styles as well.

"body" alone needs to be monospaced because raw text files are always displayed like that. See the bugzilla example URL above.

I committed the patch which so far works fairly well for me, except for those non-standard elements.

Changed in midori:
status: New → Fix Committed
Cris Dywan (kalikiana)
Changed in midori:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.