PDA

View Full Version : Error with Open Inventor 8.0 - SoFontServer


jrajput
03-10-2010, 08:42 PM
We are migrating Open Inventor 5.0 to 8.0 and I have received following errors. Also, related to this error, my 2D or 3D texts are not displayed. I have searched for SoFontServer but the header file is not found for this class. Does anyone know how to resolve this problem? Thank you for your help.

Here is the error message in the Mercury Computer Systems Error Console:

Inventor error in SoFontServer::SoFontServer();
Error while loading FreeType library.

Jignesh

ndaguise
03-11-2010, 07:38 AM
Hello Jignesh,

The SoFontServer class is an internal class that manage the fonts loading and rendering in OpenInventor, thus in fact, you can't have access to its header file.

The error you are reporting is displayed to user when there is a problem while initializing the IvDLFreetype library (that is dynamically loaded).
Perhaps you can first check the loaded IvDLFreetype.dll (or .so if you are running on Linux) is the good one. Maybe your OpenInventor 8.0 is trying to load the IvDLFreetype from a previous version.

Nicolas

jrajput
03-11-2010, 12:31 PM
Thank you for your reply. I don't have IvDLFreetype.dll file in DEBUG folder. I only have this file in 'C:\Program Files\Mercury\OIV8.0\arch-Windows-x86-msvc9-release\bin' dir. Is there way I can fix it?
Thank you for you help.
Jignesh

mikeheck
03-11-2010, 03:09 PM
I don't have IvDLFreetype.dll file in DEBUG folder. I only have this file in 'C:\Program Files\Mercury\OIV8.0\arch-Windows-x86-msvc9-release\bin' dir. Is there way I can fix it?

Just to be precise, in the -debug\bin directory you should have a file named IvDLFreetypeD.dll (debug build). If this file exists, then we come back to the most common cause of the problem you reported. Check that you do not have an older OIV directory in your path.

If the file seems to be missing from the debug dir, then just to confirm that this is the problem, please confirm that a release build of the application (or any example program that uses text) does work.

Thanks,
Mike

jrajput
03-11-2010, 03:20 PM
Thank you Mike. I do have 'IvDLFreetypeD.dll' file exists in 'C:\Program Files\Mercury\OIV8.0\arch-Windows-x86-msvc9-debug\bin' folder. I am using Visual studio 2008 and I have '$(OIVHOME)\$(OIVARCH)-debug\lib' and '$(OIVHOME)\$(OIVARCH)-release\lib' included under 'Library files' for VC++ directories. Then my OIVARCH environment variable is set to 'arch-Windows-x86-msvc9'. I also have Open Inventor 5.0 installed on my machine which we are using with Visual Studio 2002.

mikeheck
03-11-2010, 03:33 PM
I do have 'IvDLFreetypeD.dll' file exists in 'C:\Program Files\Mercury\OIV8.0\arch-Windows-x86-msvc9-debug\bin' folder. I am using Visual studio 2008 and I have '$(OIVHOME)\$(OIVARCH)-debug\lib' and '$(OIVHOME)\$(OIVARCH)-release\lib' included under 'Library files' for VC++ directories. Then my OIVARCH environment variable is set to 'arch-Windows-x86-msvc9'. I also have Open Inventor 5.0 installed on my machine which we are using with Visual Studio 2002.

OK, that's good news! All the settings you mentioned are good and useful for building the application. What matters at runtime when Windows tries to find all the dependent DLLs is the list of directories in your system PATH environment variable. You can see this by typing "path" in a command prompt window. You probably have your OIV 5.0 "program" directory already in the PATH, so Windows finds a DLL with the right name but it's not actually compatible with the newer version of OIV.

Changing the contents of PATH on Windows is not exactly convenient. :-) But an easy experiment to test our theory is to (temporarily) rename your OIV 5.0 installation directory, e.g. append "X" to the current name. If Windows can't find a directory that's in the PATH, it just ignores it. So now it should find IvDLFreetype in the OIV 8.0 installation and load it successfully.

-Mike

jrajput
03-11-2010, 03:48 PM
Ok. I have replaced 'C:\Program Files\Mercury\OIV5.0' with 'C:\Program Files\Mercury\XOIV5.0' and I can render Text without SoFontServer errors. Thank you. What is the permanent solution?

Thanks for your help.

mikeheck
03-11-2010, 06:28 PM
Ok. I have replaced 'C:\Program Files\Mercury\OIV5.0' with 'C:\Program Files\Mercury\XOIV5.0' and I can render Text without SoFontServer errors. Thank you. What is the permanent solution?

