Summary: | [Freetype] Don't use non-scalable fonts | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Duy Nguyen <pclouds> | ||||
Component: | WebKitGTK | Assignee: | Carlos Alberto Lopez Perez <clopez> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | calvaris, cgarcia, clopez, commit-queue, darin, gyuyoung.kim, kling, koivisto, mmaxfield, mrobinson, svillar, zecke | ||||
Priority: | P2 | Keywords: | PlatformOnly | ||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | PC | ||||||
OS: | Linux | ||||||
Attachments: |
|
Description
Duy Nguyen
2009-11-27 06:02:44 PST
This is the list of fonts opened and number of open times (browsing yahoo.co.jp): 1 open("/usr/share/fonts/corefonts/arialbd.ttf", O_RDONLY) = 19 56 open("/usr/share/fonts/corefonts/arialbd.ttf", O_RDONLY) = 21 1 open("/usr/share/fonts/corefonts/arialbd.ttf", O_RDONLY) = 26 1 open("/usr/share/fonts/corefonts/arial.ttf", O_RDONLY) = 17 355 open("/usr/share/fonts/corefonts/arial.ttf", O_RDONLY) = 21 54 open("/usr/share/fonts/corefonts/courbd.ttf", O_RDONLY) = 21 370 open("/usr/share/fonts/corefonts/couri.ttf", O_RDONLY) = 21 329 open("/usr/share/fonts/corefonts/cour.ttf", O_RDONLY) = 21 321 open("/usr/share/fonts/dejavu/DejaVuSans-BoldOblique.ttf", O_RDONLY) = 21 347 open("/usr/share/fonts/dejavu/DejaVuSansMono-Bold.ttf", O_RDONLY) = 21 369 open("/usr/share/fonts/dejavu/DejaVuSans.ttf", O_RDONLY) = 21 323 open("/usr/share/fonts/dejavu/DejaVuSerif-Italic.ttf", O_RDONLY) = 21 322 open("/usr/share/fonts/dejavu/DejaVuSerif.ttf", O_RDONLY) = 21 356 open("/usr/share/fonts/freefont-ttf/FreeMono.ttf", O_RDONLY) = 21 322 open("/usr/share/fonts/freefont-ttf/FreeSans.ttf", O_RDONLY) = 21 390 open("/usr/share/fonts/freefont-ttf/FreeSerif.ttf", O_RDONLY) = 21 389 open("/usr/share/fonts/misc/10x20.pcf.gz", O_RDONLY) = 21 313 open("/usr/share/fonts/misc/12x13ja.pcf.gz", O_RDONLY) = 21 358 open("/usr/share/fonts/misc/6x13.pcf.gz", O_RDONLY) = 21 375 open("/usr/share/fonts/misc/9x15.pcf.gz", O_RDONLY) = 21 328 open("/usr/share/fonts/misc/9x18.pcf.gz", O_RDONLY) = 21 366 open("/usr/share/fonts/unifont/unifont-h.pcf.gz", O_RDONLY) = 21 Could you find out who decides to open the pcf fonts? Specially how it decides to use the AxB.pcf.gz fonts? In WebCore/platform/graphics/gtk/FontPlatformDataGtk.cpp we are driving FontConfig... you could use FcPatternPrint on the pattern we put into fontconfig and get out of it to see what we are selecting. Can you post a link to the page that has this issue? (In reply to comment #3) > Can you post a link to the page that has this issue? http://www.yahoo.co.jp/ (not sure if it's still an issue as I'm not using webkit browser right now) It seems that non-scalable fonts just give us issues. We should instruct WebKitGTK+ to never select a non-scalable font. *** Bug 140290 has been marked as a duplicate of this bug. *** I have uploaded a simple test case here where webkitgtk+ selects a non scalable font when ${etcfontconfig}/conf.d/70-no-bitmaps.conf is missing http://people.igalia.com/clopez/wkbug/140290/test.html Created attachment 244472 [details]
Patch
Comment on attachment 244472 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=244472&action=review > Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp:169 > + // Always prefer scalable fonts. Otherwise we may end choosing fonts that look horrible. > + FcPatternAddBool(pattern.get(), FC_SCALABLE, FcTrue); A better comment might be, "Never choose unscalable fonts, as they pixelate when displayed at different sizes." "look horrible" is a subjective statement. :) Committed r178301: <http://trac.webkit.org/changeset/178301> |