[mapguide-internals] Defect on win32 in FontManager/Freetype library

UV uvwild at gmail.com
Wed Dec 3 00:39:54 EST 2008


Hello,

I am building the current Mapguide Server now the second time on a
different WIN32 machine and run into the same problem.
As a temporary fix I added a guard in the FontManager but maybe its
better to do this inside the freetype library......


*/Defect
/*The font directory of windows XP installations may contains a
*desktop.ini* file.
When the /Common.Renderers.FontManager /tries to load this file
it causes the method FT_Stream_EnterFrame to fail as there is no font
inside.
This crashes the server.

/*Possible Workaround*/
FontManager.cpp:246
*/                wstring _desktop(L"desktop.ini");  /// filter this
file out/
*        while (bOK && hFile != INVALID_HANDLE_VALUE)
        {
            // do we have a file?
            if (!(FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
            {
*/               ///     skip desktop.ini on windows platform
               if (FindFileData.cFileName != _desktop)
              {
               ///
/*                wstring entryName(fontdir);
                entryName += L"\\";
                entryName += FindFileData.cFileName;

                // ok, load up the face information
                FT_Face face = NULL;
                FT_Long index = 0;
                FT_Long num_faces = 0;

                do
                {
                    string en;
                   
UnicodeString::WideCharToMultiByte(entryName.c_str(), en);
                    error = FT_New_Face(m_library, en.c_str(), index,
&face);

                    if (!error)
                    {
                        // init num_faces if necessary
                        if (!num_faces)
                            num_faces = face->num_faces;
                    }

                    create_font(face, index, entryName.c_str());

                    // dispose of face
                    FT_Done_Face(face);

                    // increment our face index
                    index++;
                }
                while (!error && index < num_faces);
       *        }  // end of skip desktop.ini
*             }
*        *    bOK = FindNextFile(hFile, &FindFileData);



More information about the mapguide-internals mailing list