From Joran Jessurun, comments explaining font search rules

This commit is contained in:
Robert Osfield 2005-09-28 13:45:32 +00:00
parent b5c4605d1c
commit 9e5eed280d
2 changed files with 21 additions and 2 deletions

View File

@ -37,7 +37,25 @@ enum KerningType
KERNING_NONE //no kerning
};
/** read a font from specified file.*/
/** Read a font from specified file. The filename may contain a path.
* It will search for the font file in the following places in this order:
* - In the current directory
* - All paths defined in OSG_FILE_PATH or OSGFILEPATH environment variable
* - Filename with path stripped: In the current directory
* - Filename with path stripped: All paths defined in OSG_FILE_PATH or OSGFILEPATH
*
* Then the file will be searched in OS specific directories in the following order:
* - Again in the current directory
* - Windows: In C:/winnt/fonts
* - Windows: In C:/windows/fonts
* - Windows: In the fonts directory of the windows install directory
* - Other OS: In /usr/share/fonts/ttf
* - Other OS: In /usr/share/fonts/ttf/western
* - Other OS: In /usr/share/fonts/ttf/decoratives
*
* If the given file could not be found, the path part will be stripped and
* the file will be searched again in the OS specific directories.
*/
extern OSGTEXT_EXPORT Font* readFontFile(const std::string& filename);

View File

@ -42,7 +42,8 @@ public:
void setFont(Font* font=0);
/** Set the font, loaded from the specified front file, to use to render the text,
* setFont("") sets the use of the default font.*/
* setFont("") sets the use of the default font.
* See the osgText::readFontFile function for how the font file will be located. */
void setFont(const std::string& fontfile);
/** Get the font. Return 0 if default is being used.*/