return myListOfFonts;
}
+// =======================================================================
+// function : GetAvailableFontsNames
+// purpose :
+// =======================================================================
void Font_FontMgr::GetAvailableFontsNames (TColStd_SequenceOfHAsciiString& theFontsNames) const
{
theFontsNames.Clear();
}
}
+// =======================================================================
+// function : GetFont
+// purpose :
+// =======================================================================
Handle(Font_SystemFont) Font_FontMgr::GetFont (const Handle(TCollection_HAsciiString)& theFontName,
- const Font_FontAspect theFontAspect,
+ const Font_FontAspect theFontAspect,
const Standard_Integer theFontSize) const
{
if ( (theFontSize < 2 && theFontSize != -1) || theFontName.IsNull())
return NULL;
}
+// =======================================================================
+// function : FindFont
+// purpose :
+// =======================================================================
Handle(Font_SystemFont) Font_FontMgr::FindFont (const Handle(TCollection_HAsciiString)& theFontName,
- const Font_FontAspect theFontAspect,
+ const Font_FontAspect theFontAspect,
const Standard_Integer theFontSize) const
{
Handle(TCollection_HAsciiString) aFontName = theFontName;
Font_FontAspect aFontAspect = theFontAspect;
- Standard_Integer aFontSize = theFontSize;
+ Standard_Integer aFontSize = theFontSize;
Handle(Font_SystemFont) aFont = GetFont (aFontName, aFontAspect, aFontSize);
-
if (!aFont.IsNull())
{
return aFont;
}
}
- aFont = GetFont (aFontName, aFontAspect, aFontSize);
+ // check font family alias with specified font aspect
+ if (theFontAspect != Font_FA_Undefined
+ && theFontAspect != Font_FA_Regular
+ && theFontAspect != aFontAspect)
+ {
+ aFont = GetFont (aFontName, theFontAspect, aFontSize);
+ if (!aFont.IsNull())
+ {
+ return aFont;
+ }
+ }
+ // check font alias with aspect in the name
+ aFont = GetFont (aFontName, aFontAspect, aFontSize);
if (!aFont.IsNull())
{
return aFont;
// Requested family name not found -> search for any font family with given aspect and height
aFontName = new TCollection_HAsciiString ("");
aFont = GetFont (aFontName, aFontAspect, aFontSize);
-
if (!aFont.IsNull())
{
return aFont;
aFontAspect = Font_FA_Undefined;
aFontSize = -1;
aFont = GetFont (aFontName, aFontAspect, aFontSize);
-
if (!aFont.IsNull())
{
return aFont;