[osg-users] osgText::readFontFile fails to find font file

714 views
Skip to first unread message

Mike Krus

unread,
Nov 5, 2012, 10:26:52 AM11/5/12
to OpenSceneGraph Users
Hi,
 
I'm having some issues getting OSG to find my font file in Red Hat Enterprise Linux 5.8.
 
From the documentation I can see that osgText::readFontFile should be looking in /usr/share/fonts/ttf to find my fonts, but this path does not exist in RHEL.
 
I have added /usr/share/fonts to my OSG_FILE_PATH environment variable and called osgText::readFontFile("liberation/LiberationSans-Regular.ttf") or osgText::readFontFile("/usr/share/fonts/liberation/LiberationSans-Regular.ttf") but my font is still not found (/usr/share/fonts/liberation/LiberationSans-Regular.ttf exists).
 
The error message I receive is: "Warning: Could not find plugin to read objects from file "..."."

I don't receive any other messages relating to the failure to load plugins, and OSG happily loads Arial in Windows.

Any advice you could provide would be really useful.



----
Mike Krus (PhD) - Principal Software Engineer

Midland Valley Exploration
144 West George Street
Glasgow G2 2HG, UK
Tel: +44 141 332 2681
Fax: +44 141 332 6792

Robert Osfield

unread,
Nov 5, 2012, 12:09:47 PM11/5/12
to OpenSceneGraph Users
Hi Mike,

It's a while since I've seen reports of problems finding fonts, so I guess there must be something unusual going on with your setup/usage.

W.r.t finding fonts, or any files, trying using set the env OSG_NOTIFY_LEVEL to DEBUG and then look for entries relating to FindFileInPath, these should tell you where the OSG is looking for the fonts.

Another avenue you could look at is to try the fonts provided in the OpenSceneGraph-Data distribution, as perhaps the fonts you are attempting to read can't be loaded by freetype.

Robert.

_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Cary, Karl A.

unread,
Nov 5, 2012, 12:12:53 PM11/5/12
to OpenSceneGraph Users

Double check and make sure permissions are not an issue. I had that problem once with my fonts. But as Robert suggested, make sure it is just that the fonts file isn’t readable.

Mike Krus

unread,
Nov 6, 2012, 9:30:21 AM11/6/12
to OpenSceneGraph Users
Hi

thanks all, looked at full debug output, problem solved. The font file was being found, the plugin to load it was not. All well now,


Cheers,

Mike

Nathan Collins

unread,
Oct 30, 2012, 7:55:41 AM10/30/12
to osg-...@lists.openscenegraph.org
Hi,

I'm having some issues getting OSG to find my font file in Red Hat Enterprise Linux 5.8.

From the documentation I can see that osgText::readFontFile should be looking in /usr/share/fonts/ttf to find my fonts, but this path does not exist in RHEL.

I have added /usr/share/fonts to my OSG_FILE_PATH environment variable and called osgText::readFontFile("/liberation/LiberationSans-Regular.ttf") but my font is still not found (/usr/share/fonts/liberation/LiberationSans-Regular.ttf exists).

The error message I receive is: "Warning: Could not find plugin to read objects from file "/liberation/LiberationSans-Regular.ttf"."

I don't receive any other messages relating to the failure to load plugins, and OSG happily loads Arial in Windows.

Any advice you could provide would be really useful.

Thanks,
Nathan

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=50884#50884
Reply all
Reply to author
Forward
0 new messages