Descriptionlinux: handle basic metric-compatibile font fallback
When a page CSS asks for:
font-family: Arial, sans-serif;
and you don't have Arial, fontconfig tries to provide a substitute.
However, as far as I can tell there is no way to distinguish fontconfig picking
Liberation Sans (a metric-equivalent substitute for Arial) or it picking a bad
substitute like Times New Roman. So historically we didn't allow fontconfig to
do any fallback at all. (In this example, we would then match attempt to match
sans-serif, which as a last resort we do allow fontconfig to do fallback on, so
it could pick e.g. DejaVu Sans or any other font matching "sans".)
Frustratingly, fontconfig knows whether a font substitute is an equivalent font
or just a last-resort fallback one -- in the XML files the equivalents are
marked with 'binding="same"' -- but I played around with the API for a few
hours and couldn't figure out any way to get this information out of it.
So I hardcode a list of equivalent fonts. Ugh. This fixes some sites where
they specify Arial and then have pixel-width-specified page layout that breaks
when you use any other sans-serif font.
BUG=18159, 32005, 33125
,others I've since forgotten about
TEST=uninstall Arial; visit one of the sites mentioned in the bug list
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=40912
Patch Set 1 #Patch Set 2 : add comment, rename variable #
Total comments: 2
Patch Set 3 : rewritten #Patch Set 4 : caps #Patch Set 5 : wrap #
Total comments: 1
Messages
Total messages: 6 (0 generated)
|