+ wxStringTokenizer tkn(path, wxPATH_SEP);
+ while ( tkn.HasMoreTokens() )
+ {
+ wxString dir = tkn.GetNextToken();
+
+ wxArrayString indexFiles;
+ if ( !wxDir::GetAllFiles(dir, &indexFiles, _T("FontsIndex")) )
+ continue;
+
+ for ( wxArrayString::const_iterator i = indexFiles.begin();
+ i != indexFiles.end(); ++i )
+ {
+ AddFontsFromDir(*i);
+ }
+ }
+
+ if ( GetBundles().empty() )
+ {
+ // wxDFB is unusable without fonts, so terminate the app
+ wxLogFatalError(_("No fonts found in %s."), path.c_str());
+ }
+}
+
+void wxFontsManager::AddFontsFromDir(const wxString& indexFile)
+{
+ wxFileName fn(indexFile);
+ wxString dir = fn.GetPath();