This is really the general problem of managing multiple DLL versions on Windows and I don't know a simple answer. It's why we (and Microsoft) used to make the version number part of the DLL filename, which worked pretty well but had other issues I guess. Basically you can't have two directories in PATH that contain DLLs with the same name, because Windows will always load the first one it finds. In other words whichever version of OIV has its directory first will work, but not the other(s).

Our official recommendation is to define your system PATH using environment variables OIVHOME and OIVARCH. Then you can create scripts to switch from one version to the other by changing these environment variables. This should work for programs that are started after the env vars are changed, but unfortunately does not affect currently running programs. This may not be a big problem for you since you are starting a different version of Visual Studio for each version of OIV. Once VStudio is started with the right path, any executable you start from inside VStudio will inherit the same path.

I have a similar problem with multiple versions of OIV on my machine, but only use one version of VStudio, and often don't want to close and re-open just to build with a different version of OIV. So I use an old DOS trick, the "subst" command. Subst allows you to create a new virtual disk drive, with its own drive letter, based in any directory on an existing disk. In my path I (arbitrarily) have the virtual drives R:\ for release and S:\ for debug DLLs. I have a script for each version of OIV that redefines these virtual drives to the correct actual directory. This change even affects running programs.

-Mike

jrajput
03-12-2010, 12:36 PM
I am curious. We never distirbuted 'IvDLFreetypeD.dll' or ''IvDLFreetype.dll' with our production release or we never needed to have this DLL directly in our executable directories. Is somehting change the way the OV8.0 works than OV5.0?

Thanks.

mikeheck
03-12-2010, 02:46 PM
I am curious. We never distirbuted 'IvDLFreetypeD.dll' or ''IvDLFreetype.dll' with our production release or we never needed to have this DLL directly in our executable directories. Is somehting change the way the OV8.0 works than OV5.0?

Yep, actually it changed in OIV 6.0. Originally we wrote our own code to load font data, but with all the variations on all the platforms it was a significant time sink. FreeType (http://www.freetype.org/) is fast, reliable, high quality and loads more font formats than we ever supported.

There may have been other changes in the list of dependent DLLs since 5.0. Check the "Redistribution" topic in the HTML help (open $OIVHOME/doc/index.html then select Redistribution under the Info item in the menu bar at the top of the page).

-Mike

jrajput
04-06-2010, 02:39 PM
Hello Mike,
I am trying to render SoText3 nodes and I have following message in my debug output window. Can I get some more information on this message and how to get rid of those?
Thank you.

SoFontServer: New reference (3)
SoFontServer: A valid cache has been found: 0xe1963e0
SoFontServer: Add cache 0xe1963e0 to node 0x199a6760
SoFontServer: A valid cache has been found: 0xe1963e0
SoFontServer: Add cache 0xe1963e0 to node 0x199a6760
SoFontServer: A valid cache has been found: 0xe1963e0
SoFontServer: Add cache 0xe1963e0 to node 0x199a6760
SoFontServer: A valid render cache has been found: 0xe1963e0
SoFontServer: Add cache 0xe1963e0 to node 0x199a6760
SoFontServer: A valid cache has been found: 0xe1963e0
SoFontServer: Add cache 0xe1963e0 to node 0x199a6760
SoFontServer: A valid render cache has been found: 0xe1963e0
SoFontServer: Add cache 0xe1963e0 to node 0x199a6760
SoFontServer: A valid cache has been found: 0xe1963e0
SoFontServer: Add cache 0xe1963e0 to node 0xe15eb90
SoFontServer: A valid render cache has been found: 0xe1963e0
SoFontServer: Add cache 0xe1963e0 to node 0xe15eb90
SoFontServer: A valid cache has been found: 0xe1963e0
SoFontServer: Add cache 0xe1963e0 to node 0x199a6760
SoFontServer: A valid render cache has been found: 0xe1963e0
SoFontServer: Add cache 0xe1963e0 to node 0x199a6760
SoFontServer: A valid cache has been found: 0xe1963e0
SoFontServer: Add cache 0xe1963e0 to node 0xe15eb90

ndaguise
04-06-2010, 03:39 PM
Hello Jignesh,

You may have defined the OIV_FONTSERVER_DEBUG environment variable to 1 in an OpenInventor configuration file, or in your system environment. These messages should disappear as soon as you remove this variable.

Nicolas