diff options
author | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-14 21:15:01 +0000 |
---|---|---|
committer | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-14 21:15:01 +0000 |
commit | 5a562ec1e1b621aa6e696b795f83a890f2684b84 (patch) | |
tree | bd2b133db8bd16f05bd8dfb273f8c0ff721b86ce /skia | |
parent | 48676d6ed4d082f8ce16442df6103786e9c51fb9 (diff) | |
download | chromium_src-5a562ec1e1b621aa6e696b795f83a890f2684b84.zip chromium_src-5a562ec1e1b621aa6e696b795f83a890f2684b84.tar.gz chromium_src-5a562ec1e1b621aa6e696b795f83a890f2684b84.tar.bz2 |
Linux: filter out unreadable fonts
Fontconfig will return fonts which are unreadable to the current
process if the system cache contains them.
BUG=16715
http://codereview.chromium.org/149628
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20663 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia')
-rw-r--r-- | skia/ext/SkFontHost_fontconfig_direct.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/skia/ext/SkFontHost_fontconfig_direct.cpp b/skia/ext/SkFontHost_fontconfig_direct.cpp index 7f7be08..fe4dc36 100644 --- a/skia/ext/SkFontHost_fontconfig_direct.cpp +++ b/skia/ext/SkFontHost_fontconfig_direct.cpp @@ -134,6 +134,14 @@ bool FontConfigDirect::Match(std::string* result_family, continue; } + // fontconfig can also return fonts which are unreadable + FcChar8* c_filename; + if (FcPatternGetString(current, FC_FILE, 0, &c_filename) != FcResultMatch) + continue; + + if (access(reinterpret_cast<char*>(c_filename), R_OK) != 0) + continue; + match = current; break; } |