diff options
author | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-03 22:44:09 +0000 |
---|---|---|
committer | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-03 22:44:09 +0000 |
commit | b3467a4dd2f9d7c6473c1fcd22a31c2ac39a2d88 (patch) | |
tree | e2f55061517c5aaf3e87beca9c335bfcc9e530c1 /webkit | |
parent | 378f3ac5cd7c0c170cf3e8e54aa627defcb590da (diff) | |
download | chromium_src-b3467a4dd2f9d7c6473c1fcd22a31c2ac39a2d88.zip chromium_src-b3467a4dd2f9d7c6473c1fcd22a31c2ac39a2d88.tar.gz chromium_src-b3467a4dd2f9d7c6473c1fcd22a31c2ac39a2d88.tar.bz2 |
Linux: support css font-family fallback.
Currently we'll always take the first element of a font-family list and
run with it, using fontconfig's fallback. This adds a, slightly hacky,
test to see if the fontconfig result is good enough and, if not, reports
the failure back into WebKit so that other font-family elements can be
tried.
This fixes LayoutTests/css2.1/t040103-escapes-01-b.html
Review URL: http://codereview.chromium.org/12914
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6320 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/port/platform/graphics/chromium/FontCacheLinux.cpp | 2 | ||||
-rw-r--r-- | webkit/tools/test_shell/resources/linux-fontconfig-config | 11 |
2 files changed, 13 insertions, 0 deletions
diff --git a/webkit/port/platform/graphics/chromium/FontCacheLinux.cpp b/webkit/port/platform/graphics/chromium/FontCacheLinux.cpp index 06251b6..31b4207 100644 --- a/webkit/port/platform/graphics/chromium/FontCacheLinux.cpp +++ b/webkit/port/platform/graphics/chromium/FontCacheLinux.cpp @@ -96,6 +96,8 @@ FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontD style |= SkTypeface::kItalic; SkTypeface* tf = SkTypeface::Create(name, (SkTypeface::Style)style); + if (!tf) + return NULL; FontPlatformData* result = new FontPlatformData(tf, diff --git a/webkit/tools/test_shell/resources/linux-fontconfig-config b/webkit/tools/test_shell/resources/linux-fontconfig-config index c5492cd..cb1e3773 100644 --- a/webkit/tools/test_shell/resources/linux-fontconfig-config +++ b/webkit/tools/test_shell/resources/linux-fontconfig-config @@ -29,6 +29,17 @@ </edit> </match> + <!-- Some layout tests specify Helvetica as a family and we need to make sure + that we don't fallback to Times New Roman for them --> + <match target="pattern"> + <test qual="any" name="family"> + <string>Helvetica</string> + </test> + <edit name="family" mode="assign"> + <string>Arial</string> + </edit> + </match> + <match target="pattern"> <test qual="any" name="family"> <string>sans-serif</string> |