Chromium Code Reviews| Index: content/shell/app/webkit_test_platform_support_linux.cc |
| diff --git a/content/shell/app/webkit_test_platform_support_linux.cc b/content/shell/app/webkit_test_platform_support_linux.cc |
| index 3b04631ff62dac43eb14c1cbb66e59f7ec462f91..d8bece4bd7c87fa3d4eebd5f9b4a096522419202 100644 |
| --- a/content/shell/app/webkit_test_platform_support_linux.cc |
| +++ b/content/shell/app/webkit_test_platform_support_linux.cc |
| @@ -38,6 +38,27 @@ bool CheckAndLoadFontFile( |
| return true; |
| } |
| +static bool LoadFontResources( |
| + const base::FilePath& base_path, FcConfig* font_config) { |
|
piman
2014/06/25 18:43:31
indent looks wrong. Run "git cl format" ?
Dominik Röttsches
2014/06/26 11:21:55
Yep, sorry about that. Tried with git cl format no
|
| + const char* const own_fonts[] = { |
| + "AHEM____.TTF", |
| + "GardinerModBug.ttf", |
| + "GardinerModCat.ttf" |
| + }; |
| + |
| + for (size_t i = 0; i < arraysize(own_fonts); ++i) { |
| + base::FilePath font_path = base_path.Append(own_fonts[i]); |
| + if (access(font_path.value().c_str(), R_OK) < 0 |
| + || !FcConfigAppFontAddFile(font_config, |
| + reinterpret_cast<const FcChar8*>(font_path.value().c_str()))) { |
| + std::cerr << "Failed to load test font resource " |
| + << font_path.value().c_str() << ".\n"; |
| + return false; |
| + } |
| + } |
| + return true; |
| +} |
| + |
| const char* const kFonts[] = { |
| "/usr/share/fonts/truetype/kochi/kochi-gothic.ttf", |
| "/usr/share/fonts/truetype/kochi/kochi-mincho.ttf", |
| @@ -119,13 +140,8 @@ bool SetupFontConfig() { |
| "/usr/share/fonts/truetype/ttf-indic-fonts-core/lohit_pa.ttf", |
| "/usr/share/fonts/truetype/ttf-punjabi-fonts/lohit_pa.ttf"); |
| - base::FilePath ahem_font = base_path.Append("AHEM____.TTF"); |
| - if (!FcConfigAppFontAddFile( |
| - font_config, |
| - reinterpret_cast<const FcChar8*>(ahem_font.value().c_str()))) { |
| - std::cerr << "Failed to load font " << ahem_font.value() << "\n"; |
| - return false; |
| - } |
| + if (!LoadFontResources(base_path, font_config)) |
| + return false; |
| if (!FcConfigSetCurrent(font_config)) { |
| std::cerr << "Failed to set the default font configuration\n"; |