mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-05 18:16:23 +03:00
0030474: Visualization - fallback font is ignored for missing font alias within Font_FontMgr::FindFont()
This commit is contained in:
parent
d918208af6
commit
976627e601
@ -702,20 +702,25 @@ Handle(Font_SystemFont) Font_FontMgr::FindFont (const TCollection_AsciiString& t
|
||||
}
|
||||
|
||||
// Trying to use font names mapping
|
||||
for (int aPass = 0; aPass < 2; ++aPass)
|
||||
{
|
||||
Handle(Font_FontAliasSequence) anAliases;
|
||||
const Standard_Boolean hasAliases = myFontAliases.Find (aFontName, anAliases)
|
||||
&& !anAliases.IsNull()
|
||||
&& !anAliases->IsEmpty();
|
||||
if (!hasAliases
|
||||
&& aFont.IsNull())
|
||||
if (aPass == 0)
|
||||
{
|
||||
myFontAliases.Find (aFontName, anAliases);
|
||||
}
|
||||
else
|
||||
{
|
||||
anAliases = myFallbackAlias;
|
||||
}
|
||||
|
||||
bool isAliasUsed = false, isBestAlias = false;
|
||||
if (!anAliases.IsNull()
|
||||
&& !anAliases->IsEmpty())
|
||||
if (anAliases.IsNull()
|
||||
|| anAliases->IsEmpty())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
bool isAliasUsed = false, isBestAlias = false;
|
||||
for (Font_FontAliasSequence::Iterator anAliasIter (*anAliases); anAliasIter.More(); anAliasIter.Next())
|
||||
{
|
||||
const Font_FontAlias& anAlias = anAliasIter.Value();
|
||||
@ -744,7 +749,8 @@ Handle(Font_SystemFont) Font_FontMgr::FindFont (const TCollection_AsciiString& t
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hasAliases)
|
||||
|
||||
if (aPass == 0)
|
||||
{
|
||||
if (isAliasUsed && myToTraceAliases)
|
||||
{
|
||||
@ -755,6 +761,10 @@ Handle(Font_SystemFont) Font_FontMgr::FindFont (const TCollection_AsciiString& t
|
||||
{
|
||||
return aFont;
|
||||
}
|
||||
else if (!aFont.IsNull())
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user