Skip to content
Snippets Groups Projects
Commit 4b99e6a1 authored by Nat Goodspeed's avatar Nat Goodspeed
Browse files

SL-10252: On Windows, use $SystemRoot again, not FOLDERID_Fonts.

parent 11f23ca4
No related branches found
No related tags found
No related merge requests found
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include "v4color.h" #include "v4color.h"
#include "lltexture.h" #include "lltexture.h"
#include "lldir.h" #include "lldir.h"
#include "llstring.h"
// Third party library includes // Third party library includes
#include <boost/tokenizer.hpp> #include <boost/tokenizer.hpp>
...@@ -1074,6 +1075,14 @@ std::string LLFontGL::getFontPathSystem() ...@@ -1074,6 +1075,14 @@ std::string LLFontGL::getFontPathSystem()
return "/System/Library/Fonts/"; return "/System/Library/Fonts/";
#elif LL_WINDOWS #elif LL_WINDOWS
auto system_root = LLStringUtil::getenv("SystemRoot");
if (! system_root.empty())
{
std::string fontpath(gDirUtilp->add(system_root, "fonts") + gDirUtilp->getDirDelimiter());
LL_INFOS() << "from SystemRoot: " << fontpath << LL_ENDL;
return fontpath;
}
wchar_t *pwstr = NULL; wchar_t *pwstr = NULL;
HRESULT okay = SHGetKnownFolderPath(FOLDERID_Fonts, 0, NULL, &pwstr); HRESULT okay = SHGetKnownFolderPath(FOLDERID_Fonts, 0, NULL, &pwstr);
if (SUCCEEDED(okay) && pwstr) if (SUCCEEDED(okay) && pwstr)
...@@ -1081,6 +1090,7 @@ std::string LLFontGL::getFontPathSystem() ...@@ -1081,6 +1090,7 @@ std::string LLFontGL::getFontPathSystem()
std::string fontpath(ll_convert_wide_to_string(pwstr)); std::string fontpath(ll_convert_wide_to_string(pwstr));
// SHGetKnownFolderPath() contract requires us to free pwstr // SHGetKnownFolderPath() contract requires us to free pwstr
CoTaskMemFree(pwstr); CoTaskMemFree(pwstr);
LL_INFOS() << "from SHGetKnownFolderPath(): " << fontpath << LL_ENDL;
return fontpath; return fontpath;
} }
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment