From 872556daebf002dea858678ec0d6b69bc9aaa3f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Thu, 8 May 2008 11:28:42 +0000 Subject: [PATCH] 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 --- src/servers/app/FontManager.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/servers/app/FontManager.cpp b/src/servers/app/FontManager.cpp index 2103eeaa07..9a42e1cf49 100644 --- a/src/servers/app/FontManager.cpp +++ b/src/servers/app/FontManager.cpp @@ -317,12 +317,22 @@ FontManager::_LoadRecentFontMappings() // default known mappings // TODO: load them for real, and use these as a fallback - _AddDefaultMapping("Bitstream Vera Sans", "Roman", - "/boot/beos/etc/fonts/ttfonts/Vera.ttf"); - _AddDefaultMapping("Bitstream Vera Sans", "Bold", - "/boot/beos/etc/fonts/ttfonts/VeraBd.ttf"); - _AddDefaultMapping("Bitstream Vera Sans Mono", "Roman", - "/boot/beos/etc/fonts/ttfonts/VeraMono.ttf"); + BPath ttfontsPath; + if (find_directory(B_BEOS_FONTS_DIRECTORY, &ttfontsPath) == B_OK) { + ttfontsPath.Append("ttfonts"); + + BPath veraFontPath = ttfontsPath; + 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; }