Patch from Kaoutsis: use find_directory() instead of hard coded paths

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25368 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval 2008-05-08 11:28:42 +00:00
parent 52eaadd811
commit 872556daeb

View File

@ -317,12 +317,22 @@ FontManager::_LoadRecentFontMappings()
// default known mappings // default known mappings
// TODO: load them for real, and use these as a fallback // TODO: load them for real, and use these as a fallback
_AddDefaultMapping("Bitstream Vera Sans", "Roman", BPath ttfontsPath;
"/boot/beos/etc/fonts/ttfonts/Vera.ttf"); if (find_directory(B_BEOS_FONTS_DIRECTORY, &ttfontsPath) == B_OK) {
_AddDefaultMapping("Bitstream Vera Sans", "Bold", ttfontsPath.Append("ttfonts");
"/boot/beos/etc/fonts/ttfonts/VeraBd.ttf");
_AddDefaultMapping("Bitstream Vera Sans Mono", "Roman", BPath veraFontPath = ttfontsPath;
"/boot/beos/etc/fonts/ttfonts/VeraMono.ttf"); veraFontPath.Append("Vera.ttf");
_AddDefaultMapping("Bitstream Vera Sans", "Roman", veraFontPath.Path());
veraFontPath.SetTo(ttfontsPath.Path());
veraFontPath.Append("VeraBd.ttf");
_AddDefaultMapping("Bitstream Vera Sans", "Bold", veraFontPath.Path());
veraFontPath.SetTo(ttfontsPath.Path());
veraFontPath.Append("VeraMono.ttf");
_AddDefaultMapping("Bitstream Vera Sans Mono", "Roman", veraFontPath.Path());
}
return false; return false;
} }