From dd3603c9dbe58a0f80989ded5b5d284a5d0d99fe Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 10 May 2002 15:42:27 +0000 Subject: [PATCH] Fix for finding windows fonts. --- src/osgText/Font.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/osgText/Font.cpp b/src/osgText/Font.cpp index b78a1d4f1..0d0ec5953 100644 --- a/src/osgText/Font.cpp +++ b/src/osgText/Font.cpp @@ -45,6 +45,16 @@ std::string findFontFile(const std::string& str) char* filename = osgDB::findFile(str.c_str()); if (filename) return std::string(filename); +#if defined(WIN32) + // try windir environment + char *ptr; + if ((ptr = getenv( "windir" ))) + { + static std::string osPath(ptr); + s_FontFilePath = const_cast(osPath.c_str()); + } +#endif + // else fallback into the standard font file paths. if (s_FontFilePath) {