Show
Ignore:
Timestamp:
03/05/10 16:46:17 (5 years ago)
Author:
robert
Message:

From Mathias Froehlich, "If you want to have that qfont plugin loader, this is the updated
implementation which uses osgQt and includes the changes to make fonts load
without a file on disk."

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgText/Font.cpp

    r10959 r11172  
    8484 
    8585    // Not found, return empty string 
    86     osg::notify(osg::WARN)<<"Warning: font file \""<<str<<"\" not found."<<std::endl;     
     86    osg::notify(osg::INFO)<<"Warning: font file \""<<str<<"\" not found."<<std::endl;     
    8787    return std::string(); 
    8888} 
     
    9090osgText::Font* osgText::readFontFile(const std::string& filename, const osgDB::ReaderWriter::Options* userOptions) 
    9191{ 
    92     if (filename=="") return 0; 
     92    if (filename.empty()) return 0; 
    9393 
    9494    std::string foundFile = findFontFile(filename); 
    95     if (foundFile.empty()) return 0; 
     95    if (foundFile.empty()) 
     96        foundFile = filename; 
    9697     
    9798    OpenThreads::ScopedLock<OpenThreads::Mutex> lock(s_FontFileMutex); 
     
    150151osg::ref_ptr<Font> osgText::readRefFontFile(const std::string& filename, const osgDB::ReaderWriter::Options* userOptions) 
    151152{ 
    152     if (filename=="") return 0; 
     153    if (filename.empty()) return 0; 
    153154 
    154155    std::string foundFile = findFontFile(filename); 
    155     if (foundFile.empty()) return 0; 
     156    if (foundFile.empty()) 
     157        foundFile = filename; 
    156158     
    157159    OpenThreads::ScopedLock<OpenThreads::Mutex> lock(s_FontFileMutex); 
     
    253255{ 
    254256    if (_implementation.valid()) return _implementation->getFileName(); 
    255     return ""; 
     257    return std::string(); 
    256258} 
    257259