+ const Font_NListOfSystemFont aFonts = aMgr->GetAvailableFonts();
+ std::vector<Handle(Font_SystemFont)> aFontsSorted;
+ aFontsSorted.reserve (aFonts.Size());
+ for (Font_NListOfSystemFont::Iterator aFontIter (aFonts); aFontIter.More(); aFontIter.Next())
+ {
+ aFontsSorted.push_back (aFontIter.Value());
+ }
+ std::stable_sort (aFontsSorted.begin(), aFontsSorted.end(), FontComparator());
+ for (std::vector<Handle(Font_SystemFont)>::iterator aFontIter = aFontsSorted.begin(); aFontIter != aFontsSorted.end(); ++aFontIter)
+ {
+ const Handle(Font_SystemFont)& aFont = *aFontIter;
+ const TCollection_AsciiString aCheck = TCollection_AsciiString ("string match -nocase \"") + aFontName + "\" \"" + aFont->FontName() + "\"";
+ if (theDI.Eval (aCheck.ToCString()) == 0
+ && *theDI.Result() != '1')
+ {
+ theDI.Reset();
+ continue;
+ }
+
+ theDI.Reset();
+ if (!aResult.IsEmpty())
+ {
+ aResult += "\n";
+ }
+
+ aResult += toPrintInfo ? aFont->ToString() : aFont->FontName();
+ if (!toFindAll)
+ {
+ break;
+ }
+ }
+ }
+ else if (Handle(Font_SystemFont) aFont = aMgr->FindFont (aFontName, aStrictLevel, aFontAspect))
+ {
+ aResult = toPrintInfo ? aFont->ToString() : aFont->FontName();
+ }
+
+ if (!aResult.IsEmpty())
+ {
+ theDI << aResult;