diff options
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; } |